@nstudio/web 13.0.1 → 13.4.0
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
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nstudio/web",
|
3
|
-
"version": "13.0
|
3
|
+
"version": "13.4.0",
|
4
4
|
"description": "Web Plugin for xplat",
|
5
5
|
"homepage": "https://nstudio.io/xplat",
|
6
6
|
"repository": {
|
@@ -33,6 +33,6 @@
|
|
33
33
|
"@nrwl/web": "^13.0.0"
|
34
34
|
},
|
35
35
|
"peerDependencies": {
|
36
|
-
"@nstudio/xplat": "13.0
|
36
|
+
"@nstudio/xplat": "13.4.0"
|
37
37
|
}
|
38
38
|
}
|
@@ -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', 'xplat', options)
|
10
|
-
: schematics_1.noop(),
|
9
|
+
? (tree, context) => (0, schematics_1.externalSchematic)('@nstudio/web', 'xplat', options)
|
10
|
+
: (0, schematics_1.noop)(),
|
11
11
|
]);
|
12
12
|
}
|
13
13
|
exports.default = default_1;
|
@@ -5,24 +5,24 @@ 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),
|
8
|
+
return (0, schematics_1.chain)([
|
9
|
+
(0, xplat_utils_1.prerun)(options),
|
10
10
|
(tree, context) => {
|
11
11
|
if (tree.exists('/libs/xplat/scss/src/_index.scss')) {
|
12
12
|
// may have already generated support
|
13
|
-
return schematics_1.noop()(tree, context);
|
13
|
+
return (0, schematics_1.noop)()(tree, context);
|
14
14
|
}
|
15
15
|
else {
|
16
|
-
return schematics_1.branchAndMerge(schematics_1.mergeWith(schematics_1.apply(schematics_1.url(`./_files_lib_scss`), [
|
17
|
-
schematics_1.template(Object.assign(Object.assign({}, options), xplat_1.getDefaultTemplateOptions())),
|
18
|
-
schematics_1.move(`libs/xplat/scss/src`),
|
16
|
+
return (0, schematics_1.branchAndMerge)((0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)(`./_files_lib_scss`), [
|
17
|
+
(0, schematics_1.template)(Object.assign(Object.assign({}, options), (0, xplat_1.getDefaultTemplateOptions)())),
|
18
|
+
(0, schematics_1.move)(`libs/xplat/scss/src`),
|
19
19
|
])))(tree, context);
|
20
20
|
}
|
21
21
|
},
|
22
22
|
(tree, context) => {
|
23
23
|
if (tree.exists('/libs/xplat/web/scss/src/_index.scss')) {
|
24
24
|
// may have already generated support
|
25
|
-
return schematics_1.noop()(tree, context);
|
25
|
+
return (0, schematics_1.noop)()(tree, context);
|
26
26
|
}
|
27
27
|
else {
|
28
28
|
return xplat_1.XplatHelpers.addPlatformFiles(options, 'web', 'scss', '_index.scss')(tree, context);
|
@@ -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 = {
|
@@ -22,15 +22,15 @@ describe('xplat schematic', () => {
|
|
22
22
|
};
|
23
23
|
beforeEach(() => {
|
24
24
|
appTree = schematics_1.Tree.empty();
|
25
|
-
appTree = testing_1.createEmptyWorkspace(appTree);
|
25
|
+
appTree = (0, testing_1.createEmptyWorkspace)(appTree);
|
26
26
|
});
|
27
27
|
it('should create default xplat support for web only', () => __awaiter(void 0, void 0, void 0, function* () {
|
28
28
|
const options = Object.assign({}, defaultOptions);
|
29
|
-
const tree = yield testing_2.runSchematic('xplat', options, appTree);
|
29
|
+
const tree = yield (0, testing_2.runSchematic)('xplat', options, appTree);
|
30
30
|
// console.log(tree.files);
|
31
31
|
expect(tree.exists('/libs/xplat/web/scss/src/_index.scss')).toBeTruthy();
|
32
32
|
const packagePath = '/package.json';
|
33
|
-
const packageFile = xplat_utils_1.jsonParse(testing_1.getFileContent(tree, packagePath));
|
33
|
+
const packageFile = (0, xplat_utils_1.jsonParse)((0, testing_1.getFileContent)(tree, packagePath));
|
34
34
|
const hasScss = packageFile.dependencies[`@testing/xplat-scss`];
|
35
35
|
expect(hasScss).toBeDefined();
|
36
36
|
}));
|
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', path_1.join(__dirname, '../../collection.json'));
|
6
|
+
const testRunner = new testing_1.SchematicTestRunner('@nstudio/web', (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
@@ -9,7 +9,7 @@ var XplatWebHelpers;
|
|
9
9
|
// nothing extra needed at moment
|
10
10
|
return (tree, context) => {
|
11
11
|
const dependencies = {};
|
12
|
-
dependencies[`@${xplat_utils_1.getNpmScope()}/xplat-scss`] = 'file:libs/xplat/scss/src';
|
12
|
+
dependencies[`@${(0, xplat_utils_1.getNpmScope)()}/xplat-scss`] = 'file:libs/xplat/scss/src';
|
13
13
|
return xplat_1.XplatHelpers.updatePackageForXplat(options, {
|
14
14
|
dependencies,
|
15
15
|
})(tree, context);
|