Skip to content

Commit

Permalink
packages:js:move-to-typescript-code-generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Voldemat committed Nov 11, 2023
1 parent 0ef7ac3 commit a207be3
Show file tree
Hide file tree
Showing 31 changed files with 963 additions and 1,100 deletions.
8 changes: 4 additions & 4 deletions packages/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.1.6",
"typescript": "^5.2.2",
"uuid": "^9.0.0"
}
}
6 changes: 5 additions & 1 deletion packages/js/src/cli/__tests__/generate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ import {
formExpectedCode,
formYamlContent,
loginFieldContent,
passwordFieldContent
passwordFieldContent,
typesExpectedCode
} from './snippets'

describe('CLI:generate', () => {
const techSpecFolder = path.join(os.tmpdir(), 'tech-spec-' + uuid4())
const outputFolder = path.join(os.tmpdir(), 'tech-spec-output-' + uuid4())
const formPath = path.join(outputFolder, 'forms.ts')
const designSystemPath = path.join(outputFolder, 'designs.ts')
const typesSystemPath = path.join(outputFolder, 'types.ts')

function saveDesignSystemFile (content: string): void {
fs.writeFileSync(
Expand Down Expand Up @@ -79,6 +81,8 @@ describe('CLI:generate', () => {
expect(formCode).toBe(formExpectedCode)
const designSystemCode = fs.readFileSync(designSystemPath, 'utf-8')
expect(designSystemCode).toBe(designSystemExpectedCode)
const typesCode = fs.readFileSync(typesSystemPath, 'utf-8')
expect(typesCode).toBe(typesExpectedCode)
}
)
})
Loading

0 comments on commit a207be3

Please sign in to comment.