Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Init tsconfig.json * Initial config of build npm script * Configure TS support in eslint * Add include field to tsconfig.json * Set allowSyntheticDefaultImports to true * Fix quotation in .eslintrc.json * Add dist folder to .prettierignore * Add dist folder to .eslintignore * Ignore some eslint rules Ignore some of the @typescript-eslint rules on existing JavaScript files. * Add npm script to copy files This script copies all files which are not source files from `generators/` to the build output folder `dist`. This is needed since TypeScript only places the generated JavaScript files in the `dist` folder but other files from `generators/` are also needed in the output. * Add copy-files to build script * Configure package.json "main" to use build output * Configure package.json "bin" to use build output * Configure package.json "files" to use build output * Copy package.json to dist in build script * Also copy .ejs files to build output * Adapt JHipster generator lookup paths * Build before installing in install script * Set module system in tsconfig.json to node16 * Pin dependencies * Set build target to ES2022 * Ignore more files in copy-files script Don't copy files ending with .snap and folders starting with __ (currently __snapshots__ & __workflow) to build output. These are files needed for tests or CI which have no use in the build output. * Add test files to exclude in tsconfig.json * Update cli/environment-builder.js * Adapt paths in exports to build output * Don't build when installing from package * Don't use build output for `/esm/*` exports When using the build output for these exports the tests which import these modules as part of the test case fail. This has two reasons: 1. In CI/CD npm run build is not run before the tests so the modules fail to be imported. This could be solved by first building the package. 2. In the tests the modules are imported via ES Modules syntax and the import function and the result is compared for referential equality. When the built file is imported through the import function and it's compared to the source file the reference is always not the same. When this part of the code is converted to TypeScript these issues must be addressed. * Build project in prepare npm script This will build the project when it's installed. * Don't build before installing This should be done by the prepare npm script now. * Remove commented out tsconfig options Co-authored-by: Marcelo Shima <[email protected]>
- Loading branch information