@common-stack/generate-plugin 7.0.3-alpha.2 → 7.0.4-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/lib/generators/add-backend/files/_dockerignore +9 -0
- package/lib/generators/add-backend/files/_gitignore +13 -0
- package/lib/generators/add-backend/files/_npmignore +2 -0
- package/lib/generators/add-backend/files/_yarnrc +1 -0
- package/lib/generators/add-backend/files/package.json +1 -1
- package/lib/generators/add-backend/generator.cjs +6 -1
- package/lib/generators/add-backend/generator.cjs.map +1 -1
- package/lib/generators/add-backend/generator.mjs +6 -1
- package/lib/generators/add-backend/generator.mjs.map +1 -1
- package/lib/generators/add-frontend/generator.cjs +6 -1
- package/lib/generators/add-frontend/generator.cjs.map +1 -1
- package/lib/generators/add-frontend/generator.mjs +6 -1
- package/lib/generators/add-frontend/generator.mjs.map +1 -1
- package/lib/generators/add-frontend/templates/_dockerignore +13 -0
- package/lib/generators/add-frontend/templates/_gitignore +4 -0
- package/lib/generators/add-frontend/templates/_npmignore +2 -0
- package/lib/generators/add-frontend/templates/package.json +2 -2
- package/lib/generators/add-fullstack/files/_browserslistrc +3 -0
- package/{src/generators/add-fullstack/files/.eslintrc.js → lib/generators/add-fullstack/files/_eslintrc.js} +2 -5
- package/lib/generators/add-fullstack/files/_git-crypt/.gitattributes +4 -0
- package/lib/generators/add-fullstack/files/_git-crypt/keys/default/0/147885163DF27F4877B0BC14DE8C27DDE38F1E61.gpg +0 -0
- package/lib/generators/add-fullstack/files/_git-crypt/keys/default/0/49AB3942E38DB928ACF3905EC2DB4383B4A6E5EA.gpg +1 -0
- package/lib/generators/add-fullstack/files/_git-crypt/keys/default/0/49F363DC4362D3C17B2FE0091871B202236FD41B.gpg +0 -0
- package/lib/generators/add-fullstack/files/_git-crypt/keys/default/0/54EBB791640A664510494E416177B1BAA1083A88.gpg +0 -0
- package/lib/generators/add-fullstack/files/_git-crypt/keys/default/0/70961F6ECD8220394FD8AB555E94AC25CBCBA1A3.gpg +0 -0
- package/lib/generators/add-fullstack/files/_git-crypt/keys/default/0/EBA4B7A860BD152BF5F9F727F12B84D048062B79.gpg +0 -0
- package/lib/generators/add-fullstack/files/_gitignore +62 -0
- package/lib/generators/add-fullstack/files/_husky/pre-commit +4 -0
- package/lib/generators/add-fullstack/files/_husky/prepare-commit-msg +4 -0
- package/{src/generators/add-fullstack/files/.markdownlint.json → lib/generators/add-fullstack/files/_markdownlint.json} +1 -1
- package/lib/generators/add-fullstack/files/_npmrc +2 -0
- package/lib/generators/add-fullstack/files/lint-staged.config.js +2 -2
- package/lib/generators/add-fullstack/files/package.json +3 -9
- package/lib/generators/add-fullstack/generator.cjs +51 -20
- package/lib/generators/add-fullstack/generator.cjs.map +1 -1
- package/lib/generators/add-fullstack/generator.d.ts +1 -1
- package/lib/generators/add-fullstack/generator.mjs +45 -14
- package/lib/generators/add-fullstack/generator.mjs.map +1 -1
- package/lib/generators/add-fullstack/updates/{ignoreUpdate.cjs → fileBackup.cjs} +1 -1
- package/lib/generators/add-fullstack/updates/fileBackup.cjs.map +1 -0
- package/lib/generators/add-fullstack/updates/{ignoreUpdate.mjs → fileBackup.mjs} +1 -1
- package/lib/generators/add-fullstack/updates/fileBackup.mjs.map +1 -0
- package/lib/generators/add-fullstack/updates/gitAttributesSetup.cjs +17 -0
- package/lib/generators/add-fullstack/updates/gitAttributesSetup.cjs.map +1 -0
- package/lib/generators/add-fullstack/updates/gitAttributesSetup.d.ts +9 -0
- package/lib/generators/add-fullstack/updates/gitAttributesSetup.mjs +17 -0
- package/lib/generators/add-fullstack/updates/gitAttributesSetup.mjs.map +1 -0
- package/lib/generators/add-fullstack/updates/gitCryptSetup.cjs +70 -0
- package/lib/generators/add-fullstack/updates/gitCryptSetup.cjs.map +1 -0
- package/lib/generators/add-fullstack/updates/gitCryptSetup.d.ts +5 -0
- package/lib/generators/add-fullstack/updates/gitCryptSetup.mjs +70 -0
- package/lib/generators/add-fullstack/updates/gitCryptSetup.mjs.map +1 -0
- package/lib/generators/add-fullstack/updates/gitSetup.cjs +55 -0
- package/lib/generators/add-fullstack/updates/gitSetup.cjs.map +1 -0
- package/lib/generators/add-fullstack/updates/gitSetup.d.ts +9 -0
- package/lib/generators/add-fullstack/updates/gitSetup.mjs +55 -0
- package/lib/generators/add-fullstack/updates/gitSetup.mjs.map +1 -0
- package/lib/generators/add-fullstack/updates/htmlPluginUpdate.cjs +28 -1
- package/lib/generators/add-fullstack/updates/htmlPluginUpdate.cjs.map +1 -1
- package/lib/generators/add-fullstack/updates/htmlPluginUpdate.d.ts +1 -0
- package/lib/generators/add-fullstack/updates/htmlPluginUpdate.mjs +28 -1
- package/lib/generators/add-fullstack/updates/htmlPluginUpdate.mjs.map +1 -1
- package/lib/generators/add-fullstack/updates/huskySetup.cjs +71 -0
- package/lib/generators/add-fullstack/updates/huskySetup.cjs.map +1 -0
- package/lib/generators/add-fullstack/updates/huskySetup.d.ts +2 -0
- package/lib/generators/add-fullstack/updates/huskySetup.mjs +71 -0
- package/lib/generators/add-fullstack/updates/huskySetup.mjs.map +1 -0
- package/lib/generators/add-fullstack/updates/index.d.ts +13 -6
- package/lib/generators/add-fullstack/updates/jenkinsUpdate.cjs +44 -0
- package/lib/generators/add-fullstack/updates/jenkinsUpdate.cjs.map +1 -0
- package/lib/generators/add-fullstack/updates/jenkinsUpdate.mjs +44 -0
- package/lib/generators/add-fullstack/updates/jenkinsUpdate.mjs.map +1 -0
- package/lib/generators/add-fullstack/updates/{lernaJsonUpdate.cjs → lernaUpdate.cjs} +6 -7
- package/lib/generators/add-fullstack/updates/lernaUpdate.cjs.map +1 -0
- package/lib/generators/add-fullstack/updates/{lernaJsonUpdate.mjs → lernaUpdate.mjs} +6 -7
- package/lib/generators/add-fullstack/updates/lernaUpdate.mjs.map +1 -0
- package/lib/generators/add-fullstack/updates/licenseUpdate.cjs +1 -1
- package/lib/generators/add-fullstack/updates/licenseUpdate.cjs.map +1 -1
- package/lib/generators/add-fullstack/updates/licenseUpdate.mjs +1 -1
- package/lib/generators/add-fullstack/updates/licenseUpdate.mjs.map +1 -1
- package/lib/generators/add-fullstack/updates/npmAuthSetup.cjs +60 -0
- package/lib/generators/add-fullstack/updates/npmAuthSetup.cjs.map +1 -0
- package/lib/generators/add-fullstack/updates/npmAuthSetup.d.ts +5 -0
- package/lib/generators/add-fullstack/updates/npmAuthSetup.mjs +60 -0
- package/lib/generators/add-fullstack/updates/npmAuthSetup.mjs.map +1 -0
- package/lib/generators/add-fullstack/updates/nxSetup.cjs +81 -0
- package/lib/generators/add-fullstack/updates/nxSetup.cjs.map +1 -0
- package/lib/generators/add-fullstack/updates/nxSetup.d.ts +5 -0
- package/lib/generators/add-fullstack/updates/nxSetup.mjs +81 -0
- package/lib/generators/add-fullstack/updates/nxSetup.mjs.map +1 -0
- package/lib/generators/add-fullstack/updates/packageJsonUpdate.cjs +2 -34
- package/lib/generators/add-fullstack/updates/packageJsonUpdate.cjs.map +1 -1
- package/lib/generators/add-fullstack/updates/packageJsonUpdate.d.ts +0 -1
- package/lib/generators/add-fullstack/updates/packageJsonUpdate.mjs +2 -34
- package/lib/generators/add-fullstack/updates/packageJsonUpdate.mjs.map +1 -1
- package/lib/generators/add-fullstack/updates/repositoryUpdate.cjs +35 -0
- package/lib/generators/add-fullstack/updates/repositoryUpdate.cjs.map +1 -0
- package/lib/generators/add-fullstack/updates/repositoryUpdate.d.ts +2 -0
- package/lib/generators/add-fullstack/updates/repositoryUpdate.mjs +35 -0
- package/lib/generators/add-fullstack/updates/repositoryUpdate.mjs.map +1 -0
- package/lib/generators/add-moleculer/files/_gitignore +2 -0
- package/lib/generators/add-moleculer/files/package.json +5 -5
- package/lib/generators/add-moleculer/generator.cjs +30 -18
- package/lib/generators/add-moleculer/generator.cjs.map +1 -1
- package/lib/generators/add-moleculer/generator.d.ts +0 -1
- package/lib/generators/add-moleculer/generator.mjs +30 -18
- package/lib/generators/add-moleculer/generator.mjs.map +1 -1
- package/lib/generators/add-moleculer/schema.d.ts +6 -0
- package/lib/generators/add-package/files/browser/LICENSE +674 -0
- package/lib/generators/add-package/files/browser/_npmignore +2 -0
- package/lib/generators/add-package/files/browser/jest.config.js +8 -0
- package/lib/generators/add-package/files/browser/package.json +49 -0
- package/lib/generators/add-package/files/browser/rollup.config.mjs +29 -0
- package/lib/generators/add-package/files/browser/src/config/env-config.ts.template +9 -0
- package/lib/generators/add-package/files/browser/src/index.ts.template +4 -0
- package/lib/generators/add-package/files/browser/src/interfaces/index.ts.template +1 -0
- package/lib/generators/add-package/files/browser/src/interfaces/interfaces.ts.template +1 -0
- package/lib/generators/add-package/files/browser/src/module.tsx.template +7 -0
- package/lib/generators/add-package/files/browser/tsconfig.json +28 -0
- package/lib/generators/add-package/files/browser/webpack.config.js +71 -0
- package/lib/generators/add-package/files/client/LICENSE +674 -0
- package/lib/generators/add-package/files/client/_npmignore +2 -0
- package/lib/generators/add-package/files/client/jest.config.js +13 -0
- package/lib/generators/add-package/files/client/package.json +30 -0
- package/lib/generators/add-package/files/client/rollup.config.mjs +29 -0
- package/lib/generators/add-package/files/client/src/components/index.tsx.template +1 -0
- package/lib/generators/add-package/files/client/src/config/env-config.ts.template +9 -0
- package/lib/generators/add-package/files/client/src/index.ts.template +1 -0
- package/lib/generators/add-package/files/client/tsconfig.json +27 -0
- package/lib/generators/add-package/files/client/webpack.config.js +72 -0
- package/lib/generators/add-package/files/core/LICENSE +39 -0
- package/lib/generators/add-package/files/core/_npmignore +3 -0
- package/lib/generators/add-package/files/core/jest.config.js +3 -0
- package/lib/generators/add-package/files/core/package.json +30 -0
- package/lib/generators/add-package/files/core/rollup.config.mjs +65 -0
- package/lib/generators/add-package/files/core/src/cdm-locales/en/main.json +2 -0
- package/lib/generators/add-package/files/core/src/cdm-locales/es/common.json +2 -0
- package/lib/generators/add-package/files/core/src/cdm-locales/es/main.json +1 -0
- package/lib/generators/add-package/files/core/src/config/env-config.ts.template +9 -0
- package/lib/generators/add-package/files/core/src/constants/index.ts.template +1 -0
- package/lib/generators/add-package/files/core/src/constants/types.ts.template +3 -0
- package/lib/generators/add-package/files/core/src/index.ts.template +2 -0
- package/lib/generators/add-package/files/core/src/types/index.ts.template +1 -0
- package/lib/generators/add-package/files/core/src/types/types.ts.template +17 -0
- package/lib/generators/add-package/files/core/tsconfig.json +22 -0
- package/lib/generators/add-package/files/core/webpack.config.js +53 -0
- package/lib/generators/add-package/files/server/LICENSE +674 -0
- package/lib/generators/add-package/files/server/_npmignore +2 -0
- package/lib/generators/add-package/files/server/jest.config.js +32 -0
- package/lib/generators/add-package/files/server/package.json +78 -0
- package/lib/generators/add-package/files/server/rollup.config.mjs +30 -0
- package/lib/generators/add-package/files/server/src/config/env-config.ts.template +9 -0
- package/lib/generators/add-package/files/server/src/constants/constants.ts.template +62 -0
- package/lib/generators/add-package/files/server/src/constants/index.ts.template +1 -0
- package/lib/generators/add-package/files/server/src/constants/types.ts.template +21 -0
- package/lib/generators/add-package/files/server/src/index.ts.template +6 -0
- package/lib/generators/add-package/files/server/src/module.ts.template +6 -0
- package/lib/generators/add-package/files/server/tsconfig.json +27 -0
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +5 -5
- package/lib/index.mjs +1 -1
- package/lib/utils/copyDotfiles.cjs +86 -0
- package/lib/utils/copyDotfiles.cjs.map +1 -0
- package/lib/utils/copyDotfiles.d.ts +14 -0
- package/lib/utils/copyDotfiles.mjs +86 -0
- package/lib/utils/copyDotfiles.mjs.map +1 -0
- package/package.json +3 -3
- package/src/generators/add-backend/files/Dockerfile +28 -0
- package/src/generators/add-backend/files/LICENSE +661 -0
- package/src/generators/add-backend/files/README.md +133 -0
- package/src/generators/add-backend/files/__tests__/test.ts.template +96 -0
- package/src/generators/add-backend/files/_dockerignore +9 -0
- package/src/generators/add-backend/files/_gitignore +13 -0
- package/src/generators/add-backend/files/_npmignore +2 -0
- package/src/generators/add-backend/files/_yarnrc +1 -0
- package/src/generators/add-backend/files/babel.config.js +45 -0
- package/src/generators/add-backend/files/build.config.js +14 -0
- package/src/generators/add-backend/files/build.config.mjs +27 -0
- package/src/generators/add-backend/files/config.json +10 -0
- package/src/generators/add-backend/files/jest.config.js +27 -0
- package/src/generators/add-backend/files/package.json +82 -0
- package/src/generators/add-backend/files/src/api/root-schema.graphqls +109 -0
- package/src/generators/add-backend/files/src/config/env-config.ts.template +12 -0
- package/src/generators/add-backend/files/src/config/index.ts.template +1 -0
- package/src/generators/add-backend/files/src/env.ts.template +5 -0
- package/src/generators/add-backend/files/src/index.ts.template +56 -0
- package/src/generators/add-backend/files/src/modules/index.ts.template +17 -0
- package/src/generators/add-backend/files/src/service.ts.template +35 -0
- package/src/generators/add-backend/files/tsconfig.base.json +30 -0
- package/src/generators/add-backend/files/tsconfig.json +13 -0
- package/src/generators/add-backend/files/webpack.config.js +200 -0
- package/src/generators/add-backend/files/webpack.config.mjs +216 -0
- package/src/generators/add-backend/generator.ts +13 -4
- package/src/generators/add-frontend/generator.ts +8 -0
- package/src/generators/add-frontend/templates/CHANGELOG.md +72 -0
- package/src/generators/add-frontend/templates/Dockerfile +31 -0
- package/src/generators/add-frontend/templates/_browserslistrc +3 -0
- package/src/generators/add-frontend/templates/_dockerignore +13 -0
- package/src/generators/add-frontend/templates/_gitignore +4 -0
- package/src/generators/add-frontend/templates/_npmignore +2 -0
- package/src/generators/add-frontend/templates/codecept.json +28 -0
- package/src/generators/add-frontend/templates/config.json +5 -0
- package/src/generators/add-frontend/templates/env.d.ts.template +9 -0
- package/src/generators/add-frontend/templates/env.js +5 -0
- package/src/generators/add-frontend/templates/favicon.ico +0 -0
- package/src/generators/add-frontend/templates/jest.config.js +33 -0
- package/src/generators/add-frontend/templates/package.json +102 -0
- package/src/generators/add-frontend/templates/public/favicon.ico +0 -0
- package/src/generators/add-frontend/templates/server.js +78 -0
- package/src/generators/add-frontend/templates/src/config/public-config.ts.template +88 -0
- package/src/generators/add-frontend/templates/tools/checkQueryUsage.mjs +192 -0
- package/src/generators/add-frontend/templates/tools/mergeConfig.js +35 -0
- package/src/generators/add-frontend/templates/tsconfig.base.json +38 -0
- package/src/generators/add-frontend/templates/tsconfig.json +32 -0
- package/src/generators/add-frontend/templates/tsconfig.node.json +10 -0
- package/src/generators/add-frontend/templates/vite.config.ts.template +115 -0
- package/src/generators/add-fullstack/files/_browserslistrc +3 -0
- package/src/generators/add-fullstack/files/_eslintignore +3 -0
- package/src/generators/add-fullstack/files/_eslintrc.js +89 -0
- package/src/generators/add-fullstack/files/_git-crypt/.gitattributes +4 -0
- package/src/generators/add-fullstack/files/_git-crypt/keys/default/0/147885163DF27F4877B0BC14DE8C27DDE38F1E61.gpg +0 -0
- package/src/generators/add-fullstack/files/_git-crypt/keys/default/0/49AB3942E38DB928ACF3905EC2DB4383B4A6E5EA.gpg +1 -0
- package/src/generators/add-fullstack/files/_git-crypt/keys/default/0/49F363DC4362D3C17B2FE0091871B202236FD41B.gpg +0 -0
- package/src/generators/add-fullstack/files/_git-crypt/keys/default/0/54EBB791640A664510494E416177B1BAA1083A88.gpg +0 -0
- package/src/generators/add-fullstack/files/_git-crypt/keys/default/0/70961F6ECD8220394FD8AB555E94AC25CBCBA1A3.gpg +0 -0
- package/src/generators/add-fullstack/files/_git-crypt/keys/default/0/EBA4B7A860BD152BF5F9F727F12B84D048062B79.gpg +0 -0
- package/src/generators/add-fullstack/files/_gitattributes +5 -0
- package/src/generators/add-fullstack/files/_gitignore +62 -0
- package/src/generators/add-fullstack/files/_husky/pre-commit +4 -0
- package/src/generators/add-fullstack/files/_husky/prepare-commit-msg +4 -0
- package/src/generators/add-fullstack/files/_markdownlint.json +6 -0
- package/src/generators/add-fullstack/files/_markdownlintignore +5 -0
- package/src/generators/add-fullstack/files/_npmrc +2 -0
- package/src/generators/add-fullstack/files/_nxignore +8 -0
- package/src/generators/add-fullstack/files/lint-staged.config.js +2 -2
- package/src/generators/add-fullstack/files/package.json +3 -9
- package/src/generators/add-fullstack/generator.spec.ts +2 -0
- package/src/generators/add-fullstack/generator.ts +74 -20
- package/src/generators/add-fullstack/schema.d.ts +2 -2
- package/src/generators/add-fullstack/updates/gitAttributesSetup.ts +60 -0
- package/src/generators/add-fullstack/updates/gitCryptSetup.ts +77 -0
- package/src/generators/add-fullstack/updates/gitSetup.ts +63 -0
- package/src/generators/add-fullstack/updates/htmlPluginUpdate.ts +31 -0
- package/src/generators/add-fullstack/updates/huskySetup.ts +84 -0
- package/src/generators/add-fullstack/updates/index.ts +13 -6
- package/src/generators/add-fullstack/updates/jenkinsUpdate.ts +53 -0
- package/src/generators/add-fullstack/updates/{lernaJsonUpdate.ts → lernaUpdate.ts} +6 -7
- package/src/generators/add-fullstack/updates/licenseUpdate.ts +3 -3
- package/src/generators/add-fullstack/updates/npmAuthSetup.ts +76 -0
- package/src/generators/add-fullstack/updates/nxSetup.ts +95 -0
- package/src/generators/add-fullstack/updates/packageJsonUpdate.ts +4 -42
- package/src/generators/add-fullstack/updates/repositoryUpdate.ts +45 -0
- package/src/generators/add-moleculer/files/_dockerignore +6 -0
- package/src/generators/add-moleculer/files/_draftignore +4 -0
- package/src/generators/add-moleculer/files/_gitignore +2 -0
- package/src/generators/add-moleculer/files/package.json +5 -5
- package/src/generators/add-moleculer/generator.ts +42 -18
- package/src/generators/add-moleculer/schema.ts +6 -0
- package/src/generators/add-package/files/browser/LICENSE +674 -0
- package/src/generators/add-package/files/browser/_npmignore +2 -0
- package/src/generators/add-package/files/browser/jest.config.js +8 -0
- package/src/generators/add-package/files/browser/package.json +49 -0
- package/src/generators/add-package/files/browser/rollup.config.mjs +29 -0
- package/src/generators/add-package/files/browser/src/config/env-config.ts.template +9 -0
- package/src/generators/add-package/files/browser/src/index.ts.template +4 -0
- package/src/generators/add-package/files/browser/src/interfaces/index.ts.template +1 -0
- package/src/generators/add-package/files/browser/src/interfaces/interfaces.ts.template +1 -0
- package/src/generators/add-package/files/browser/src/module.tsx.template +7 -0
- package/src/generators/add-package/files/browser/tsconfig.json +28 -0
- package/src/generators/add-package/files/browser/webpack.config.js +71 -0
- package/src/generators/add-package/files/client/LICENSE +674 -0
- package/src/generators/add-package/files/client/_npmignore +2 -0
- package/src/generators/add-package/files/client/jest.config.js +13 -0
- package/src/generators/add-package/files/client/package.json +30 -0
- package/src/generators/add-package/files/client/rollup.config.mjs +29 -0
- package/src/generators/add-package/files/client/src/components/index.tsx.template +1 -0
- package/src/generators/add-package/files/client/src/config/env-config.ts.template +9 -0
- package/src/generators/add-package/files/client/src/index.ts.template +1 -0
- package/src/generators/add-package/files/client/tsconfig.json +27 -0
- package/src/generators/add-package/files/client/webpack.config.js +72 -0
- package/src/generators/add-package/files/core/LICENSE +39 -0
- package/src/generators/add-package/files/core/_npmignore +3 -0
- package/src/generators/add-package/files/core/jest.config.js +3 -0
- package/src/generators/add-package/files/core/package.json +30 -0
- package/src/generators/add-package/files/core/rollup.config.mjs +65 -0
- package/src/generators/add-package/files/core/src/cdm-locales/en/main.json +2 -0
- package/src/generators/add-package/files/core/src/cdm-locales/es/common.json +2 -0
- package/src/generators/add-package/files/core/src/cdm-locales/es/main.json +1 -0
- package/src/generators/add-package/files/core/src/config/env-config.ts.template +9 -0
- package/src/generators/add-package/files/core/src/constants/index.ts.template +1 -0
- package/src/generators/add-package/files/core/src/constants/types.ts.template +3 -0
- package/src/generators/add-package/files/core/src/index.ts.template +2 -0
- package/src/generators/add-package/files/core/src/types/index.ts.template +1 -0
- package/src/generators/add-package/files/core/src/types/types.ts.template +17 -0
- package/src/generators/add-package/files/core/tsconfig.json +22 -0
- package/src/generators/add-package/files/core/webpack.config.js +53 -0
- package/src/generators/add-package/files/server/LICENSE +674 -0
- package/src/generators/add-package/files/server/_npmignore +2 -0
- package/src/generators/add-package/files/server/jest.config.js +32 -0
- package/src/generators/add-package/files/server/package.json +78 -0
- package/src/generators/add-package/files/server/rollup.config.mjs +30 -0
- package/src/generators/add-package/files/server/src/config/env-config.ts.template +9 -0
- package/src/generators/add-package/files/server/src/constants/constants.ts.template +62 -0
- package/src/generators/add-package/files/server/src/constants/index.ts.template +1 -0
- package/src/generators/add-package/files/server/src/constants/types.ts.template +21 -0
- package/src/generators/add-package/files/server/src/index.ts.template +6 -0
- package/src/generators/add-package/files/server/src/module.ts.template +6 -0
- package/src/generators/add-package/files/server/tsconfig.json +27 -0
- package/src/index.ts +7 -6
- package/src/utils/copyDotfiles.ts +96 -0
- package/lib/generators/add-fullstack/updates/ignoreUpdate.cjs.map +0 -1
- package/lib/generators/add-fullstack/updates/ignoreUpdate.mjs.map +0 -1
- package/lib/generators/add-fullstack/updates/jenkinsfileUpdate.cjs +0 -37
- package/lib/generators/add-fullstack/updates/jenkinsfileUpdate.cjs.map +0 -1
- package/lib/generators/add-fullstack/updates/jenkinsfileUpdate.mjs +0 -37
- package/lib/generators/add-fullstack/updates/jenkinsfileUpdate.mjs.map +0 -1
- package/lib/generators/add-fullstack/updates/lernaJsonUpdate.cjs.map +0 -1
- package/lib/generators/add-fullstack/updates/lernaJsonUpdate.mjs.map +0 -1
- package/src/generators/add-fullstack/files/.husky/pre-commit +0 -1
- package/src/generators/add-fullstack/files/.travis.yml +0 -18
- package/src/generators/add-fullstack/updates/jenkinsfileUpdate.ts +0 -49
- /package/{src/generators/add-fullstack/files/.browserslistrc → lib/generators/add-frontend/templates/_browserslistrc} +0 -0
- /package/{src/generators/add-fullstack/files/.eslintignore → lib/generators/add-fullstack/files/_eslintignore} +0 -0
- /package/{src/generators/add-fullstack/files/.gitattributes → lib/generators/add-fullstack/files/_gitattributes} +0 -0
- /package/{src/generators/add-fullstack/files/.markdownlintignore → lib/generators/add-fullstack/files/_markdownlintignore} +0 -0
- /package/{src/generators/add-fullstack/.nxignore → lib/generators/add-fullstack/files/_nxignore} +0 -0
- /package/lib/generators/add-fullstack/updates/{ignoreUpdate.d.ts → fileBackup.d.ts} +0 -0
- /package/lib/generators/add-fullstack/updates/{jenkinsfileUpdate.d.ts → jenkinsUpdate.d.ts} +0 -0
- /package/lib/generators/add-fullstack/updates/{lernaJsonUpdate.d.ts → lernaUpdate.d.ts} +0 -0
- /package/{src/generators/add-moleculer/files/.dockerignore → lib/generators/add-moleculer/files/_dockerignore} +0 -0
- /package/{src/generators/add-moleculer/files/.draftignore → lib/generators/add-moleculer/files/_draftignore} +0 -0
- /package/src/generators/add-fullstack/updates/{ignoreUpdate.ts → fileBackup.ts} +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const base = require('../../../jest.config.base');
|
|
2
|
+
const packageJson = require('./package');
|
|
3
|
+
const merge = require('merge')
|
|
4
|
+
const baseConfig = require('../../../jest.config.base');
|
|
5
|
+
const mongodbConfig = require('../../../jest.config.mongodb');
|
|
6
|
+
|
|
7
|
+
const mergeData = merge.recursive(
|
|
8
|
+
baseConfig,
|
|
9
|
+
{
|
|
10
|
+
"transform": {
|
|
11
|
+
"\\.(js|jsx)?$": "../../../transform.js",
|
|
12
|
+
},
|
|
13
|
+
moduleNameMapper: {
|
|
14
|
+
'^__mocks__/(.*)$': '<rootDir>/../../__mocks__/$1',
|
|
15
|
+
// we'll use commonjs version of lodash for tests 👌
|
|
16
|
+
// because we don't need to use any kind of tree shaking right?!
|
|
17
|
+
'^lodash-es$': '<rootDir>/../../../node_modules/lodash/index.js',
|
|
18
|
+
'@adminide-stack\/core': '<rootDir>/../../adminide-core/src/index.ts',
|
|
19
|
+
},
|
|
20
|
+
roots: [
|
|
21
|
+
"src",
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
mongodbConfig,
|
|
25
|
+
{
|
|
26
|
+
globals: {
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
module.exports = mergeData;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "server-package",
|
|
3
|
+
"version": "3.1.1-alpha.5",
|
|
4
|
+
"description": "Sample core for higher packages to depend on",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "CDMBase LLC",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "lib/index.js",
|
|
9
|
+
"module": "lib/index.js",
|
|
10
|
+
"typings": "lib/index.d.ts",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "npm run build:clean && npm run build:lib",
|
|
13
|
+
"build:clean": "rimraf lib",
|
|
14
|
+
"build:lib": "rollup -c rollup.config.mjs",
|
|
15
|
+
"build:lib:watch": "npm run build:lib -- --watch",
|
|
16
|
+
"jest": "./node_modules/.bin/jest",
|
|
17
|
+
"prepublish": "npm run build",
|
|
18
|
+
"schema:download": "./node_modules/.bin/apollo-codegen download-schema http://localhost:8080/graphql --output schema.json ",
|
|
19
|
+
"schema:generate": "./node_modules/.bin/apollo-codegen generate src/browser/graphql/**/*.gql --schema schema.json --target typescript --output src/browser/graphql/schema.ts",
|
|
20
|
+
"test": "cross-env ENV_FILE=../../../config/test/test.env jest",
|
|
21
|
+
"test:debug": "npm test -- --runInBand",
|
|
22
|
+
"test:watch": "npm test -- --watch",
|
|
23
|
+
"watch": "npm run build:lib:watch"
|
|
24
|
+
},
|
|
25
|
+
"jest": {
|
|
26
|
+
"moduleFileExtensions": [
|
|
27
|
+
"ts",
|
|
28
|
+
"tsx",
|
|
29
|
+
"js",
|
|
30
|
+
"json"
|
|
31
|
+
],
|
|
32
|
+
"modulePaths": [
|
|
33
|
+
"node_modules"
|
|
34
|
+
],
|
|
35
|
+
"roots": [
|
|
36
|
+
"src"
|
|
37
|
+
],
|
|
38
|
+
"testEnvironment": "node",
|
|
39
|
+
"testRegex": "/__tests__/.*test*\\.(ts|tsx|js)$",
|
|
40
|
+
"transform": {
|
|
41
|
+
"\\.ts$": [
|
|
42
|
+
"ts-jest"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@casl/ability": "4.1.6",
|
|
48
|
+
"axios": "^0.19.0",
|
|
49
|
+
"bottleneck": "2.19.5",
|
|
50
|
+
"decamelize": "4.0.0",
|
|
51
|
+
"fastest-validator": "1.9.0",
|
|
52
|
+
"moment": "2.27.0",
|
|
53
|
+
"pluralize": "8.0.0",
|
|
54
|
+
"qs": "^6.10.1",
|
|
55
|
+
"query-string": "^9.0.0",
|
|
56
|
+
"uuid": "^10.0.0"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@types/qs": "^6.9.6",
|
|
60
|
+
"express-nock": "^0.1.1"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"@apollo/client": ">=3.0.0",
|
|
64
|
+
"@cdm-logger/server": ">=9.0.3",
|
|
65
|
+
"@common-stack/core": "7.0.4-alpha.0",
|
|
66
|
+
"@common-stack/server-core": "7.0.4-alpha.0",
|
|
67
|
+
"@common-stack/store-mongo": "7.0.4-alpha.0",
|
|
68
|
+
"@container-stack/mailing-api": ">=0.0.35-alpha.1",
|
|
69
|
+
"@vscode-alt/monaco-editor": "^0.21.4",
|
|
70
|
+
"inversify": "^5.0.1",
|
|
71
|
+
"lodash": "^4.17.15",
|
|
72
|
+
"moleculer": "^0.14.2",
|
|
73
|
+
"mongoose": "^6.3.3"
|
|
74
|
+
},
|
|
75
|
+
"typescript": {
|
|
76
|
+
"definition": "lib/index.d.ts"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createRollupConfig } from '../../../rollup.config.base.mjs';
|
|
2
|
+
import json from '@rollup/plugin-json'
|
|
3
|
+
|
|
4
|
+
// Define any additional plugins specific to this bundle
|
|
5
|
+
const additionalPlugins = [
|
|
6
|
+
json()
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
// Use the createRollupConfig function to merge the base and specific configurations
|
|
10
|
+
export default [
|
|
11
|
+
createRollupConfig({
|
|
12
|
+
input: ['src/index.ts'],
|
|
13
|
+
plugins: [
|
|
14
|
+
// Spread in additional plugins specific to this config
|
|
15
|
+
...additionalPlugins,
|
|
16
|
+
],
|
|
17
|
+
output: [
|
|
18
|
+
{
|
|
19
|
+
dir: 'lib',
|
|
20
|
+
format: 'es',
|
|
21
|
+
name: 'Server',
|
|
22
|
+
compact: true,
|
|
23
|
+
exports: 'named',
|
|
24
|
+
sourcemap: true,
|
|
25
|
+
preserveModules: true,
|
|
26
|
+
chunkFileNames: '[name]-[hash].[format].js',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
}),
|
|
30
|
+
];
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { IMachineConfigRow } from '../interfaces/billing-service';
|
|
2
|
+
|
|
3
|
+
export enum EGoogleConstants {
|
|
4
|
+
GCEService = '6F81-5844-456A',
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export enum EGoogleResourceGroup {
|
|
8
|
+
CPU = 'CPU',
|
|
9
|
+
GPU = 'GPU',
|
|
10
|
+
RAM = 'RAM',
|
|
11
|
+
N1Highmem = 'N1Highmem',
|
|
12
|
+
N1Highcpu = 'N1Highcpu',
|
|
13
|
+
N1Standard = 'N1Standard',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export enum EGoogleResourceFamily {
|
|
17
|
+
Network = 'Network',
|
|
18
|
+
License = 'License',
|
|
19
|
+
Compute = 'Compute',
|
|
20
|
+
Storage = 'Storage',
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export enum MoleculerTopics {
|
|
24
|
+
Billing = 'Billing',
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export enum BillingCommands {
|
|
28
|
+
charge = 'charge',
|
|
29
|
+
price = 'price',
|
|
30
|
+
process = 'process',
|
|
31
|
+
table = 'table',
|
|
32
|
+
calculate = 'calculate',
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const MAX_CONTAINER_LIMIT = 20;
|
|
36
|
+
|
|
37
|
+
export interface IMachinesValues {
|
|
38
|
+
[propName: string]: IMachineConfigRow;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const MachineConfig: IMachinesValues = {
|
|
42
|
+
HCpu2: { id: 'n1-highcpu-2', cpu: 2, ram: 1800 },
|
|
43
|
+
HCpu4: { id: 'n1-highcpu-4', cpu: 4, ram: 3600 },
|
|
44
|
+
HCpu8: { id: 'n1-highcpu-8', cpu: 8, ram: 7200 },
|
|
45
|
+
HCpu16: { id: 'n1-highcpu-16', cpu: 16, ram: 14400 },
|
|
46
|
+
HCpu32: { id: 'n1-highcpu-32', cpu: 32, ram: 28800 },
|
|
47
|
+
|
|
48
|
+
HRam2: { id: 'n1-highmem-2', cpu: 2, ram: 13000 },
|
|
49
|
+
HRam4: { id: 'n1-highmem-4', cpu: 4, ram: 26000 },
|
|
50
|
+
HRam8: { id: 'n1-highmem-8', cpu: 8, ram: 52000 },
|
|
51
|
+
HRam16: { id: 'n1-highmem-16', cpu: 16, ram: 104000 },
|
|
52
|
+
HRam32: { id: 'n1-highmem-32', cpu: 32, ram: 208000 },
|
|
53
|
+
|
|
54
|
+
MStandard1: { id: 'n1-standard-1', cpu: 1, ram: 3750 },
|
|
55
|
+
MStandard2: { id: 'n1-standard-2', cpu: 2, ram: 7500 },
|
|
56
|
+
MStandard4: { id: 'n1-standard-4', cpu: 4, ram: 15000 },
|
|
57
|
+
MStandard8: { id: 'n1-standard-8', cpu: 8, ram: 30000 },
|
|
58
|
+
MStandard16: { id: 'n1-standard-16', cpu: 16, ram: 60000 },
|
|
59
|
+
MStandard32: { id: 'n1-standard-32', cpu: 32, ram: 120000 },
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const DEFAULT_TRIAL_DAYS = 15;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './constants';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export enum TYPES {
|
|
5
|
+
BillingService = 'BillingService',
|
|
6
|
+
PaymentService = 'PaymentService',
|
|
7
|
+
PricingService = 'PricingService',
|
|
8
|
+
BillingReportService = 'BillingReportService',
|
|
9
|
+
|
|
10
|
+
PricingApi = 'PricingApi',
|
|
11
|
+
PaymentGateway = 'PaymentGateway',
|
|
12
|
+
|
|
13
|
+
PricesRepository = 'PricesRepository',
|
|
14
|
+
BillingPlanRepository = 'BillingPlanRepository',
|
|
15
|
+
BillingReportsRepository = 'BillingReportsRepository',
|
|
16
|
+
ISubscriptionRepository= 'ISubscriptionRepository',
|
|
17
|
+
IBillingPlanService = 'IBillingPlanService',
|
|
18
|
+
IPaymentProfileRepository= 'IPaymentProfileRepository',
|
|
19
|
+
IStripeIntegrationService= 'IStripeIntegrationService',
|
|
20
|
+
IPaypalIntegrationService= 'IPaypalIntegrationService',
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"resolveJsonModule": true,
|
|
5
|
+
"rootDir": "./src",
|
|
6
|
+
"outDir": "lib",
|
|
7
|
+
"sourceMap": false,
|
|
8
|
+
"noEmitOnError": false,
|
|
9
|
+
"declarationDir": "lib",
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"declaration": true,
|
|
12
|
+
"declarationMap": true,
|
|
13
|
+
"types": [
|
|
14
|
+
"@types/node",
|
|
15
|
+
"@types/jest",
|
|
16
|
+
"../../../typings"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"include": ["src"],
|
|
20
|
+
"exclude": [
|
|
21
|
+
"node_modules",
|
|
22
|
+
"lib",
|
|
23
|
+
"dist",
|
|
24
|
+
"rollup.config.mjs",
|
|
25
|
+
"webpack.config.js"
|
|
26
|
+
]
|
|
27
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export * from './generators/add-frontend/generator';
|
|
2
|
-
export * from './generators/add-backend/generator';
|
|
3
|
-
export * from './generators/add-fullstack/generator';
|
|
4
|
-
export * from './generators/add-moleculer/generator';
|
|
5
|
-
export * from './generators/add-package/generator';
|
|
6
1
|
export { default as updateDeployVersion } from './executors/update-deploy-version/executor';
|
|
7
|
-
export { default as sortPackageJson } from './executors/sort-package-json/executor';
|
|
2
|
+
export { default as sortPackageJson } from './executors/sort-package-json/executor';
|
|
3
|
+
// Export the generator functions
|
|
4
|
+
export { addFullstackGenerator } from './generators/add-fullstack/generator';
|
|
5
|
+
export { addBackendGenerator } from './generators/add-backend/generator';
|
|
6
|
+
export { addFrontendGenerator } from './generators/add-frontend/generator';
|
|
7
|
+
export { addMoleculerGenerator } from './generators/add-moleculer/generator';
|
|
8
|
+
export { addPackageGenerator } from './generators/add-package/generator';
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Copies .npmrc from the project root to the targeted component directory
|
|
6
|
+
* @param tree The Nx tree
|
|
7
|
+
* @param projectRoot The main project root
|
|
8
|
+
* @param targetDirectory The component directory (e.g. packages/frontend)
|
|
9
|
+
*/
|
|
10
|
+
export function copyNpmrc(tree: Tree, projectRoot: string, targetDirectory: string) {
|
|
11
|
+
try {
|
|
12
|
+
// Make sure target directory exists
|
|
13
|
+
if (!tree.exists(targetDirectory)) {
|
|
14
|
+
console.log(`Target directory ${targetDirectory} doesn't exist, skipping .npmrc copying`);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Copy .npmrc if it exists in the project root but not in the target
|
|
19
|
+
const sourceFile = path.join(projectRoot, '.npmrc');
|
|
20
|
+
const targetFile = path.join(targetDirectory, '.npmrc');
|
|
21
|
+
|
|
22
|
+
if (tree.exists(sourceFile) && !tree.exists(targetFile)) {
|
|
23
|
+
const content = tree.read(sourceFile)?.toString();
|
|
24
|
+
if (content) {
|
|
25
|
+
tree.write(targetFile, content);
|
|
26
|
+
console.log(`Copied .npmrc from project root to ${targetDirectory}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
} catch (error) {
|
|
30
|
+
console.error(`Error copying .npmrc to ${targetDirectory}:`, error);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Renames specific files that begin with underscore to dotfiles
|
|
36
|
+
* @param tree The Nx tree
|
|
37
|
+
* @param directory The directory to process
|
|
38
|
+
*/
|
|
39
|
+
export function renameDotFiles(tree: Tree, directory: string) {
|
|
40
|
+
try {
|
|
41
|
+
// List of known underscore prefixed files to be renamed to dot files
|
|
42
|
+
const knownDotFiles = [
|
|
43
|
+
'browserslistrc',
|
|
44
|
+
'dockerignore',
|
|
45
|
+
'gitignore',
|
|
46
|
+
'npmignore',
|
|
47
|
+
'npmrc',
|
|
48
|
+
'editorconfig',
|
|
49
|
+
'eslintrc.js',
|
|
50
|
+
'prettierrc',
|
|
51
|
+
'babelrc',
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
// Get all files in the directory
|
|
55
|
+
const files = tree.children(directory);
|
|
56
|
+
|
|
57
|
+
// Check each file
|
|
58
|
+
files.forEach((file) => {
|
|
59
|
+
// If it starts with underscore, check if it should be renamed
|
|
60
|
+
if (file.startsWith('_')) {
|
|
61
|
+
const pureName = file.substring(1); // Remove the underscore
|
|
62
|
+
|
|
63
|
+
// Check if this file should be renamed
|
|
64
|
+
if (
|
|
65
|
+
knownDotFiles.includes(pureName) ||
|
|
66
|
+
knownDotFiles.some((dotFile) => pureName.startsWith(dotFile + '.'))
|
|
67
|
+
) {
|
|
68
|
+
const oldPath = path.join(directory, file);
|
|
69
|
+
const newPath = path.join(directory, `.${pureName}`);
|
|
70
|
+
|
|
71
|
+
// If it's a file and exists
|
|
72
|
+
if (tree.exists(oldPath)) {
|
|
73
|
+
// Read the file content and write it to the new path
|
|
74
|
+
const content = tree.read(oldPath);
|
|
75
|
+
if (content) {
|
|
76
|
+
tree.write(newPath, content);
|
|
77
|
+
tree.delete(oldPath);
|
|
78
|
+
console.log(`Renamed ${file} to .${pureName} in ${directory}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Also check subdirectories recursively
|
|
86
|
+
files.forEach((file) => {
|
|
87
|
+
const filePath = path.join(directory, file);
|
|
88
|
+
// Check if it's a directory
|
|
89
|
+
if (tree.exists(filePath) && !tree.isFile(filePath)) {
|
|
90
|
+
renameDotFiles(tree, filePath);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
} catch (error) {
|
|
94
|
+
console.error(`Error renaming dotfiles in ${directory}:`, error);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ignoreUpdate.cjs","sources":["../../../../src/generators/add-fullstack/updates/ignoreUpdate.ts"],"sourcesContent":[null],"names":["path"],"mappings":"6YAGgB,WAAW,CAAC,IAAU,EAAE,WAAmB,EAAE,KAAe,EAAA;AACxE,IAAA,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,IAAG;QACpB,MAAM,QAAQ,GAAGA,eAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AAC9C,QAAA,MAAM,MAAM,GAAQ,EAAE,IAAI,EAAE,CAAC;AAC7B,QAAA,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;AACvB,YAAA,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;SACnD;AACD,QAAA,OAAO,MAAM,CAAC;AAClB,KAAC,CAAC,CAAC;AACP,CAAC;SAEe,YAAY,CAAC,IAAU,EAAE,WAAmB,EAAE,KAAY,EAAA;AACtE,IAAA,KAAK,CAAC,OAAO,CAAC,CAAC,MAAW,KAAI;AAC1B,QAAA,MAAM,QAAQ,GAAGA,eAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AACrD,QAAA,IAAI,MAAM,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P"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use strict';var path=require('path');function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var path__namespace=/*#__PURE__*/_interopNamespaceDefault(path);function updateJenkinsFile(tree, projectRoot, name) {
|
|
2
|
-
const filePath = path__namespace.join(projectRoot, 'Jenkinsfile');
|
|
3
|
-
const paramsToUpdate = {
|
|
4
|
-
BASE_NAMESPACE: name,
|
|
5
|
-
CONNECTION_ID: name,
|
|
6
|
-
WORKSPACE_ID: name,
|
|
7
|
-
UNIQUE_NAME: name,
|
|
8
|
-
};
|
|
9
|
-
let jenkinsFileContent = '';
|
|
10
|
-
if (tree.exists(filePath)) {
|
|
11
|
-
jenkinsFileContent = tree.read(filePath).toString();
|
|
12
|
-
}
|
|
13
|
-
let labelExists = false;
|
|
14
|
-
const updatedContent = jenkinsFileContent.split('\n').map(line => {
|
|
15
|
-
// Check if the label is already defined and skip modifying it
|
|
16
|
-
if (line.includes('label') && line.includes('kubernetes')) {
|
|
17
|
-
labelExists = true;
|
|
18
|
-
}
|
|
19
|
-
// Update only the specified parameters
|
|
20
|
-
for (const param in paramsToUpdate) {
|
|
21
|
-
if (line.includes(`string(name: '${param}'`)) {
|
|
22
|
-
return line.replace(/defaultValue: '.*'/, `defaultValue: '${paramsToUpdate[param]}'`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return line;
|
|
26
|
-
}).join('\n');
|
|
27
|
-
// Add missing parameters if they don't exist
|
|
28
|
-
Object.keys(paramsToUpdate).forEach(param => {
|
|
29
|
-
if (!updatedContent.includes(`string(name: '${param}'`)) {
|
|
30
|
-
updatedContent.concat(`string(name: '${param}', defaultValue: '${paramsToUpdate[param]}', description: '${param.replace(/_/g, ' ').toLowerCase()}')\n`);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
// Only write back to the file if we have made changes
|
|
34
|
-
if (!labelExists || Object.keys(paramsToUpdate).some(param => !updatedContent.includes(`string(name: '${param}'`))) {
|
|
35
|
-
tree.write(filePath, updatedContent);
|
|
36
|
-
}
|
|
37
|
-
}exports.updateJenkinsFile=updateJenkinsFile;//# sourceMappingURL=jenkinsfileUpdate.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jenkinsfileUpdate.cjs","sources":["../../../../src/generators/add-fullstack/updates/jenkinsfileUpdate.ts"],"sourcesContent":[null],"names":["path"],"mappings":"6YAIgB,iBAAiB,CAAC,IAAU,EAAE,WAAmB,EAAE,IAAY,EAAA;IAC3E,MAAM,QAAQ,GAAGA,eAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AACvD,IAAA,MAAM,cAAc,GAAG;AACnB,QAAA,cAAc,EAAE,IAAI;AACpB,QAAA,aAAa,EAAE,IAAI;AACnB,QAAA,YAAY,EAAE,IAAI;AAClB,QAAA,WAAW,EAAE,IAAI;KACpB,CAAC;IAEF,IAAI,kBAAkB,GAAG,EAAE,CAAC;AAC5B,IAAA,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;QACvB,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;KACvD;IAED,IAAI,WAAW,GAAG,KAAK,CAAC;AAExB,IAAA,MAAM,cAAc,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,IAAG;;AAE7D,QAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;YACvD,WAAW,GAAG,IAAI,CAAC;SACtB;;AAGD,QAAA,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE;YAChC,IAAI,IAAI,CAAC,QAAQ,CAAC,iBAAiB,KAAK,CAAA,CAAA,CAAG,CAAC,EAAE;AAC1C,gBAAA,OAAO,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAkB,eAAA,EAAA,cAAc,CAAC,KAAK,CAAC,CAAA,CAAA,CAAG,CAAC,CAAC;aACzF;SACJ;AACD,QAAA,OAAO,IAAI,CAAC;AAChB,KAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;IAGd,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,KAAK,IAAG;QACxC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,iBAAiB,KAAK,CAAA,CAAA,CAAG,CAAC,EAAE;YACrD,cAAc,CAAC,MAAM,CACjB,CAAiB,cAAA,EAAA,KAAK,qBAAqB,cAAc,CAAC,KAAK,CAAC,CAAoB,iBAAA,EAAA,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAM,IAAA,CAAA,CACnI,CAAC;SACL;AACL,KAAC,CAAC,CAAC;;IAGH,IAAI,CAAC,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAiB,cAAA,EAAA,KAAK,CAAG,CAAA,CAAA,CAAC,CAAC,EAAE;AAChH,QAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;KACxC;AACL"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import*as path from'path';function updateJenkinsFile(tree, projectRoot, name) {
|
|
2
|
-
const filePath = path.join(projectRoot, 'Jenkinsfile');
|
|
3
|
-
const paramsToUpdate = {
|
|
4
|
-
BASE_NAMESPACE: name,
|
|
5
|
-
CONNECTION_ID: name,
|
|
6
|
-
WORKSPACE_ID: name,
|
|
7
|
-
UNIQUE_NAME: name,
|
|
8
|
-
};
|
|
9
|
-
let jenkinsFileContent = '';
|
|
10
|
-
if (tree.exists(filePath)) {
|
|
11
|
-
jenkinsFileContent = tree.read(filePath).toString();
|
|
12
|
-
}
|
|
13
|
-
let labelExists = false;
|
|
14
|
-
const updatedContent = jenkinsFileContent.split('\n').map(line => {
|
|
15
|
-
// Check if the label is already defined and skip modifying it
|
|
16
|
-
if (line.includes('label') && line.includes('kubernetes')) {
|
|
17
|
-
labelExists = true;
|
|
18
|
-
}
|
|
19
|
-
// Update only the specified parameters
|
|
20
|
-
for (const param in paramsToUpdate) {
|
|
21
|
-
if (line.includes(`string(name: '${param}'`)) {
|
|
22
|
-
return line.replace(/defaultValue: '.*'/, `defaultValue: '${paramsToUpdate[param]}'`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return line;
|
|
26
|
-
}).join('\n');
|
|
27
|
-
// Add missing parameters if they don't exist
|
|
28
|
-
Object.keys(paramsToUpdate).forEach(param => {
|
|
29
|
-
if (!updatedContent.includes(`string(name: '${param}'`)) {
|
|
30
|
-
updatedContent.concat(`string(name: '${param}', defaultValue: '${paramsToUpdate[param]}', description: '${param.replace(/_/g, ' ').toLowerCase()}')\n`);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
// Only write back to the file if we have made changes
|
|
34
|
-
if (!labelExists || Object.keys(paramsToUpdate).some(param => !updatedContent.includes(`string(name: '${param}'`))) {
|
|
35
|
-
tree.write(filePath, updatedContent);
|
|
36
|
-
}
|
|
37
|
-
}export{updateJenkinsFile};//# sourceMappingURL=jenkinsfileUpdate.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jenkinsfileUpdate.mjs","sources":["../../../../src/generators/add-fullstack/updates/jenkinsfileUpdate.ts"],"sourcesContent":[null],"names":[],"mappings":"mCAIgB,iBAAiB,CAAC,IAAU,EAAE,WAAmB,EAAE,IAAY,EAAA;IAC3E,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW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AAqB,cAAc,CAAC,KAAK,CAAC,CAAoB,iBAAA,EAAA,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAM,IAAA,CAAA,CACnI,CAAC;SACL;AACL,KAAC,CAAC,CAAC;;IAGH,IAAI,CAAC,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAiB,cAAA,EAAA,KAAK,CAAG,CAAA,CAAA,CAAC,CAAC,EAAE;AAChH,QAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;KACxC;AACL"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lernaJsonUpdate.cjs","sources":["../../../../src/generators/add-fullstack/updates/lernaJsonUpdate.ts"],"sourcesContent":[null],"names":["path","get","fs","updateJson","set"],"mappings":"ugBAKA,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,6BAA6B,EAAE,6BAA6B,EAAE,UAAU,CAAC,CAAC;AAErF,SAAA,eAAe,CAAC,IAAU,EAAE,WAAmB,EAAA;IAC3D,MAAM,aAAa,GAAGA,eAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAE3D,IAAA,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE;AAC5B,QAAA,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QAClE,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,IAAI,MAAM,GAAG,KAAK,CAAC;AACnB,QAAA,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;AACxB,YAAA,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACrB,gBAAA,MAAM,UAAU,GAAGC,UAAG,CAAC,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Ee,gBAAgB,CAAC,IAAU,EAAE,WAAmB,EAAE,MAAW,EAAA;IACzE,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IAC3D,IAAI,MAAM,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE;QACxC,UAAU,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC,SAAc,KAAI;YAC/C,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,IAAG;AAChC,gBAAA,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACrB,oBAAA,SAAS,GAAG,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;iBAC/D;qBAAM;oBACH,SAAS,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;iBACpC;AACL,aAAC,CAAC,CAAC;AACH,YAAA,OAAO,SAAS,CAAC;AACrB,SAAC,CAAC,CAAC;AACH,QAAA,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;KACpD;AACL"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npx lint-staged
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
language: node_js
|
|
2
|
-
node_js:
|
|
3
|
-
- "8.4"
|
|
4
|
-
install:
|
|
5
|
-
- npm config set spin=false
|
|
6
|
-
- yarn install -g npm@5.2
|
|
7
|
-
- yarn install -g coveralls
|
|
8
|
-
- yarn install
|
|
9
|
-
os:
|
|
10
|
-
- linux
|
|
11
|
-
- osx
|
|
12
|
-
branches:
|
|
13
|
-
only:
|
|
14
|
-
- publish
|
|
15
|
-
script:
|
|
16
|
-
- yarn test
|
|
17
|
-
# Allow Travis tests to run in containers.
|
|
18
|
-
sudo: false
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Tree } from '@nx/devkit';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import * as path from 'path';
|
|
4
|
-
|
|
5
|
-
export function updateJenkinsFile(tree: Tree, projectRoot: string, name: string) {
|
|
6
|
-
const filePath = path.join(projectRoot, 'Jenkinsfile');
|
|
7
|
-
const paramsToUpdate = {
|
|
8
|
-
BASE_NAMESPACE: name,
|
|
9
|
-
CONNECTION_ID: name,
|
|
10
|
-
WORKSPACE_ID: name,
|
|
11
|
-
UNIQUE_NAME: name,
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
let jenkinsFileContent = '';
|
|
15
|
-
if (tree.exists(filePath)) {
|
|
16
|
-
jenkinsFileContent = tree.read(filePath).toString();
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
let labelExists = false;
|
|
20
|
-
|
|
21
|
-
const updatedContent = jenkinsFileContent.split('\n').map(line => {
|
|
22
|
-
// Check if the label is already defined and skip modifying it
|
|
23
|
-
if (line.includes('label') && line.includes('kubernetes')) {
|
|
24
|
-
labelExists = true;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Update only the specified parameters
|
|
28
|
-
for (const param in paramsToUpdate) {
|
|
29
|
-
if (line.includes(`string(name: '${param}'`)) {
|
|
30
|
-
return line.replace(/defaultValue: '.*'/, `defaultValue: '${paramsToUpdate[param]}'`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return line;
|
|
34
|
-
}).join('\n');
|
|
35
|
-
|
|
36
|
-
// Add missing parameters if they don't exist
|
|
37
|
-
Object.keys(paramsToUpdate).forEach(param => {
|
|
38
|
-
if (!updatedContent.includes(`string(name: '${param}'`)) {
|
|
39
|
-
updatedContent.concat(
|
|
40
|
-
`string(name: '${param}', defaultValue: '${paramsToUpdate[param]}', description: '${param.replace(/_/g, ' ').toLowerCase()}')\n`
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
// Only write back to the file if we have made changes
|
|
46
|
-
if (!labelExists || Object.keys(paramsToUpdate).some(param => !updatedContent.includes(`string(name: '${param}'`))) {
|
|
47
|
-
tree.write(filePath, updatedContent);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{src/generators/add-fullstack/.nxignore → lib/generators/add-fullstack/files/_nxignore}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|