@nstudio/web-angular 12.7.0 → 13.4.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/README.md +5 -5
- package/package.json +4 -4
- package/src/schematics/component/index.js +1 -1
- package/src/schematics/component/schema.json +1 -1
- package/src/schematics/feature/index.js +4 -4
- package/src/schematics/ng-add/index.js +4 -4
- package/src/schematics/xplat/index.js +12 -12
- package/src/schematics/xplat/index.spec.js +10 -10
- package/src/utils/testing.js +1 -1
- package/src/utils/versions.js +1 -1
- package/src/utils/xplat.js +1 -1
package/README.md
CHANGED
@@ -28,9 +28,9 @@ npx create-nx-workspace@latest
|
|
28
28
|
|
29
29
|
At the prompts:
|
30
30
|
|
31
|
-
>
|
31
|
+
> What to create in the new workspace
|
32
32
|
|
33
|
-
> choose `
|
33
|
+
> choose `apps`
|
34
34
|
|
35
35
|
```
|
36
36
|
npm i @nstudio/xplat -D
|
@@ -187,9 +187,9 @@ nx run nativescript-mobile:android
|
|
187
187
|
|
188
188
|
Please see our [guidelines for contributing](https://github.com/nstudio/xplat/blob/master/CONTRIBUTING.md).
|
189
189
|
|
190
|
-
| [<img alt="NathanWalker" src="https://avatars.githubusercontent.com/u/457187?v=4&s=117" width="117">](https://github.com/NathanWalker) | [<img alt="
|
191
|
-
| :------------------------------------------------------------------------------------------------------------------------------------: |
|
192
|
-
| [NathanWalker](https://github.com/NathanWalker) | [
|
190
|
+
| [<img alt="NathanWalker" src="https://avatars.githubusercontent.com/u/457187?v=4&s=117" width="117">](https://github.com/NathanWalker) | [<img alt="pegaltier" src="https://avatars.githubusercontent.com/u/2479323?v=4&s=117" width="117">](https://github.com/pegaltier) | [<img alt="m-abs" src="https://avatars.githubusercontent.com/u/1348705?v=4&s=117" width="117">](https://github.com/m-abs) | [<img alt="sr3dna" src="https://avatars.githubusercontent.com/u/15936818?v=4&s=117" width="117">](https://github.com/sr3dna) | [<img alt="mbaljeetsingh" src="https://avatars.githubusercontent.com/u/872762?v=4&s=117" width="117">](https://github.com/mbaljeetsingh) |
|
191
|
+
| :------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------: |
|
192
|
+
| [NathanWalker](https://github.com/NathanWalker) | [pegaltier](https://github.com/pegaltier) | [m-abs](https://github.com/m-abs) | [sr3dna](https://github.com/sr3dna) | [mbaljeetsingh](https://github.com/mbaljeetsingh) |
|
193
193
|
|
194
194
|
| [<img alt="dopsonbr" src="https://avatars.githubusercontent.com/u/5340660?v=4&s=117" width="117">](https://github.com/dopsonbr) | [<img alt="AgentEnder" src="https://avatars.githubusercontent.com/u/6933928?v=4&s=117" width="117">](https://github.com/AgentEnder) | [<img alt="davecoffin" src="https://avatars.githubusercontent.com/u/1245462?v=4&s=117" width="117">](https://github.com/davecoffin) | [<img alt="dmitryr117" src="https://avatars.githubusercontent.com/u/5959314?v=4&s=117" width="117">](https://github.com/dmitryr117) | [<img alt="kamilmysliwiec" src="https://avatars.githubusercontent.com/u/23244943?v=4&s=117" width="117">](https://github.com/kamilmysliwiec) | [<img alt="madmath03" src="https://avatars.githubusercontent.com/u/6967675?v=4&s=117" width="117">](https://github.com/madmath03) |
|
195
195
|
| :-----------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------: |
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nstudio/web-angular",
|
3
|
-
"version": "
|
3
|
+
"version": "13.4.1",
|
4
4
|
"description": "Web Angular Plugin for xplat",
|
5
5
|
"homepage": "https://nstudio.io/xplat",
|
6
6
|
"repository": {
|
@@ -30,10 +30,10 @@
|
|
30
30
|
"migrations": "./migrations.json"
|
31
31
|
},
|
32
32
|
"dependencies": {
|
33
|
-
"@nstudio/angular": "
|
34
|
-
"@nstudio/web": "
|
33
|
+
"@nstudio/angular": "13.4.1",
|
34
|
+
"@nstudio/web": "13.4.1"
|
35
35
|
},
|
36
36
|
"peerDependencies": {
|
37
|
-
"@nstudio/xplat": "
|
37
|
+
"@nstudio/xplat": "13.4.1"
|
38
38
|
}
|
39
39
|
}
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schematics_1 = require("@angular-devkit/schematics");
|
4
4
|
const angular_1 = require("@nstudio/angular");
|
5
5
|
function default_1(options) {
|
6
|
-
return schematics_1.chain(angular_1.ComponentHelpers.platformGenerator(options, 'web'));
|
6
|
+
return (0, schematics_1.chain)(angular_1.ComponentHelpers.platformGenerator(options, 'web'));
|
7
7
|
}
|
8
8
|
exports.default = default_1;
|
@@ -9,7 +9,7 @@ function default_1(options) {
|
|
9
9
|
const chains = [];
|
10
10
|
if (options.onlyProject) {
|
11
11
|
for (const fullProjectPath of featureSettings.projectNames) {
|
12
|
-
const projectName = xplat_utils_1.parseProjectNameFromPath(fullProjectPath);
|
12
|
+
const projectName = (0, xplat_utils_1.parseProjectNameFromPath)(fullProjectPath);
|
13
13
|
const projectParts = projectName.split('-');
|
14
14
|
const platPrefix = projectParts[0];
|
15
15
|
const platSuffix = projectParts.pop();
|
@@ -27,11 +27,11 @@ function default_1(options) {
|
|
27
27
|
});
|
28
28
|
if (options.routing) {
|
29
29
|
chains.push((tree, context) => {
|
30
|
-
return angular_1.adjustRouting(options, routingModulePathOptions, platform)(tree, context);
|
30
|
+
return (0, angular_1.adjustRouting)(options, routingModulePathOptions, platform)(tree, context);
|
31
31
|
});
|
32
32
|
if (options.adjustSandbox) {
|
33
33
|
chains.push((tree, context) => {
|
34
|
-
return angular_1.adjustSandbox(options, platform, appDirectory)(tree, context);
|
34
|
+
return (0, angular_1.adjustSandbox)(options, platform, appDirectory)(tree, context);
|
35
35
|
});
|
36
36
|
}
|
37
37
|
}
|
@@ -56,6 +56,6 @@ function default_1(options) {
|
|
56
56
|
chains.push((tree, context) => xplat_1.XplatFeatureHelpers.addFiles(options, 'web', null, '_component', 'angular')(tree, context));
|
57
57
|
}
|
58
58
|
}
|
59
|
-
return schematics_1.chain([xplat_utils_1.prerun(), ...chains]);
|
59
|
+
return (0, schematics_1.chain)([(0, xplat_utils_1.prerun)(), ...chains]);
|
60
60
|
}
|
61
61
|
exports.default = default_1;
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schematics_1 = require("@angular-devkit/schematics");
|
4
4
|
const xplat_utils_1 = require("@nstudio/xplat-utils");
|
5
5
|
function default_1(options) {
|
6
|
-
return schematics_1.chain([
|
7
|
-
xplat_utils_1.prerun(options, true),
|
6
|
+
return (0, schematics_1.chain)([
|
7
|
+
(0, xplat_utils_1.prerun)(options, true),
|
8
8
|
options.platforms
|
9
|
-
? (tree, context) => schematics_1.externalSchematic('@nstudio/web-angular', 'xplat', options)
|
10
|
-
: schematics_1.noop(),
|
9
|
+
? (tree, context) => (0, schematics_1.externalSchematic)('@nstudio/web-angular', 'xplat', options)
|
10
|
+
: (0, schematics_1.noop)(),
|
11
11
|
]);
|
12
12
|
}
|
13
13
|
exports.default = default_1;
|
@@ -5,8 +5,8 @@ const xplat_1 = require("@nstudio/xplat");
|
|
5
5
|
const xplat_utils_1 = require("@nstudio/xplat-utils");
|
6
6
|
const xplat_2 = require("../../utils/xplat");
|
7
7
|
function default_1(options) {
|
8
|
-
return schematics_1.chain([
|
9
|
-
xplat_utils_1.prerun(options, true),
|
8
|
+
return (0, schematics_1.chain)([
|
9
|
+
(0, xplat_utils_1.prerun)(options, true),
|
10
10
|
// (tree: Tree, context: SchematicContext) => {
|
11
11
|
// if (tree.exists(`/libs/xplat/core/src/lib/index.ts`)) {
|
12
12
|
// return noop();
|
@@ -26,38 +26,38 @@ function default_1(options) {
|
|
26
26
|
const xplatFolderName = xplat_1.XplatHelpers.getXplatFoldername('web', 'angular');
|
27
27
|
// console.log('xplatName:', xplatName);
|
28
28
|
return options.skipDependentPlatformFiles
|
29
|
-
? schematics_1.noop()
|
29
|
+
? (0, schematics_1.noop)()
|
30
30
|
: xplat_1.XplatHelpers.addPlatformFiles(options, xplatFolderName, 'core', 'index.ts')(tree, context);
|
31
31
|
},
|
32
32
|
(tree, context) => {
|
33
33
|
const xplatFolderName = xplat_1.XplatHelpers.getXplatFoldername('web', 'angular');
|
34
34
|
// console.log('xplatName:', xplatName);
|
35
35
|
return options.skipDependentPlatformFiles
|
36
|
-
? schematics_1.noop()
|
36
|
+
? (0, schematics_1.noop)()
|
37
37
|
: xplat_1.XplatHelpers.addPlatformFiles(options, xplatFolderName, 'features', 'index.ts')(tree, context);
|
38
38
|
},
|
39
39
|
(tree, context) => {
|
40
40
|
const xplatFolderName = xplat_1.XplatHelpers.getXplatFoldername('web', 'angular');
|
41
41
|
if (tree.exists(`/libs/xplat/${xplatFolderName}/scss/src/_index.scss`)) {
|
42
42
|
// may have already generated web support
|
43
|
-
return schematics_1.noop()(tree, context);
|
43
|
+
return (0, schematics_1.noop)()(tree, context);
|
44
44
|
}
|
45
45
|
else {
|
46
|
-
return schematics_1.branchAndMerge(schematics_1.mergeWith(schematics_1.apply(schematics_1.url(`./_files_platform_scss`), [
|
47
|
-
schematics_1.template(Object.assign(Object.assign({}, options), xplat_1.getDefaultTemplateOptions())),
|
48
|
-
schematics_1.move(`libs/xplat/${xplatFolderName}/scss/src`),
|
46
|
+
return (0, schematics_1.branchAndMerge)((0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)(`./_files_platform_scss`), [
|
47
|
+
(0, schematics_1.template)(Object.assign(Object.assign({}, options), (0, xplat_1.getDefaultTemplateOptions)())),
|
48
|
+
(0, schematics_1.move)(`libs/xplat/${xplatFolderName}/scss/src`),
|
49
49
|
])))(tree, context);
|
50
50
|
}
|
51
51
|
},
|
52
52
|
(tree, context) => {
|
53
53
|
if (tree.exists('/libs/xplat/scss/src/_index.scss')) {
|
54
54
|
// user may have generated support already
|
55
|
-
return schematics_1.noop()(tree, context);
|
55
|
+
return (0, schematics_1.noop)()(tree, context);
|
56
56
|
}
|
57
57
|
else {
|
58
|
-
return schematics_1.branchAndMerge(schematics_1.mergeWith(schematics_1.apply(schematics_1.url(`./_files_lib_scss`), [
|
59
|
-
schematics_1.template(Object.assign(Object.assign({}, options), xplat_1.getDefaultTemplateOptions())),
|
60
|
-
schematics_1.move('libs/xplat/scss/src'),
|
58
|
+
return (0, schematics_1.branchAndMerge)((0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)(`./_files_lib_scss`), [
|
59
|
+
(0, schematics_1.template)(Object.assign(Object.assign({}, options), (0, xplat_1.getDefaultTemplateOptions)())),
|
60
|
+
(0, schematics_1.move)('libs/xplat/scss/src'),
|
61
61
|
])))(tree, context);
|
62
62
|
}
|
63
63
|
},
|
@@ -13,7 +13,7 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
13
13
|
const xplat_utils_1 = require("@nstudio/xplat-utils");
|
14
14
|
const testing_1 = require("@nstudio/xplat/testing");
|
15
15
|
const testing_2 = require("../../utils/testing");
|
16
|
-
xplat_utils_1.setTest();
|
16
|
+
(0, xplat_utils_1.setTest)();
|
17
17
|
describe('xplat schematic', () => {
|
18
18
|
let appTree;
|
19
19
|
const defaultOptions = {
|
@@ -23,20 +23,20 @@ describe('xplat schematic', () => {
|
|
23
23
|
};
|
24
24
|
beforeEach(() => {
|
25
25
|
appTree = schematics_1.Tree.empty();
|
26
|
-
appTree = testing_1.createEmptyWorkspace(appTree, 'angular');
|
26
|
+
appTree = (0, testing_1.createEmptyWorkspace)(appTree, 'angular');
|
27
27
|
});
|
28
28
|
it('should create default xplat support for web only', () => __awaiter(void 0, void 0, void 0, function* () {
|
29
29
|
const options = Object.assign({}, defaultOptions);
|
30
|
-
const tree = yield testing_2.runSchematic('xplat', options, appTree);
|
30
|
+
const tree = yield (0, testing_2.runSchematic)('xplat', options, appTree);
|
31
31
|
expect(tree.exists('/libs/xplat/web/core/src/lib/index.ts')).toBeTruthy();
|
32
32
|
expect(tree.exists('/libs/xplat/nativescript/core/src/lib/index.ts')).toBeFalsy();
|
33
|
-
let filePath = xplat_utils_1.getRootTsConfigPath();
|
34
|
-
let fileContent = xplat_utils_1.jsonParse(testing_1.getFileContent(tree, filePath));
|
33
|
+
let filePath = (0, xplat_utils_1.getRootTsConfigPath)();
|
34
|
+
let fileContent = (0, xplat_utils_1.jsonParse)((0, testing_1.getFileContent)(tree, filePath));
|
35
35
|
// console.log(fileContent);
|
36
36
|
expect(fileContent.compilerOptions.paths['@testing/xplat/web/core']).toBeTruthy();
|
37
37
|
expect(fileContent.compilerOptions.paths['@testing/xplat/web/features']).toBeTruthy();
|
38
38
|
filePath = '/package.json';
|
39
|
-
fileContent = xplat_utils_1.jsonParse(testing_1.getFileContent(tree, filePath));
|
39
|
+
fileContent = (0, xplat_utils_1.jsonParse)((0, testing_1.getFileContent)(tree, filePath));
|
40
40
|
// const hasScss = packageFile.dependencies[`@testing/scss`];
|
41
41
|
// expect(hasScss).not.toBeUndefined();
|
42
42
|
// should not include these root packages
|
@@ -45,12 +45,12 @@ describe('xplat schematic', () => {
|
|
45
45
|
}));
|
46
46
|
it('should create default xplat support with framework suffix when not specifying default', () => __awaiter(void 0, void 0, void 0, function* () {
|
47
47
|
appTree = schematics_1.Tree.empty();
|
48
|
-
appTree = testing_1.createEmptyWorkspace(appTree);
|
48
|
+
appTree = (0, testing_1.createEmptyWorkspace)(appTree);
|
49
49
|
const options = Object.assign({}, defaultOptions);
|
50
|
-
const tree = yield testing_2.runSchematic('xplat', options, appTree);
|
50
|
+
const tree = yield (0, testing_2.runSchematic)('xplat', options, appTree);
|
51
51
|
expect(tree.exists('/libs/xplat/web-angular/core/src/lib/index.ts')).toBeTruthy();
|
52
|
-
const filePath = xplat_utils_1.getRootTsConfigPath();
|
53
|
-
const fileContent = xplat_utils_1.jsonParse(testing_1.getFileContent(tree, filePath));
|
52
|
+
const filePath = (0, xplat_utils_1.getRootTsConfigPath)();
|
53
|
+
const fileContent = (0, xplat_utils_1.jsonParse)((0, testing_1.getFileContent)(tree, filePath));
|
54
54
|
// console.log(fileContent);
|
55
55
|
expect(fileContent.compilerOptions.paths['@testing/xplat/web-angular/core']).toBeTruthy();
|
56
56
|
expect(fileContent.compilerOptions.paths['@testing/xplat/web-angular/features']).toBeTruthy();
|
package/src/utils/testing.js
CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.callRule = exports.runSchematic = void 0;
|
4
4
|
const path_1 = require("path");
|
5
5
|
const testing_1 = require("@angular-devkit/schematics/testing");
|
6
|
-
const testRunner = new testing_1.SchematicTestRunner('@nstudio/web-angular', path_1.join(__dirname, '../../collection.json'));
|
6
|
+
const testRunner = new testing_1.SchematicTestRunner('@nstudio/web-angular', (0, path_1.join)(__dirname, '../../collection.json'));
|
7
7
|
function runSchematic(schematicName, options, tree) {
|
8
8
|
return testRunner.runSchematicAsync(schematicName, options, tree).toPromise();
|
9
9
|
}
|
package/src/utils/versions.js
CHANGED
package/src/utils/xplat.js
CHANGED
@@ -6,7 +6,7 @@ var XplatWebAngularHelpers;
|
|
6
6
|
(function (XplatWebAngularHelpers) {
|
7
7
|
function updateRootDeps(options) {
|
8
8
|
// nothing extra needed at moment
|
9
|
-
return schematics_1.noop();
|
9
|
+
return (0, schematics_1.noop)();
|
10
10
|
// return (tree: Tree, context: SchematicContext) => {
|
11
11
|
// return XplatHelpers.updatePackageForXplat(options, {
|
12
12
|
// dependencies: {
|