@fundamental-ngx/core 0.58.0-rc.66 → 0.58.0-rc.68
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/package.json +26 -26
- package/schematics/add-animations/index.d.ts +0 -7
- package/schematics/add-animations/index.js +0 -83
- package/schematics/add-animations/index.js.map +0 -1
- package/schematics/add-animations/schema.json +0 -21
- package/schematics/add-dependencies/index.d.ts +0 -7
- package/schematics/add-dependencies/index.js +0 -105
- package/schematics/add-dependencies/index.js.map +0 -1
- package/schematics/add-dependencies/schema.json +0 -15
- package/schematics/add-styles/index.d.ts +0 -7
- package/schematics/add-styles/index.js +0 -97
- package/schematics/add-styles/index.js.map +0 -1
- package/schematics/add-styles/schema.json +0 -21
- package/schematics/add-theming/index.d.ts +0 -7
- package/schematics/add-theming/index.js +0 -108
- package/schematics/add-theming/index.js.map +0 -1
- package/schematics/add-theming/schema.json +0 -72
- package/schematics/collection.json +0 -40
- package/schematics/models/schema.d.ts +0 -6
- package/schematics/models/schema.js +0 -3
- package/schematics/models/schema.js.map +0 -1
- package/schematics/ng-add/index.d.ts +0 -9
- package/schematics/ng-add/index.js +0 -30
- package/schematics/ng-add/index.js.map +0 -1
- package/schematics/ng-add/schema.json +0 -84
- package/schematics/utils/calls-providers-function.d.ts +0 -11
- package/schematics/utils/calls-providers-function.js +0 -54
- package/schematics/utils/calls-providers-function.js.map +0 -1
- package/schematics/utils/file-utils.d.ts +0 -2
- package/schematics/utils/file-utils.js +0 -26
- package/schematics/utils/file-utils.js.map +0 -1
- package/schematics/utils/main-ts-file-path.d.ts +0 -2
- package/schematics/utils/main-ts-file-path.js +0 -27
- package/schematics/utils/main-ts-file-path.js.map +0 -1
- package/schematics/utils/ng-module-utils.d.ts +0 -6
- package/schematics/utils/ng-module-utils.js +0 -71
- package/schematics/utils/ng-module-utils.js.map +0 -1
- package/schematics/utils/one-time-packages.d.ts +0 -6
- package/schematics/utils/one-time-packages.js +0 -39
- package/schematics/utils/one-time-packages.js.map +0 -1
- package/schematics/utils/package-utils.d.ts +0 -10
- package/schematics/utils/package-utils.js +0 -25
- package/schematics/utils/package-utils.js.map +0 -1
- package/schematics/utils/workspace.d.ts +0 -40
- package/schematics/utils/workspace.js +0 -110
- package/schematics/utils/workspace.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fundamental-ngx/core",
|
|
3
|
-
"version": "0.58.0-rc.
|
|
3
|
+
"version": "0.58.0-rc.68",
|
|
4
4
|
"schematics": "./schematics/collection.json",
|
|
5
5
|
"ng-update": {
|
|
6
6
|
"migrations": "./schematics/migrations.json"
|
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
"node": ">= 10"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@angular/animations": "
|
|
20
|
-
"@angular/cdk": "
|
|
21
|
-
"@angular/common": "
|
|
22
|
-
"@angular/core": "
|
|
23
|
-
"@angular/forms": "
|
|
24
|
-
"@angular/platform-browser": "
|
|
25
|
-
"@angular/router": "
|
|
26
|
-
"@fundamental-ngx/cdk": "
|
|
27
|
-
"@fundamental-ngx/i18n": "
|
|
19
|
+
"@angular/animations": "ANGULAR_VER_PLACEHOLDER",
|
|
20
|
+
"@angular/cdk": "ANGULAR_VER_PLACEHOLDER",
|
|
21
|
+
"@angular/common": "ANGULAR_VER_PLACEHOLDER",
|
|
22
|
+
"@angular/core": "ANGULAR_VER_PLACEHOLDER",
|
|
23
|
+
"@angular/forms": "ANGULAR_VER_PLACEHOLDER",
|
|
24
|
+
"@angular/platform-browser": "ANGULAR_VER_PLACEHOLDER",
|
|
25
|
+
"@angular/router": "ANGULAR_VER_PLACEHOLDER",
|
|
26
|
+
"@fundamental-ngx/cdk": "VERSION_PLACEHOLDER",
|
|
27
|
+
"@fundamental-ngx/i18n": "VERSION_PLACEHOLDER",
|
|
28
28
|
"@sap-theming/theming-base-content": "^11.31.0",
|
|
29
29
|
"fundamental-styles": "0.40.1",
|
|
30
30
|
"rxjs": "^7.8.0"
|
|
@@ -115,14 +115,14 @@
|
|
|
115
115
|
"types": "./datetime/index.d.ts",
|
|
116
116
|
"default": "./fesm2022/fundamental-ngx-core-datetime.mjs"
|
|
117
117
|
},
|
|
118
|
-
"./datetime-picker": {
|
|
119
|
-
"types": "./datetime-picker/index.d.ts",
|
|
120
|
-
"default": "./fesm2022/fundamental-ngx-core-datetime-picker.mjs"
|
|
121
|
-
},
|
|
122
118
|
"./dialog": {
|
|
123
119
|
"types": "./dialog/index.d.ts",
|
|
124
120
|
"default": "./fesm2022/fundamental-ngx-core-dialog.mjs"
|
|
125
121
|
},
|
|
122
|
+
"./datetime-picker": {
|
|
123
|
+
"types": "./datetime-picker/index.d.ts",
|
|
124
|
+
"default": "./fesm2022/fundamental-ngx-core-datetime-picker.mjs"
|
|
125
|
+
},
|
|
126
126
|
"./dynamic-page": {
|
|
127
127
|
"types": "./dynamic-page/index.d.ts",
|
|
128
128
|
"default": "./fesm2022/fundamental-ngx-core-dynamic-page.mjs"
|
|
@@ -147,14 +147,14 @@
|
|
|
147
147
|
"types": "./file-uploader/index.d.ts",
|
|
148
148
|
"default": "./fesm2022/fundamental-ngx-core-file-uploader.mjs"
|
|
149
149
|
},
|
|
150
|
-
"./flexible-column-layout": {
|
|
151
|
-
"types": "./flexible-column-layout/index.d.ts",
|
|
152
|
-
"default": "./fesm2022/fundamental-ngx-core-flexible-column-layout.mjs"
|
|
153
|
-
},
|
|
154
150
|
"./fixed-card-layout": {
|
|
155
151
|
"types": "./fixed-card-layout/index.d.ts",
|
|
156
152
|
"default": "./fesm2022/fundamental-ngx-core-fixed-card-layout.mjs"
|
|
157
153
|
},
|
|
154
|
+
"./flexible-column-layout": {
|
|
155
|
+
"types": "./flexible-column-layout/index.d.ts",
|
|
156
|
+
"default": "./fesm2022/fundamental-ngx-core-flexible-column-layout.mjs"
|
|
157
|
+
},
|
|
158
158
|
"./form": {
|
|
159
159
|
"types": "./form/index.d.ts",
|
|
160
160
|
"default": "./fesm2022/fundamental-ngx-core-form.mjs"
|
|
@@ -303,6 +303,10 @@
|
|
|
303
303
|
"types": "./quick-view/index.d.ts",
|
|
304
304
|
"default": "./fesm2022/fundamental-ngx-core-quick-view.mjs"
|
|
305
305
|
},
|
|
306
|
+
"./radio": {
|
|
307
|
+
"types": "./radio/index.d.ts",
|
|
308
|
+
"default": "./fesm2022/fundamental-ngx-core-radio.mjs"
|
|
309
|
+
},
|
|
306
310
|
"./rating-indicator": {
|
|
307
311
|
"types": "./rating-indicator/index.d.ts",
|
|
308
312
|
"default": "./fesm2022/fundamental-ngx-core-rating-indicator.mjs"
|
|
@@ -311,10 +315,6 @@
|
|
|
311
315
|
"types": "./resizable-card-layout/index.d.ts",
|
|
312
316
|
"default": "./fesm2022/fundamental-ngx-core-resizable-card-layout.mjs"
|
|
313
317
|
},
|
|
314
|
-
"./radio": {
|
|
315
|
-
"types": "./radio/index.d.ts",
|
|
316
|
-
"default": "./fesm2022/fundamental-ngx-core-radio.mjs"
|
|
317
|
-
},
|
|
318
318
|
"./scroll-spy": {
|
|
319
319
|
"types": "./scroll-spy/index.d.ts",
|
|
320
320
|
"default": "./fesm2022/fundamental-ngx-core-scroll-spy.mjs"
|
|
@@ -339,6 +339,10 @@
|
|
|
339
339
|
"types": "./shared/index.d.ts",
|
|
340
340
|
"default": "./fesm2022/fundamental-ngx-core-shared.mjs"
|
|
341
341
|
},
|
|
342
|
+
"./shellbar": {
|
|
343
|
+
"types": "./shellbar/index.d.ts",
|
|
344
|
+
"default": "./fesm2022/fundamental-ngx-core-shellbar.mjs"
|
|
345
|
+
},
|
|
342
346
|
"./side-navigation": {
|
|
343
347
|
"types": "./side-navigation/index.d.ts",
|
|
344
348
|
"default": "./fesm2022/fundamental-ngx-core-side-navigation.mjs"
|
|
@@ -351,10 +355,6 @@
|
|
|
351
355
|
"types": "./slider/index.d.ts",
|
|
352
356
|
"default": "./fesm2022/fundamental-ngx-core-slider.mjs"
|
|
353
357
|
},
|
|
354
|
-
"./shellbar": {
|
|
355
|
-
"types": "./shellbar/index.d.ts",
|
|
356
|
-
"default": "./fesm2022/fundamental-ngx-core-shellbar.mjs"
|
|
357
|
-
},
|
|
358
358
|
"./split-button": {
|
|
359
359
|
"types": "./split-button/index.d.ts",
|
|
360
360
|
"default": "./fesm2022/fundamental-ngx-core-split-button.mjs"
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.addAnimations = addAnimations;
|
|
13
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
14
|
-
const schematics_2 = require("@angular/cdk/schematics");
|
|
15
|
-
const utility_1 = require("@schematics/angular/utility");
|
|
16
|
-
const calls_providers_function_1 = require("../utils/calls-providers-function");
|
|
17
|
-
const main_ts_file_path_1 = require("../utils/main-ts-file-path");
|
|
18
|
-
const ng_module_utils_1 = require("../utils/ng-module-utils");
|
|
19
|
-
/**
|
|
20
|
-
* Adds animations to the project.
|
|
21
|
-
* @param options
|
|
22
|
-
*/
|
|
23
|
-
function addAnimations(options) {
|
|
24
|
-
return (0, schematics_1.chain)([_addAnimations(options)]);
|
|
25
|
-
}
|
|
26
|
-
function _addAnimations(options) {
|
|
27
|
-
return (tree, context) => __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const mainFilePath = yield (0, main_ts_file_path_1.getMainTsFilePath)(tree, options.project);
|
|
29
|
-
const isStandalone = (0, schematics_2.isStandaloneApp)(tree, mainFilePath);
|
|
30
|
-
return isStandalone
|
|
31
|
-
? addAnimationsProviders(options, tree, context)
|
|
32
|
-
: addAnimationsModule(options, tree, context);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function addAnimationsProviders(options, tree, context) {
|
|
36
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
const animationsFunction = 'provideAnimations';
|
|
38
|
-
const noopAnimationsFunction = 'provideNoopAnimations';
|
|
39
|
-
if (options.animations) {
|
|
40
|
-
if (yield (0, calls_providers_function_1.callsProvidersFunction)(tree, options.project, animationsFunction)) {
|
|
41
|
-
context.logger.info(`✅️ ${animationsFunction} already present in bootstrap call. Skipping.`);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
if (yield (0, calls_providers_function_1.callsProvidersFunction)(tree, options.project, noopAnimationsFunction)) {
|
|
45
|
-
context.logger.warn(`⚠️ Could not set up "${animationsFunction} because "${noopAnimationsFunction}" is already imported. Please manually set up browser animations.`);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
return (0, utility_1.addRootProvider)(options.project, ({ code, external }) => code `${external(animationsFunction, '@angular/platform-browser/animations')}()`);
|
|
49
|
-
}
|
|
50
|
-
return;
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
function addAnimationsModule(options, tree, context) {
|
|
54
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
const browserAnimationsModuleName = 'BrowserAnimationsModule';
|
|
56
|
-
const noopAnimationsModuleName = 'NoopAnimationsModule';
|
|
57
|
-
const modulePath = yield (0, schematics_2.findModuleFromOptions)(tree, options);
|
|
58
|
-
if (!modulePath) {
|
|
59
|
-
context.logger.warn(`⚠️ Could not set up animations because root module not found. Please manually set up animations.`);
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (options.animations) {
|
|
63
|
-
if ((0, ng_module_utils_1.hasModuleImport)(tree, modulePath, noopAnimationsModuleName)) {
|
|
64
|
-
context.logger.warn(
|
|
65
|
-
// eslint-disable-next-line max-len
|
|
66
|
-
`⚠️ Could not set up "${browserAnimationsModuleName} because "${noopAnimationsModuleName}" is already imported. Please manually set up browser animations.`);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if ((0, ng_module_utils_1.hasModuleImport)(tree, modulePath, browserAnimationsModuleName)) {
|
|
70
|
-
context.logger.info(`✅️ Import of ${browserAnimationsModuleName} already present in app module. Skipping.`);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
(0, schematics_2.addModuleImportToModule)(tree, modulePath, browserAnimationsModuleName, '@angular/platform-browser/animations');
|
|
74
|
-
context.logger.info(`✅️ Added ${browserAnimationsModuleName} to app module.`);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (!(0, ng_module_utils_1.hasModuleImport)(tree, modulePath, browserAnimationsModuleName)) {
|
|
78
|
-
(0, schematics_2.addModuleImportToModule)(tree, modulePath, noopAnimationsModuleName, '@angular/platform-browser/animations');
|
|
79
|
-
context.logger.info(`✅️ Added ${noopAnimationsModuleName} to app module.`);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/core/schematics/add-animations/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAYA,sCAEC;AAdD,2DAAiF;AACjF,wDAA0G;AAC1G,yDAA8D;AAE9D,gFAA2E;AAC3E,kEAA+D;AAC/D,8DAA2D;AAE3D;;;GAGG;AACH,SAAgB,aAAa,CAAC,OAAe;IACzC,OAAO,IAAA,kBAAK,EAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,C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,CAAC,IAAI,CAAC,YAAY,wBAAwB,iBAAiB,CAAC,CAAC;QAC/E,CAAC;IACL,CAAC;CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"$id": "fundamental-ngx-add-animations",
|
|
4
|
-
"title": "Fundamental Library for Angular add-animations schematic",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"project": {
|
|
8
|
-
"type": "string",
|
|
9
|
-
"description": "The name of the project.",
|
|
10
|
-
"$default": {
|
|
11
|
-
"$source": "projectName"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"animations": {
|
|
15
|
-
"type": "boolean",
|
|
16
|
-
"default": true,
|
|
17
|
-
"description": "Whether Angular browser animations should be set up.",
|
|
18
|
-
"x-prompt": "Set up browser animations for Fundamental Library for Angular?"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addDependencies = addDependencies;
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
-
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
|
6
|
-
const compare_versions_1 = require("compare-versions");
|
|
7
|
-
const semver_1 = require("semver");
|
|
8
|
-
const package_utils_1 = require("../utils/package-utils");
|
|
9
|
-
const libraryPackageJson = require('@fundamental-ngx/core/package.json');
|
|
10
|
-
const desiredVersions = {
|
|
11
|
-
'fundamental-styles': process.env.FD_ENV_FDSTYLES_VER_PLACEHOLDER || libraryPackageJson.peerDependencies['fundamental-styles'],
|
|
12
|
-
'@sap-theming/theming-base-content': process.env.FD_ENV_THEMING_VER_PLACEHOLDER ||
|
|
13
|
-
libraryPackageJson.peerDependencies['@sap-theming/theming-base-content'],
|
|
14
|
-
'@fundamental-ngx/i18n': process.env.FD_ENV_VERSION_PLACEHOLDER || libraryPackageJson.peerDependencies['@fundamental-ngx/i18n'],
|
|
15
|
-
'@fundamental-ngx/cdk': process.env.FD_ENV_VERSION_PLACEHOLDER || libraryPackageJson.peerDependencies['@fundamental-ngx/cdk']
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Adds dependencies to the project
|
|
19
|
-
* @param options
|
|
20
|
-
*/
|
|
21
|
-
function addDependencies(options) {
|
|
22
|
-
return addExternalLibraries(options);
|
|
23
|
-
}
|
|
24
|
-
function addExternalLibraries(options) {
|
|
25
|
-
return (tree, context) => {
|
|
26
|
-
const ngCoreVersionTag = (0, dependencies_1.getPackageJsonDependency)(tree, '@angular/core');
|
|
27
|
-
if (!ngCoreVersionTag) {
|
|
28
|
-
throw new schematics_1.SchematicsException('Could not find @angular/core in package.json');
|
|
29
|
-
}
|
|
30
|
-
const angularVersion = (0, semver_1.valid)((0, semver_1.coerce)(ngCoreVersionTag.version))
|
|
31
|
-
? `^${(0, semver_1.major)((0, semver_1.coerce)(ngCoreVersionTag.version))}.0.0`
|
|
32
|
-
: null;
|
|
33
|
-
if (!angularVersion) {
|
|
34
|
-
throw new schematics_1.SchematicsException(`Could not determine Angular version, ${ngCoreVersionTag} is not valid semver`);
|
|
35
|
-
}
|
|
36
|
-
const formsDependency = (0, dependencies_1.getPackageJsonDependency)(tree, '@angular/forms');
|
|
37
|
-
if (!formsDependency) {
|
|
38
|
-
(0, package_utils_1.addPackageDependency)(tree, {
|
|
39
|
-
type: dependencies_1.NodeDependencyType.Default,
|
|
40
|
-
version: angularVersion,
|
|
41
|
-
name: '@angular/forms'
|
|
42
|
-
}, context);
|
|
43
|
-
}
|
|
44
|
-
const animationsDependency = (0, dependencies_1.getPackageJsonDependency)(tree, '@angular/animations');
|
|
45
|
-
if (options.animations && !animationsDependency) {
|
|
46
|
-
(0, package_utils_1.addPackageDependency)(tree, {
|
|
47
|
-
type: dependencies_1.NodeDependencyType.Default,
|
|
48
|
-
version: angularVersion,
|
|
49
|
-
name: '@angular/animations'
|
|
50
|
-
}, context);
|
|
51
|
-
}
|
|
52
|
-
const cdKDependency = (0, dependencies_1.getPackageJsonDependency)(tree, '@angular/cdk');
|
|
53
|
-
if (!cdKDependency) {
|
|
54
|
-
(0, package_utils_1.addPackageDependency)(tree, {
|
|
55
|
-
type: dependencies_1.NodeDependencyType.Default,
|
|
56
|
-
version: angularVersion,
|
|
57
|
-
name: '@angular/cdk'
|
|
58
|
-
}, context);
|
|
59
|
-
}
|
|
60
|
-
const fundamentalStylesDependency = (0, dependencies_1.getPackageJsonDependency)(tree, 'fundamental-styles');
|
|
61
|
-
if (!fundamentalStylesDependency ||
|
|
62
|
-
(0, compare_versions_1.compare)(fundamentalStylesDependency.version, desiredVersions['fundamental-styles'], '<')) {
|
|
63
|
-
(0, package_utils_1.addPackageDependency)(tree, {
|
|
64
|
-
type: dependencies_1.NodeDependencyType.Default,
|
|
65
|
-
// Will be replaced with the real version during sync-version script run
|
|
66
|
-
version: desiredVersions['fundamental-styles'],
|
|
67
|
-
name: 'fundamental-styles',
|
|
68
|
-
overwrite: true
|
|
69
|
-
}, context);
|
|
70
|
-
}
|
|
71
|
-
const themingBaseContentDependency = (0, dependencies_1.getPackageJsonDependency)(tree, '@sap-theming/theming-base-content');
|
|
72
|
-
if (!themingBaseContentDependency ||
|
|
73
|
-
(0, compare_versions_1.compare)(themingBaseContentDependency.version, desiredVersions['@sap-theming/theming-base-content'], '<')) {
|
|
74
|
-
(0, package_utils_1.addPackageDependency)(tree, {
|
|
75
|
-
type: dependencies_1.NodeDependencyType.Default,
|
|
76
|
-
// Will be replaced with the real version during sync-version script run
|
|
77
|
-
version: desiredVersions['@sap-theming/theming-base-content'],
|
|
78
|
-
name: '@sap-theming/theming-base-content',
|
|
79
|
-
overwrite: true
|
|
80
|
-
}, context);
|
|
81
|
-
}
|
|
82
|
-
const i18nDependency = (0, dependencies_1.getPackageJsonDependency)(tree, '@fundamental-ngx/i18n');
|
|
83
|
-
if (!i18nDependency || (0, compare_versions_1.compare)(i18nDependency.version, desiredVersions['@fundamental-ngx/i18n'], '<')) {
|
|
84
|
-
(0, package_utils_1.addPackageDependency)(tree, {
|
|
85
|
-
type: dependencies_1.NodeDependencyType.Default,
|
|
86
|
-
// Will be replaced with the real version during sync-version script run
|
|
87
|
-
version: desiredVersions['@fundamental-ngx/i18n'],
|
|
88
|
-
name: '@fundamental-ngx/i18n',
|
|
89
|
-
overwrite: true
|
|
90
|
-
}, context);
|
|
91
|
-
}
|
|
92
|
-
const fdCdkDependency = (0, dependencies_1.getPackageJsonDependency)(tree, '@fundamental-ngx/cdk');
|
|
93
|
-
if (!fdCdkDependency || (0, compare_versions_1.compare)(fdCdkDependency.version, desiredVersions['@fundamental-ngx/cdk'], '<')) {
|
|
94
|
-
(0, package_utils_1.addPackageDependency)(tree, {
|
|
95
|
-
type: dependencies_1.NodeDependencyType.Default,
|
|
96
|
-
// Will be replaced with the real version during sync-version script run
|
|
97
|
-
version: desiredVersions['@fundamental-ngx/cdk'],
|
|
98
|
-
name: '@fundamental-ngx/cdk',
|
|
99
|
-
overwrite: true
|
|
100
|
-
}, context);
|
|
101
|
-
}
|
|
102
|
-
return tree;
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/core/schematics/add-dependencies/index.ts"],"names":[],"mappings":";;AAyBA,0CAEC;AA3BD,2DAA+F;AAC/F,2EAAwG;AACxG,uDAA2C;AAC3C,mCAAsD;AAEtD,0DAA8D;AAE9D,MAAM,kBAAkB,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAEzE,MAAM,eAAe,GAAG;IACpB,oBAAoB,EAChB,OAAO,CAAC,GAAG,CAAC,+BAA+B,IAAI,kBAAkB,CAAC,gBAAgB,CAAC,oBAAoB,CAAC;IAC5G,mCAAmC,EAC/B,OAAO,CAA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+0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"$id": "fundamental-ngx-add-dependencies",
|
|
4
|
-
"title": "Fundamental Library for Angular add-dependencies schematic",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"project": {
|
|
8
|
-
"type": "string",
|
|
9
|
-
"description": "The name of the project.",
|
|
10
|
-
"$default": {
|
|
11
|
-
"$source": "projectName"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.addStyles = addStyles;
|
|
13
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
14
|
-
const workspace_1 = require("../utils/workspace");
|
|
15
|
-
/**
|
|
16
|
-
* Add styles to angular.json
|
|
17
|
-
* @param options
|
|
18
|
-
*/
|
|
19
|
-
function addStyles(options) {
|
|
20
|
-
return (0, schematics_1.chain)([addStylesToConfig(options), addAssetsToConfig(options)]);
|
|
21
|
-
}
|
|
22
|
-
function handleError(context, error, message) {
|
|
23
|
-
context.logger.error(message);
|
|
24
|
-
throw new schematics_1.SchematicsException(`${message}: ${error.message}`);
|
|
25
|
-
}
|
|
26
|
-
function addStylesToConfig(options) {
|
|
27
|
-
return (tree, context) => __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
var _a;
|
|
29
|
-
try {
|
|
30
|
-
const additionalStyle = './node_modules/@fundamental-ngx/core/styles/fundamental-ngx-core.css';
|
|
31
|
-
const buildTarget = yield (0, workspace_1.getProjectBuildTarget)(tree, options.project);
|
|
32
|
-
const stylesArray = ((_a = buildTarget.options) === null || _a === void 0 ? void 0 : _a.styles) || [];
|
|
33
|
-
if (!stylesArray.includes(additionalStyle)) {
|
|
34
|
-
stylesArray.push(additionalStyle);
|
|
35
|
-
context.logger.info(`✅️ Added style to angular.json.`);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
context.logger.info(`✅️ Style already exists in angular.json. Skipping.`);
|
|
39
|
-
}
|
|
40
|
-
buildTarget.options.styles = stylesArray;
|
|
41
|
-
const workspace = yield (0, workspace_1.getWorkspaceDefinition)(tree);
|
|
42
|
-
yield (0, workspace_1.updateWorkspaceDefinition)(tree, workspace);
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
handleError(context, error, 'Failed to add styles configuration');
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
function addAssetsToConfig(options) {
|
|
50
|
-
return (tree, context) => __awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
var _a;
|
|
52
|
-
try {
|
|
53
|
-
const additionalAssets = [
|
|
54
|
-
{
|
|
55
|
-
glob: '**/css_variables.css',
|
|
56
|
-
input: './node_modules/@sap-theming/theming-base-content/content/Base/baseLib/',
|
|
57
|
-
output: './assets/theming-base/'
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
glob: '**/*',
|
|
61
|
-
input: './node_modules/@sap-theming/theming-base-content/content/Base/baseLib/baseTheme/fonts/',
|
|
62
|
-
output: './assets/theming-base/baseTheme/fonts/'
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
glob: '**/*',
|
|
66
|
-
input: './node_modules/@sap-theming/theming-base-content/content/Base/baseLib/sap_horizon/fonts/',
|
|
67
|
-
output: './assets/theming-base/sap_horizon/fonts/'
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
glob: '**/*',
|
|
71
|
-
input: './node_modules/fundamental-styles/dist/theming/',
|
|
72
|
-
output: './assets/fundamental-styles-theming/'
|
|
73
|
-
}
|
|
74
|
-
];
|
|
75
|
-
const buildTarget = yield (0, workspace_1.getProjectBuildTarget)(tree, options.project);
|
|
76
|
-
const assetsArray = ((_a = buildTarget.options) === null || _a === void 0 ? void 0 : _a.assets) || [];
|
|
77
|
-
const newAssets = additionalAssets.filter((newAsset) => !assetsArray.some((existingAsset) => typeof existingAsset === 'object' &&
|
|
78
|
-
existingAsset.input === newAsset.input &&
|
|
79
|
-
existingAsset.glob === newAsset.glob &&
|
|
80
|
-
existingAsset.output === newAsset.output));
|
|
81
|
-
if (newAssets.length > 0) {
|
|
82
|
-
assetsArray.push(...newAssets);
|
|
83
|
-
context.logger.info(`✅️ Added assets to angular.json.`);
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
context.logger.info(`✅️ Assets already exist in angular.json. Skipping.`);
|
|
87
|
-
}
|
|
88
|
-
buildTarget.options.assets = assetsArray;
|
|
89
|
-
const workspace = yield (0, workspace_1.getWorkspaceDefinition)(tree);
|
|
90
|
-
yield (0, workspace_1.updateWorkspaceDefinition)(tree, workspace);
|
|
91
|
-
}
|
|
92
|
-
catch (error) {
|
|
93
|
-
handleError(context, error, 'Failed to add assets configuration');
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/core/schematics/add-styles/index.ts"],"names":[],"mappings":";;;;;;;;;;;AASA,8BAEC;AAVD,2DAAsG;AAEtG,kDAA8G;AAE9G;;;GAGG;AACH,SAA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MAAM,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;YAC5D,CAAC;iBAAM,CAAC;gBACJ,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;YAC9E,CAAC;YAED,WAAW,CAAC,OAAO,CAAC,MAAM,GAAG,WAAW,CAAC;YACzC,MAAM,SAAS,GAAG,MAAM,IAAA,kCAAsB,EAAC,IAAI,CAAC,CAAC;YACrD,MAAM,IAAA,qCAAyB,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACrD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE,oCAAoC,CAAC,CAAC;QACtE,CAAC;IACL,CAAC,CAAA,CAAC;AACN,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"$id": "fundamental-ngx-add-styles",
|
|
4
|
-
"title": "Fundamental Library for Angular add-styles schematic",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"project": {
|
|
8
|
-
"type": "string",
|
|
9
|
-
"description": "The name of the project.",
|
|
10
|
-
"$default": {
|
|
11
|
-
"$source": "projectName"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"fonts": {
|
|
15
|
-
"type": "boolean",
|
|
16
|
-
"default": true,
|
|
17
|
-
"description": "Whether default fonts from theming should be added to styles file.",
|
|
18
|
-
"x-prompt": "Add default font imports into styles file?"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.addTheming = addTheming;
|
|
13
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
14
|
-
const schematics_2 = require("@angular/cdk/schematics");
|
|
15
|
-
const utility_1 = require("@schematics/angular/utility");
|
|
16
|
-
const calls_providers_function_1 = require("../utils/calls-providers-function");
|
|
17
|
-
const main_ts_file_path_1 = require("../utils/main-ts-file-path");
|
|
18
|
-
const workspace_1 = require("../utils/workspace");
|
|
19
|
-
/**
|
|
20
|
-
* Add theming to angular.json and root module or config
|
|
21
|
-
* @param options
|
|
22
|
-
*/
|
|
23
|
-
function addTheming(options) {
|
|
24
|
-
return (tree, context) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
if (options.theme === 'custom') {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
context.logger.info(`⚠️ Currently, we don't automatically remove the deprecated Themes approach. If you have it applied you have to remove it by yourself.
|
|
29
|
-
[Instructions: https://sap.github.io/fundamental-ngx/#/core/theming]`);
|
|
30
|
-
const buildTarget = yield (0, workspace_1.getProjectBuildTarget)(tree, options.project);
|
|
31
|
-
const targetOptions = buildTarget.options;
|
|
32
|
-
if (!targetOptions) {
|
|
33
|
-
context.logger.info(`⚠️ Can not add theming to application. Please add theming manually. Reason: no target options found for project ${options.project}`);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const styles = targetOptions.styles;
|
|
37
|
-
for (let i = 0; i < styles.length; i++) {
|
|
38
|
-
const style = styles[i];
|
|
39
|
-
const stylePath = typeof style === 'string' ? style : style.input;
|
|
40
|
-
const baseVariablesMatch = stylePath.match(/@sap-theming\/(.*)\/baseLib\/(.*)\/css_variables.css$/);
|
|
41
|
-
if (baseVariablesMatch) {
|
|
42
|
-
const theme = baseVariablesMatch[2];
|
|
43
|
-
context.logger
|
|
44
|
-
.info(`⚠️ Found theming ${theme} base SAP variables in styles. Can not add theme to application.
|
|
45
|
-
Try to replace theme in application manually, or use ThemingService to manage multiple themes.
|
|
46
|
-
[Instructions: https://sap.github.io/fundamental-ngx/#/core/theming]`);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const fundamentalStylesDeltaThemingVariablesMatch = stylePath.match(/fundamental-styles\/(.*)\/theming\/(.*)\/.css$/);
|
|
50
|
-
if (fundamentalStylesDeltaThemingVariablesMatch) {
|
|
51
|
-
const theme = fundamentalStylesDeltaThemingVariablesMatch[2];
|
|
52
|
-
context.logger
|
|
53
|
-
.info(`⚠️ Found theming ${theme} fundamental-styles variables in styles. Can not add theme to application.
|
|
54
|
-
Try to replace theme in application manually, or use ThemingService to manage multiple themes.
|
|
55
|
-
[Instructions: https://sap.github.io/fundamental-ngx/#/core/theming]`);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
try {
|
|
60
|
-
return (0, schematics_1.chain)([
|
|
61
|
-
() => __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
if (!(yield (0, calls_providers_function_1.callsProvidersFunction)(tree, options.project, 'provideTheming'))) {
|
|
63
|
-
return (0, schematics_1.chain)([
|
|
64
|
-
(0, utility_1.addRootProvider)(options.project, ({ code, external }) => code `${external('provideTheming', '@fundamental-ngx/core/theming')}({ defaultTheme: '${options.theme}', changeThemeOnQueryParamChange: ${options.readThemeFromURL ? 'true' : 'false'} })`),
|
|
65
|
-
() => context.logger.info(`✅️ Added theming provider to root app config`)
|
|
66
|
-
]);
|
|
67
|
-
}
|
|
68
|
-
context.logger.info(`✅️ Found theming provider in root app config, skipping adding it.`);
|
|
69
|
-
}),
|
|
70
|
-
() => __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
if (options.readThemeFromURL) {
|
|
72
|
-
const mainPath = yield (0, main_ts_file_path_1.getMainTsFilePath)(tree, options.project);
|
|
73
|
-
if ((0, schematics_2.isStandaloneApp)(tree, mainPath)) {
|
|
74
|
-
if (!(yield (0, calls_providers_function_1.callsProvidersFunction)(tree, options.project, 'provideRouter'))) {
|
|
75
|
-
return (0, schematics_1.chain)([
|
|
76
|
-
(0, utility_1.addRootProvider)(options.project, ({ code, external }) => code `${external('provideRouter', '@fundamental-ngx/core/router')}([])`),
|
|
77
|
-
() => context.logger.info(`✅️ Added router provider to root app config`)
|
|
78
|
-
]);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
const appModulePath = (0, schematics_2.getAppModulePath)(tree, mainPath);
|
|
83
|
-
if (!(0, schematics_2.hasNgModuleImport)(tree, appModulePath, 'RouterModule')) {
|
|
84
|
-
(0, schematics_2.addModuleImportToRootModule)(tree, 'RouterModule.forRoot([])', '@angular/router', yield (0, workspace_1.getProjectDefinition)(tree, options.project));
|
|
85
|
-
context.logger.info(`✅️ Added RouterModule.forRoot([]) to root app module`);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}),
|
|
90
|
-
() => __awaiter(this, void 0, void 0, function* () {
|
|
91
|
-
if (!(yield (0, calls_providers_function_1.callsProvidersFunction)(tree, options.project, 'themingInitializer'))) {
|
|
92
|
-
return (0, schematics_1.chain)([
|
|
93
|
-
(0, utility_1.addRootProvider)(options.project, ({ code, external }) => code `${external('themingInitializer', '@fundamental-ngx/core/theming')}()`),
|
|
94
|
-
() => context.logger.info(`✅️ Added themingInitializer provider to root app config`)
|
|
95
|
-
]);
|
|
96
|
-
}
|
|
97
|
-
context.logger.info(`✅️ Found themingInitializer provider in root app config, skipping adding it.`);
|
|
98
|
-
})
|
|
99
|
-
]);
|
|
100
|
-
}
|
|
101
|
-
catch (e) {
|
|
102
|
-
context.logger.debug(e);
|
|
103
|
-
context.logger.info(`⚠️ Please process adding Theming to root module by yourself.
|
|
104
|
-
[Instructions: https://sap.github.io/fundamental-ngx/#/core/theming]`);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/core/schematics/add-theming/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAkBA,gCAqHC;AAtID,2DAAyD;AACzD,wDAKiC;AACjC,yDAA8D;AAE9D,gFAA2E;AAC3E,kEAA+D;AAC/D,kDAAiF;AAEjF;;;GAGG;AACH,SAAgB,UAAU,CAAC,OAAe;IACtC,OAAO,CAAO,IAAI,EAAE,OAAO,EAAE,EAAE;QAC3B,IAAI,OAAO,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO;QACX,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CACf;qEACyD,CAC5D,CAAC;QACF,MAAM,WAAW,GAAG,MAAM,IAAA,iCAAqB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACvE,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,CAAC;QAC1C,IAAI,CAAC,aAAa,EAAE,CAAC;YACjB,OAAO,CAAC,MAAM,CAAC,IAAI,CACf,mHAAmH,OAAO,CAAC,OAAO,EAAE,CACvI,CAAC;YACF,OAAO;QACX,CAAC;QACD,MAAM,MAAM,GAAG,aAAa,CAAC,MAAwB,CAAC;QAEtD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACxB,MAAM,SAAS,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,K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