@eui/tools 5.0.0-rc.1 → 5.0.0-rc.13
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/.version.properties +1 -1
- package/CHANGELOG.md +690 -3
- package/bin/eui-scripts.js +6 -6
- package/bin/scripts/build-package-sub.js +20 -0
- package/bin/scripts/version.js +12 -0
- package/global.test.js +61 -45
- package/package.json +17 -21
- package/sandbox.js +158 -5
- package/scripts/csdr/audit/audit-utils.js +2 -2
- package/scripts/csdr/cli/app.js +43 -5
- package/scripts/csdr/cli/package.js +93 -9
- package/scripts/csdr/cli/skeletons/app-eui10/angular-config.json +20 -0
- package/scripts/csdr/cli/skeletons/app-eui10/dependencies-base.json +2 -0
- package/scripts/csdr/cli/skeletons/app-eui10/dependencies-composite.json +5 -0
- package/scripts/csdr/cli/skeletons/app-eui10/gitignore_TO_REPLACE +63 -0
- package/scripts/csdr/cli/skeletons/app-eui10/mock/app/models/user.js +8 -0
- package/scripts/csdr/cli/skeletons/app-eui10/mock/app/routes/index.js +5 -0
- package/scripts/csdr/cli/skeletons/app-eui10/mock/app/routes/user_routes.js +24 -0
- package/scripts/csdr/cli/skeletons/app-eui10/mock/db/db.json +12 -0
- package/scripts/csdr/cli/skeletons/app-eui10/mock/server.js +16 -0
- package/scripts/csdr/cli/skeletons/app-eui10/package.json +6 -0
- package/scripts/csdr/cli/skeletons/app-eui10/scripts.json +5 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/app-routing.module.ts +18 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/app-starter.service.ts +68 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/app.component.html +29 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/app.component.ts +55 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/app.module.ts +27 -0
- package/scripts/{utils/pre-build/translations/common.js → csdr/cli/skeletons/app-eui10/src/app/core/components/.gitkeep} +0 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/core/core.module.ts +84 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/core/reducers/index.ts +33 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home-routing.module.ts +15 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home.component.html +7 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home.component.ts +19 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home.module.ts +18 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page1/page1.component.html +7 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page1/page1.component.ts +7 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page2/page2.component.html +7 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page2/page2.component.ts +7 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1-routing.module.ts +18 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1.component.html +7 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1.component.ts +8 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1.module.ts +21 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2-routing.module.ts +16 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2.component.html +8 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2.component.ts +7 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2.module.ts +17 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/shared/shared.module.ts +21 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/app/shared/testing/router.mock.ts +18 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/assets/config/env-json-config.json +8 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/assets/i18n/en.json +7 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/assets/i18n/fr.json +7 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/config/global.ts +20 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/config/index.ts +8 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/config/modules.ts +4 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/environments/environment.prod.ts +9 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/environments/environment.ts +9 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/index.html +21 -0
- package/scripts/csdr/cli/skeletons/app-eui10/src/styles.scss +1 -0
- package/scripts/csdr/cli/skeletons/app-eui10/tslint.json +17 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/angular-config.json +33 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/dependencies-composite.json +5 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/gitignore_TO_REPLACE +50 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/package.json +6 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/scripts.json +3 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app-routing.module.ts +21 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.component.html +26 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.component.ts +19 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.routes.ts +7 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home-routing.module.ts +15 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.component.html +7 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.component.ts +8 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.module.ts +17 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/shared/shared.module.ts +15 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/assets/app-metadata.json +8 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/assets/config/env-json-config.json +41 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/index.html +22 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/assets/i18n/en.json +3 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/assets/i18n/fr.json +3 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/gitignore_TO_REPLACE +46 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/karma.conf.js +7 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/ng-package.json +7 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/package.json +4 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/dummy.spec.ts.TO_REPLACE +5 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/index.ts +1 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/lib/module.ts +11 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/test.ts.TO_REPLACE +21 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/tsconfig.lib.json +32 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/tsconfig.spec.json +17 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/tslint.json +17 -0
- package/scripts/csdr/cli/skeletons/package/frontend-option-route/src/lib/components/cmp1/cmp1.component.html +1 -0
- package/scripts/csdr/cli/skeletons/package/frontend-option-route/src/lib/components/cmp1/cmp1.component.spec.ts.TO_REPLACE +25 -0
- package/scripts/csdr/cli/skeletons/package/frontend-option-route/src/lib/components/cmp1/cmp1.component.ts +14 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/angular.json +3 -3
- package/scripts/csdr/cli/skeletons/package/frontend-remote/dependencies-composite.json +1 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/dummy.scss +3 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/dummy.spec.ts +6 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/module.component.ts +62 -28
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/module.ts +44 -39
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/routing.module.ts +23 -9
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/i18n-compiled/en.json +1 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/i18n-compiled/fr.json +1 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/config/global.ts +6 -5
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/index.html +1 -1
- package/scripts/csdr/cli/skeletons/package/frontend-remote/tsconfig.app.json +3 -1
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/angular.json +90 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/browserslist +10 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/dependencies-base.json +2 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/dependencies-composite.json +6 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/gitignore_TO_REPLACE +64 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/karma.conf.js +7 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/package.json_TO_REPLACE +8 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/dummy.scss +3 -0
- package/scripts/csdr/cli/skeletons/package/{frontend-remote/src/app/dummy.spec.ts.TO_REPLACE → frontend-remote-eui10/src/app/dummy.spec.ts} +0 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/fallback.component.ts +11 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/module.component.ts +90 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/module.ts +219 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/reducers/custom-route-serializer.ts +28 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/reducers/index.ts +42 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/routing.module.ts +55 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/assets/.gitkeep +0 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/global.ts +31 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/index.ts +20 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/modules.ts +3 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/environments/environment.prod.ts +3 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/environments/environment.ts +15 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/favicon.ico +0 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/index.html +10 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/main.ts +12 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/polyfills.ts +86 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/test.ts.TO_REPLACE +20 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tsconfig.app.json +20 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tsconfig.spec.json +18 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tslint-remote.json +7 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tslint.json +17 -0
- package/scripts/csdr/cli/skeletons/package/{frontend-remote → frontend-remote-eui10}/webpack.extra.js +0 -0
- package/scripts/csdr/config/angular.js +734 -47
- package/scripts/csdr/config/global.js +43 -6
- package/scripts/csdr/config/packages.js +64 -1
- package/scripts/csdr/config/projects.js +24 -6
- package/scripts/csdr/config/projects.test.js +11 -9
- package/scripts/csdr/config/sync.js +6 -3
- package/scripts/csdr/init/init-utils.js +72 -0
- package/scripts/csdr/init/init.js +6 -0
- package/scripts/csdr/init/prompt.js +3 -1
- package/scripts/csdr/init/resources/10.x/yarn.lock +16428 -0
- package/scripts/csdr/init/resources/13.x/browserslistrc +6 -0
- package/scripts/csdr/init/resources/13.x/resolutions.json +6 -0
- package/scripts/csdr/init/resources/14.x/browserslistrc +6 -0
- package/scripts/csdr/init/resources/14.x/resolutions.json +5 -0
- package/scripts/csdr/install/build-app.js +6 -38
- package/scripts/csdr/install/build-package.js +16 -157
- package/scripts/csdr/install/common.js +21 -13
- package/scripts/csdr/install/composite-core.js +256 -0
- package/scripts/csdr/install/install-utils.js +8 -4
- package/scripts/csdr/install/local-dev.js +5 -3
- package/scripts/csdr/install/packages.js +90 -0
- package/scripts/csdr/install/projects.js +76 -0
- package/scripts/csdr/install/{remote.js → remotes.js} +46 -51
- package/scripts/csdr/metadata/app-envs.js +1 -39
- package/scripts/csdr/metadata/app-history.js +1 -66
- package/scripts/csdr/metadata/app-versions.js +2 -12
- package/scripts/csdr/metadata/app.js +49 -9
- package/scripts/csdr/metadata/common.js +21 -45
- package/scripts/csdr/metadata/metadata-utils.js +2 -0
- package/scripts/csdr/metadata/package-envs.js +71 -0
- package/scripts/csdr/metadata/package-history.js +5 -1
- package/scripts/csdr/metadata/package-versions.js +79 -0
- package/scripts/csdr/metadata/package.js +169 -101
- package/scripts/csdr/metadata/stats.js +9 -5
- package/scripts/csdr/release/app/release-app.js +16 -21
- package/scripts/csdr/release/package/backend.js +26 -0
- package/scripts/csdr/release/package/common.js +160 -13
- package/scripts/csdr/release/package/release-package.js +40 -6
- package/scripts/csdr/release/package/remote.js +2 -17
- package/scripts/csdr/release/package/ui.js +86 -3
- package/scripts/csdr/sync/sync-utils.js +9 -2
- package/scripts/csdr/version/app-common.js +32 -0
- package/scripts/csdr/version/app-env-target.js +5 -295
- package/scripts/csdr/version/app.js +5 -3
- package/scripts/csdr/version/{app-env-target.test.js → common..test.js} +32 -31
- package/scripts/csdr/version/common.js +277 -0
- package/scripts/csdr/version/package-common.js +158 -0
- package/scripts/csdr/version/package-default.js +144 -0
- package/scripts/csdr/version/package-remote.js +51 -0
- package/scripts/csdr/version/package.js +16 -270
- package/scripts/utils/api-utils.js +90 -0
- package/scripts/utils/build/app/build-app-utils.js +11 -9
- package/scripts/utils/build/package/angular.js +4 -30
- package/scripts/utils/build/package/build-package-utils.js +50 -1
- package/scripts/utils/build/package/element.js +15 -16
- package/scripts/utils/build/package/nodeJs.js +2 -1
- package/scripts/utils/build/package/skeletons/elements/index.html +9 -0
- package/scripts/utils/build/package/styles.js +83 -86
- package/scripts/utils/git-utils.js +69 -6
- package/scripts/utils/index.js +0 -2
- package/scripts/utils/notification/common.js +5 -0
- package/scripts/utils/notification/mail-utils.js +3 -0
- package/scripts/utils/notification/mailstack.js +3 -5
- package/scripts/utils/notification/package.js +0 -2
- package/scripts/utils/notification/slack-utils.js +6 -7
- package/scripts/utils/pre-build/elements.js +8 -4
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton/src/_generated/favicon.ico +0 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/app.module.ts +52 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/core/reducers/index.ts +40 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/global.ts +4 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/index.ts +8 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/modules.ts +4 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.dev.ts +9 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.prod.ts +9 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.ts +21 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/favicon.ico +0 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/karma.conf.js +7 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/main.ts +21 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/polyfills.ts +86 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/tst.ts +33 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.app.json +19 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.spec.json +9 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tslint.json +17 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/app/app.module.ts +52 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/app/core/reducers/index.ts +40 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/config/global.ts +4 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/config/index.ts +8 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/config/modules.ts +4 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/environments/environment.dev.ts +9 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/environments/environment.prod.ts +9 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/environments/environment.ts +21 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/favicon.ico +0 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/karma.conf.js +7 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/main.ts +21 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/polyfills.ts +86 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/tst.ts +33 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/tsconfig.app.json +19 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/tsconfig.spec.json +9 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/tslint.json +17 -0
- package/scripts/utils/pre-build/injection/config.js +30 -31
- package/scripts/utils/pre-build/injection/externals.js +70 -72
- package/scripts/utils/pre-build/injection/injection-utils.js +2 -0
- package/scripts/utils/pre-build/injection/routes-replacement.js +318 -0
- package/scripts/utils/pre-build/injection/skeletons.js +9 -3
- package/scripts/utils/pre-build/projects.js +28 -15
- package/scripts/utils/pre-build/translations/elements.js +21 -11
- package/scripts/utils/serve/app.js +7 -4
- package/scripts/utils/test/test-utils.js +39 -1
- package/scripts/utils/tools.js +370 -285
- package/bin/scripts/csdr-jira-update.js +0 -12
- package/bin/scripts/csdr-migrate-package.js +0 -17
- package/bin/scripts/e2e-app.js +0 -62
- package/scripts/csdr/install/composite-utils.js +0 -292
- package/scripts/csdr/jira/jira-utils.js +0 -169
- package/scripts/csdr/jira/update.js +0 -153
- package/scripts/migration/eui8-migration.js +0 -94
- package/scripts/migration/migrate-utils.js +0 -191
- package/scripts/utils/confluence-utils.js +0 -126
|
@@ -10,89 +10,11 @@ const tools = require('../../tools');
|
|
|
10
10
|
const notificationUtils = require('../../notification/notification-utils');
|
|
11
11
|
|
|
12
12
|
// FETCH ARGS
|
|
13
|
-
let {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const compileSassFileDartSass = (folder, filename) => {
|
|
17
|
-
const filePath = path.join(folder, 'styles', filename);
|
|
18
|
-
|
|
19
|
-
tools.logInfo(`Compiling ${filePath}.scss...`);
|
|
20
|
-
|
|
21
|
-
return Promise.resolve()
|
|
22
|
-
.then(() => {
|
|
23
|
-
tools.logInfo('Compiling SCSS...');
|
|
24
|
-
|
|
25
|
-
const sass = require('sass');
|
|
26
|
-
|
|
27
|
-
return sass.renderSync({
|
|
28
|
-
file: filePath + '.scss',
|
|
29
|
-
outFile: filePath + '.temp.css',
|
|
30
|
-
sourceMap: true,
|
|
31
|
-
sourceMapContents: true,
|
|
32
|
-
sourceMapEmbed: true,
|
|
33
|
-
includePaths: [
|
|
34
|
-
path.resolve(process.cwd(), 'node_modules'),
|
|
35
|
-
],
|
|
36
|
-
});
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
.then((sassResult) => {
|
|
40
|
-
const finalDest = filePath + '.css';
|
|
41
|
-
|
|
42
|
-
const cssnano = require('cssnano');
|
|
43
|
-
const autoprefixer = require('autoprefixer');
|
|
44
|
-
const postcss = require('postcss');
|
|
45
|
-
|
|
46
|
-
const plugins = [];
|
|
47
|
-
|
|
48
|
-
plugins.push(autoprefixer({
|
|
49
|
-
grid: 'no-autoplace',
|
|
50
|
-
browsers: [
|
|
51
|
-
"> 0.5% in alt-eu",
|
|
52
|
-
"last 2 version",
|
|
53
|
-
"ie 11",
|
|
54
|
-
"not dead",
|
|
55
|
-
"not op_mini all"
|
|
56
|
-
]
|
|
57
|
-
}));
|
|
58
|
-
plugins.push(cssnano({ safe: true }));
|
|
59
|
-
|
|
60
|
-
return postcss(plugins)
|
|
61
|
-
.process(sassResult.css, {
|
|
62
|
-
map: { inline: false, prev: sassResult.map.toString() },
|
|
63
|
-
from: filePath + '.scss',
|
|
64
|
-
to: finalDest,
|
|
65
|
-
})
|
|
66
|
-
.then((postcssResult) => {
|
|
67
|
-
// fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
68
|
-
fs.writeFileSync(finalDest, postcssResult.css);
|
|
69
|
-
|
|
70
|
-
if (postcssResult.map) {
|
|
71
|
-
fs.writeFileSync(`${finalDest}.map`, postcssResult.map);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
.then((output) => {
|
|
77
|
-
// console.log(output);
|
|
78
|
-
console.log('Size ::: ' + fs.statSync(filePath + '.css').size);
|
|
79
|
-
|
|
80
|
-
tools.logSuccess(`OK ==> generated ${filePath}.css`);
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
.then(() => {
|
|
84
|
-
tools.remove(filePath + '.temp.css');
|
|
85
|
-
tools.remove(filePath + '.temp.css.map');
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
.catch((e) => {
|
|
89
|
-
console.log(e);
|
|
90
|
-
throw e;
|
|
91
|
-
})
|
|
92
|
-
}
|
|
13
|
+
let { skipCompile } = tools.getArgs();
|
|
93
14
|
|
|
94
15
|
|
|
95
16
|
const compileSassFileNodeSass = (folder, filename, isNodeSassTildeImporterActive) => {
|
|
17
|
+
|
|
96
18
|
const filePath = path.join(folder, 'styles', filename);
|
|
97
19
|
|
|
98
20
|
tools.logInfo(`Compiling ${filePath}.scss...`);
|
|
@@ -170,12 +92,85 @@ const compileSassFileNodeSass = (folder, filename, isNodeSassTildeImporterActive
|
|
|
170
92
|
}
|
|
171
93
|
|
|
172
94
|
|
|
95
|
+
|
|
96
|
+
const compileSassFileDartSass = (folder, filename) => {
|
|
97
|
+
const filePath = path.join(folder, 'styles', filename);
|
|
98
|
+
|
|
99
|
+
tools.logInfo(`Compiling ${filePath}.scss...`);
|
|
100
|
+
|
|
101
|
+
return Promise.resolve()
|
|
102
|
+
.then(() => {
|
|
103
|
+
tools.logInfo('Compiling SCSS...');
|
|
104
|
+
|
|
105
|
+
const sass = require('sass');
|
|
106
|
+
|
|
107
|
+
return sass.renderSync({
|
|
108
|
+
file: filePath + '.scss',
|
|
109
|
+
outFile: filePath + '.temp.css',
|
|
110
|
+
sourceMap: true,
|
|
111
|
+
sourceMapContents: true,
|
|
112
|
+
sourceMapEmbed: true,
|
|
113
|
+
includePaths: [
|
|
114
|
+
path.resolve(process.cwd(), 'node_modules'),
|
|
115
|
+
],
|
|
116
|
+
});
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
.then((sassResult) => {
|
|
120
|
+
const finalDest = filePath + '.css';
|
|
121
|
+
|
|
122
|
+
const cssnano = require('cssnano');
|
|
123
|
+
const autoprefixer = require('autoprefixer');
|
|
124
|
+
const postcss = require('postcss');
|
|
125
|
+
|
|
126
|
+
const plugins = [];
|
|
127
|
+
|
|
128
|
+
plugins.push(autoprefixer({
|
|
129
|
+
grid: 'no-autoplace',
|
|
130
|
+
}));
|
|
131
|
+
plugins.push(cssnano({ safe: true }));
|
|
132
|
+
|
|
133
|
+
return postcss(plugins)
|
|
134
|
+
.process(sassResult.css, {
|
|
135
|
+
map: { inline: false, prev: sassResult.map.toString() },
|
|
136
|
+
from: filePath + '.scss',
|
|
137
|
+
to: finalDest,
|
|
138
|
+
})
|
|
139
|
+
.then((postcssResult) => {
|
|
140
|
+
// fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
141
|
+
fs.writeFileSync(finalDest, postcssResult.css);
|
|
142
|
+
|
|
143
|
+
if (postcssResult.map) {
|
|
144
|
+
fs.writeFileSync(`${finalDest}.map`, postcssResult.map.toString());
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
.then((output) => {
|
|
150
|
+
// console.log(output);
|
|
151
|
+
console.log('Size ::: ' + fs.statSync(filePath + '.css').size);
|
|
152
|
+
|
|
153
|
+
tools.logSuccess(`OK ==> generated ${filePath}.css`);
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
.then(() => {
|
|
157
|
+
tools.remove(filePath + '.temp.css');
|
|
158
|
+
tools.remove(filePath + '.temp.css.map');
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
.catch((e) => {
|
|
162
|
+
console.log(e);
|
|
163
|
+
throw e;
|
|
164
|
+
})
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
173
169
|
const compileSassFile = (pkg, folder, filename, isNodeSassTildeImporterActive) => {
|
|
174
170
|
return Promise.resolve()
|
|
175
171
|
.then(() => {
|
|
176
|
-
if (pkg.build && pkg.build.
|
|
172
|
+
if (pkg.build && (pkg.build.euiVersion === '13.x' || pkg.build.euiVersion === '14.x')) {
|
|
177
173
|
return compileSassFileDartSass(folder, filename);
|
|
178
|
-
|
|
179
174
|
} else {
|
|
180
175
|
return compileSassFileNodeSass(folder, filename, isNodeSassTildeImporterActive);
|
|
181
176
|
}
|
|
@@ -219,6 +214,9 @@ module.exports.build = (pkg) => {
|
|
|
219
214
|
console.log('Sources copy succeeded.')
|
|
220
215
|
})
|
|
221
216
|
.then(() => Promise.resolve().then(() => {
|
|
217
|
+
tools.logInfo('Processing stylesheets entries : ');
|
|
218
|
+
console.log(pkg.stylesheets);
|
|
219
|
+
|
|
222
220
|
return pkg.stylesheets.reduce((promise, file) => {
|
|
223
221
|
return promise.then(() => (
|
|
224
222
|
compileSassFile(pkg, tmpFolder, file, pkg.build && pkg.build.isNodeSassTildeImporterActive)
|
|
@@ -246,6 +244,9 @@ module.exports.build = (pkg) => {
|
|
|
246
244
|
tools.copy(path.join(pkg.paths.pkgRootDirectory, 'README.md'), path.join(pkg.paths.pkgBuild, 'README.md'));
|
|
247
245
|
tools.copy(path.join(pkg.paths.pkgRootDirectory, 'LICENSE'), path.join(pkg.paths.pkgBuild, 'LICENSE'));
|
|
248
246
|
})
|
|
247
|
+
.then(() => {
|
|
248
|
+
return tools.rimraf(tmpFolder);
|
|
249
|
+
})
|
|
249
250
|
.then(() => {
|
|
250
251
|
return notificationUtils.package.sendPackageMessage({
|
|
251
252
|
package: pkg
|
|
@@ -258,7 +259,3 @@ module.exports.build = (pkg) => {
|
|
|
258
259
|
}
|
|
259
260
|
}
|
|
260
261
|
|
|
261
|
-
// EXPORTS
|
|
262
|
-
module.exports.compileSassFile = compileSassFile;
|
|
263
|
-
|
|
264
|
-
|
|
@@ -7,10 +7,11 @@ const semver = require('semver');
|
|
|
7
7
|
// LOCAL
|
|
8
8
|
const tools = require('./tools');
|
|
9
9
|
const configUtils = require('../csdr/config/config-utils');
|
|
10
|
+
const { getPackageConfig } = require('./notification/config');
|
|
10
11
|
// const versionUtils = require('./version-utils');
|
|
11
12
|
|
|
12
13
|
// FETCH ARGS
|
|
13
|
-
const { dryRun, git } = tools.getArgs();
|
|
14
|
+
const { dryRun, git, debug } = tools.getArgs();
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
const getLastTag = (folder) => {
|
|
@@ -104,6 +105,9 @@ const commitAndPush = (branch, message, folder) => {
|
|
|
104
105
|
} catch (e2) {
|
|
105
106
|
tools.logError('ERROR');
|
|
106
107
|
console.log('ERROR!!!');
|
|
108
|
+
if (debug) {
|
|
109
|
+
console.log(e2);
|
|
110
|
+
}
|
|
107
111
|
|
|
108
112
|
try {
|
|
109
113
|
tools.logInfo('Commit and push - second try - retrying pull push');
|
|
@@ -111,6 +115,9 @@ const commitAndPush = (branch, message, folder) => {
|
|
|
111
115
|
execa.sync('git', ['push', 'origin', branch], { cwd: folder });
|
|
112
116
|
|
|
113
117
|
} catch (e3) {
|
|
118
|
+
if (debug) {
|
|
119
|
+
console.log(e3);
|
|
120
|
+
}
|
|
114
121
|
throw new Error(`Failed to push ${message} to ${folder}`);
|
|
115
122
|
}
|
|
116
123
|
}
|
|
@@ -139,6 +146,11 @@ const tagVersion = (version, branch, message, folder) => {
|
|
|
139
146
|
})
|
|
140
147
|
.catch((e) => {
|
|
141
148
|
return Promise.resolve()
|
|
149
|
+
// .then(() => {
|
|
150
|
+
// return new Promise((resolve) => {
|
|
151
|
+
// setTimeout(resolve, 8000);
|
|
152
|
+
// });
|
|
153
|
+
// })
|
|
142
154
|
.then(() => {
|
|
143
155
|
execa.sync('git', ['tag', '-a', `v${version}b`, '-m', message], { cwd: folder });
|
|
144
156
|
execa.sync('git', ['push', '--follow-tags', 'origin', branch], { cwd: folder });
|
|
@@ -218,19 +230,67 @@ const mergeMasterToDevelop = (pkg, folder, version) => {
|
|
|
218
230
|
})
|
|
219
231
|
}
|
|
220
232
|
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
const mergeSupportToSupportDevelop = (pkg, folder, supportBranch, supportSnapshotBranch) => {
|
|
237
|
+
if (!supportSnapshotBranch) {
|
|
238
|
+
tools.logWarning('supportSnapshotBranch not found in package config...skipping');
|
|
239
|
+
return Promise.resolve();
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
tools.logTitle(`Merge back on ${supportSnapshotBranch}`);
|
|
243
|
+
tools.logInfo(`Merging release changes into ${supportSnapshotBranch} branch...`);
|
|
244
|
+
|
|
245
|
+
if (dryRun) {
|
|
246
|
+
tools.logInfo('DRY-RUN: skipping merge support to supportDevelop');
|
|
247
|
+
return Promise.resolve();
|
|
248
|
+
|
|
249
|
+
} else {
|
|
250
|
+
|
|
251
|
+
if (pkg && pkg.build && pkg.build.masterBranchOnly) {
|
|
252
|
+
tools.logInfo('Merge skipped project config set to master branch only');
|
|
253
|
+
return Promise.resolve();
|
|
221
254
|
|
|
255
|
+
} else {
|
|
256
|
+
return Promise.resolve()
|
|
257
|
+
.then(() => {
|
|
258
|
+
execa.shellSync(`git fetch origin`, { cwd: folder });
|
|
259
|
+
execa.shellSync(`git checkout ${supportSnapshotBranch}`, { cwd: folder });
|
|
260
|
+
execa.shellSync(`git merge origin/${supportSnapshotBranch}`, { cwd: folder });
|
|
261
|
+
execa.shellSync(`git merge -X theirs ${supportBranch}`, { cwd: folder });
|
|
262
|
+
execa.shellSync(`git push origin ${supportSnapshotBranch}`, { cwd: folder });
|
|
263
|
+
execa.shellSync(`git checkout ${supportBranch}`, { cwd: folder });
|
|
264
|
+
})
|
|
265
|
+
.then(() => {
|
|
266
|
+
tools.logSuccess();
|
|
267
|
+
})
|
|
268
|
+
.catch((e) => {
|
|
269
|
+
throw new Error(`Error trying merging ${supportBranch} to ${supportSnapshotBranch} on ${folder}`);
|
|
270
|
+
})
|
|
271
|
+
}
|
|
272
|
+
}
|
|
222
273
|
}
|
|
223
274
|
|
|
224
275
|
|
|
225
|
-
|
|
276
|
+
|
|
277
|
+
const getGitHost = (externalRepo) => {
|
|
226
278
|
const config = configUtils.global.getConfig();
|
|
227
279
|
|
|
228
280
|
if (config.git) {
|
|
229
281
|
if (git && git === 'local') {
|
|
230
|
-
|
|
282
|
+
if (externalRepo) {
|
|
283
|
+
return config.git.externals.local;
|
|
284
|
+
} else {
|
|
285
|
+
return config.git.local;
|
|
286
|
+
}
|
|
231
287
|
|
|
232
288
|
} else {
|
|
233
|
-
|
|
289
|
+
if (externalRepo) {
|
|
290
|
+
return config.git.externals.remote;
|
|
291
|
+
} else {
|
|
292
|
+
return config.git.remote;
|
|
293
|
+
}
|
|
234
294
|
}
|
|
235
295
|
}
|
|
236
296
|
|
|
@@ -238,7 +298,7 @@ const getGitHost = () => {
|
|
|
238
298
|
}
|
|
239
299
|
|
|
240
300
|
|
|
241
|
-
const cloneRepo = (repoUri, folder, forced = false, noHistory = false) => {
|
|
301
|
+
const cloneRepo = (repoUri, folder, forced = false, noHistory = false, externalRepo = false) => {
|
|
242
302
|
return Promise.resolve()
|
|
243
303
|
.then(() => {
|
|
244
304
|
if (tools.isDirExists(folder) && forced) {
|
|
@@ -246,12 +306,13 @@ const cloneRepo = (repoUri, folder, forced = false, noHistory = false) => {
|
|
|
246
306
|
return tools.rimraf(folder);
|
|
247
307
|
}
|
|
248
308
|
})
|
|
309
|
+
|
|
249
310
|
.then(() => {
|
|
250
311
|
if (!tools.isDirExists(folder)) {
|
|
251
312
|
tools.logInfo(`Cloning ${repoUri} in folder "${folder}" ...`);
|
|
252
313
|
|
|
253
314
|
const auth = process.env.gituser && process.env.gitpassword ? `${process.env.gituser}:${process.env.gitpassword}@` : '';
|
|
254
|
-
const gitHost = getGitHost();
|
|
315
|
+
const gitHost = getGitHost(externalRepo);
|
|
255
316
|
|
|
256
317
|
if (noHistory) {
|
|
257
318
|
execa.shellSync(`git clone --depth 1 https://${auth}${gitHost}${repoUri} ${folder}`);
|
|
@@ -261,6 +322,7 @@ const cloneRepo = (repoUri, folder, forced = false, noHistory = false) => {
|
|
|
261
322
|
tools.logSuccess();
|
|
262
323
|
}
|
|
263
324
|
})
|
|
325
|
+
|
|
264
326
|
.then(() => {
|
|
265
327
|
tools.logInfo(`Pulling ${repoUri} in folder "${folder}" ...`);
|
|
266
328
|
execa.shellSync(`git pull`, { cwd: folder, stdio: 'inherit' });
|
|
@@ -321,6 +383,7 @@ module.exports.hasCommitsSinceLastTag = hasCommitsSinceLastTag;
|
|
|
321
383
|
module.exports.commitAndPush = commitAndPush;
|
|
322
384
|
module.exports.tagVersion = tagVersion;
|
|
323
385
|
module.exports.mergeMasterToDevelop = mergeMasterToDevelop;
|
|
386
|
+
module.exports.mergeSupportToSupportDevelop = mergeSupportToSupportDevelop;
|
|
324
387
|
module.exports.cloneRepo = cloneRepo;
|
|
325
388
|
module.exports.checkout = checkout;
|
|
326
389
|
module.exports.getLastCommitAuthor = getLastCommitAuthor;
|
package/scripts/utils/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const changelogUtils = require('./changelog-utils');
|
|
4
|
-
const confluenceUtils = require('./confluence-utils');
|
|
5
4
|
const gitUtils = require('./git-utils');
|
|
6
5
|
const mavenUtils = require('./maven-utils');
|
|
7
6
|
const pipelineUtils = require('./pipeline-utils');
|
|
@@ -19,7 +18,6 @@ const sonarUtils = require('./sonar/sonar-utils');
|
|
|
19
18
|
|
|
20
19
|
module.exports = {
|
|
21
20
|
changelog: changelogUtils,
|
|
22
|
-
confluence: confluenceUtils,
|
|
23
21
|
git: gitUtils,
|
|
24
22
|
maven: mavenUtils,
|
|
25
23
|
pipeline: pipelineUtils,
|
|
@@ -64,6 +64,11 @@ module.exports.getMessage = (options) => {
|
|
|
64
64
|
message.detailText = 'Another build has been detected for the current package being build\n Retry again this build after 30m, lock will be auto-cleared';
|
|
65
65
|
break;
|
|
66
66
|
|
|
67
|
+
case 'MULTIPLE_LOCAL_EUI_VERSIONS_FOUND':
|
|
68
|
+
message.detailTitle = 'MULTIPLE eUI VERSIONS FOUND IN LOCAL PROJECT - ABORTING!';
|
|
69
|
+
message.detailText = 'Uncompatible version of eUI found installed in the local CSDR project, please adjust and keep same compatible versions of eUI packages and projects';
|
|
70
|
+
break;
|
|
71
|
+
|
|
67
72
|
default:
|
|
68
73
|
message.detailTitle = 'GENERAL ERROR!';
|
|
69
74
|
message.detailText = options.exception;
|
|
@@ -10,6 +10,9 @@ let { dryRun, debug} = tools.getArgs();
|
|
|
10
10
|
|
|
11
11
|
const sendCore = (subject, body, recipient) => {
|
|
12
12
|
tools.logInfo(`Sending mail to : ${recipient}`);
|
|
13
|
+
tools.logInfo('Message subject / body :');
|
|
14
|
+
console.log(subject);
|
|
15
|
+
console.log(body);
|
|
13
16
|
|
|
14
17
|
if (dryRun) {
|
|
15
18
|
console.log('----------------------------------------------');
|
|
@@ -33,9 +33,6 @@ module.exports.endMailStack = () => {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
module.exports.bufferMessage = (message) => {
|
|
36
|
-
tools.logInfo('Buffering mail content');
|
|
37
|
-
console.log(message);
|
|
38
|
-
|
|
39
36
|
if (message.text) {
|
|
40
37
|
mailContent.buffer.push(message.text);
|
|
41
38
|
|
|
@@ -73,8 +70,9 @@ const sendMailStack = (config, scope, target) => {
|
|
|
73
70
|
status = 'ERROR';
|
|
74
71
|
}
|
|
75
72
|
|
|
76
|
-
const subject = `RELEASE <b style="color: ${statusColor};">${status}</b> - <b style="color:blue;">${scope}</b> - branch: <b styles="color: blue;">${target}</b>`;
|
|
77
|
-
|
|
73
|
+
// const subject = `RELEASE <b style="color: ${statusColor};">${status}</b> - <b style="color:blue;">${scope}</b> - branch: <b styles="color: blue;">${target}</b>`;
|
|
74
|
+
const subject = `Release of **${scope}** for ${target} ---- status : ${status}`;
|
|
75
|
+
let fullMessage = `<pre>${mailContent.buffer.join('\n')}</pre>`;
|
|
78
76
|
|
|
79
77
|
if (mailContent.exception) {
|
|
80
78
|
fullMessage += mailContent.exception;
|
|
@@ -24,10 +24,6 @@ const agent = PROXY ? new HttpsProxyAgent(PROXY) : void 0;
|
|
|
24
24
|
|
|
25
25
|
const sendMessageCore = (hook, channel, attachments, text = null) => {
|
|
26
26
|
return new Promise((resolve, reject) => {
|
|
27
|
-
tools.logInfo(`Sending message to Slack...`);
|
|
28
|
-
tools.logInfo(`Slack hook: ${hook}`);
|
|
29
|
-
tools.logInfo(`Slack channel: ${channel}`);
|
|
30
|
-
|
|
31
27
|
const payload = {
|
|
32
28
|
username: "eUI bot",
|
|
33
29
|
channel
|
|
@@ -51,6 +47,8 @@ const sendMessageCore = (hook, channel, attachments, text = null) => {
|
|
|
51
47
|
};
|
|
52
48
|
|
|
53
49
|
if (dryRun || !slackFeedback) {
|
|
50
|
+
tools.logInfo('No notifications config found...skipping');
|
|
51
|
+
|
|
54
52
|
if (debug) {
|
|
55
53
|
console.log(JSON.stringify(payload, null, 4));
|
|
56
54
|
}
|
|
@@ -58,6 +56,10 @@ const sendMessageCore = (hook, channel, attachments, text = null) => {
|
|
|
58
56
|
resolve();
|
|
59
57
|
|
|
60
58
|
} else {
|
|
59
|
+
tools.logInfo(`Sending message to Slack...`);
|
|
60
|
+
tools.logInfo(`Slack hook: ${hook}`);
|
|
61
|
+
tools.logInfo(`Slack channel: ${channel}`);
|
|
62
|
+
|
|
61
63
|
if (debug) {
|
|
62
64
|
console.log(JSON.stringify(payload, null, 4));
|
|
63
65
|
}
|
|
@@ -94,9 +96,6 @@ const sendMessage = (hook, channel, attachments, text = null) => {
|
|
|
94
96
|
.then(() => {
|
|
95
97
|
return sendMessageCore(hook, channel, attachments, text);
|
|
96
98
|
})
|
|
97
|
-
.then(() => {
|
|
98
|
-
tools.logSuccess();
|
|
99
|
-
})
|
|
100
99
|
.catch((e) => {
|
|
101
100
|
tools.logError('Error sending slack message');
|
|
102
101
|
console.log(e); // do not rethrow
|
|
@@ -6,12 +6,10 @@ const tools = require('../tools');
|
|
|
6
6
|
|
|
7
7
|
const translationUtils = require('./translations/translation-utils');
|
|
8
8
|
const configUtils = require('../../csdr/config/config-utils');
|
|
9
|
-
|
|
9
|
+
const injectionUtils = require('./injection/injection-utils');
|
|
10
10
|
|
|
11
11
|
module.exports.preBuild = (pkg, build = false) => {
|
|
12
|
-
|
|
13
12
|
return Promise.resolve()
|
|
14
|
-
|
|
15
13
|
.then(() => {
|
|
16
14
|
tools.logTitle('PRE-BUILD : preparing the element...')
|
|
17
15
|
})
|
|
@@ -21,7 +19,13 @@ module.exports.preBuild = (pkg, build = false) => {
|
|
|
21
19
|
return configUtils.angular.registerAngularProjectDef(pkg);
|
|
22
20
|
})
|
|
23
21
|
|
|
24
|
-
//
|
|
22
|
+
// inject external app sources declaration
|
|
23
|
+
.then(() => {
|
|
24
|
+
if (pkg.externalSources) {
|
|
25
|
+
return injectionUtils.externals.injectElementExternalSources(pkg);
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
|
|
25
29
|
.then(() => {
|
|
26
30
|
tools.logInfo('Checking compiled translations');
|
|
27
31
|
if (pkg.build && pkg.build.compiledTranslations) {
|
package/scripts/utils/pre-build/injection/app-sources-full-skeleton/src/_generated/favicon.ico
ADDED
|
Binary file
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// ANGULAR & 3rd PARTIES
|
|
2
|
+
import { NgModule } from '@angular/core';
|
|
3
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
4
|
+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
5
|
+
import { HttpClientModule } from '@angular/common/http';
|
|
6
|
+
import { StoreModule } from '@ngrx/store';
|
|
7
|
+
import { EffectsModule } from '@ngrx/effects';
|
|
8
|
+
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
|
9
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
10
|
+
|
|
11
|
+
// eUI IMPORTS
|
|
12
|
+
import {
|
|
13
|
+
CoreModule, CoreModuleEffects, translateConfig, EUI_CONFIG_TOKEN,
|
|
14
|
+
} from '@eui/core';
|
|
15
|
+
import { EuiAllModule } from '@eui/components';
|
|
16
|
+
|
|
17
|
+
import { appConfig } from '../config/index';
|
|
18
|
+
import { environment } from '../environments/environment';
|
|
19
|
+
|
|
20
|
+
// APP ROUTES & ROOT COMPONENTS
|
|
21
|
+
import { AppRoutingModule } from '../../app/app-routing.module';
|
|
22
|
+
import { AppComponent } from '../../app/app.component';
|
|
23
|
+
|
|
24
|
+
import { TOKEN, reducerProvider, metaReducers } from './core/reducers/index';
|
|
25
|
+
|
|
26
|
+
// APP ROOT MODULE
|
|
27
|
+
@NgModule({
|
|
28
|
+
imports: [
|
|
29
|
+
BrowserModule,
|
|
30
|
+
BrowserAnimationsModule,
|
|
31
|
+
HttpClientModule,
|
|
32
|
+
StoreModule.forRoot(TOKEN, { metaReducers }),
|
|
33
|
+
StoreDevtoolsModule.instrument({ name: 'CSDR App', maxAge: 150, logOnly: environment.production }),
|
|
34
|
+
EffectsModule.forRoot([...CoreModuleEffects]),
|
|
35
|
+
TranslateModule.forRoot(translateConfig),
|
|
36
|
+
CoreModule.forRoot(),
|
|
37
|
+
AppRoutingModule,
|
|
38
|
+
EuiAllModule,
|
|
39
|
+
],
|
|
40
|
+
declarations: [
|
|
41
|
+
AppComponent,
|
|
42
|
+
],
|
|
43
|
+
providers: [
|
|
44
|
+
{ provide: EUI_CONFIG_TOKEN, useValue: { appConfig: appConfig, environment: environment } },
|
|
45
|
+
reducerProvider,
|
|
46
|
+
],
|
|
47
|
+
bootstrap: [
|
|
48
|
+
AppComponent,
|
|
49
|
+
],
|
|
50
|
+
})
|
|
51
|
+
export class AppModule {
|
|
52
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { ActionReducer, ActionReducerMap, combineReducers, MetaReducer } from '@ngrx/store';
|
|
3
|
+
import * as fromRouter from '@ngrx/router-store';
|
|
4
|
+
import { storeFreeze } from 'ngrx-store-freeze';
|
|
5
|
+
import { reducers as coreReducers, CoreState, localStorageSync } from '@eui/core';
|
|
6
|
+
|
|
7
|
+
export interface AppState extends CoreState {
|
|
8
|
+
router: fromRouter.RouterReducerState<any>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// -----------------
|
|
12
|
+
// ------------ AOT
|
|
13
|
+
export const TOKEN = new InjectionToken<any>('AppReducers');
|
|
14
|
+
|
|
15
|
+
export function getReducers(): ActionReducerMap<AppState, any> {
|
|
16
|
+
return {
|
|
17
|
+
router: fromRouter.routerReducer,
|
|
18
|
+
...coreReducers,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const reducerProvider = [
|
|
23
|
+
{ provide: TOKEN, useFactory: getReducers },
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
// console.log all actions
|
|
27
|
+
export function logger(reducer: ActionReducer<AppState>): ActionReducer<AppState> {
|
|
28
|
+
return (state, action) => {
|
|
29
|
+
const result = reducer(state, action);
|
|
30
|
+
console.groupCollapsed(action.type);
|
|
31
|
+
console.log('prev state', state);
|
|
32
|
+
console.log('action', action);
|
|
33
|
+
console.log('next state', result);
|
|
34
|
+
console.groupEnd();
|
|
35
|
+
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const metaReducers: MetaReducer<AppState>[] = [logger, localStorageSync, storeFreeze];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// used by serve / when no configuration is provided on the build script
|
|
2
|
+
// run npm run build
|
|
3
|
+
|
|
4
|
+
import { EuiEnvConfig } from '@eui/core';
|
|
5
|
+
|
|
6
|
+
export const environment: EuiEnvConfig = {
|
|
7
|
+
production: false,
|
|
8
|
+
enableDevToolRedux: true,
|
|
9
|
+
envDynamicConfig: {
|
|
10
|
+
uri: 'assets/config/env-json-config.json',
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* For easier debugging in development mode, you can import the following file
|
|
16
|
+
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
|
17
|
+
*
|
|
18
|
+
* This import should be commented out in production mode because it will have a negative impact
|
|
19
|
+
* on performance if an error is thrown.
|
|
20
|
+
*/
|
|
21
|
+
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
|