@nstudio/xplat-utils 12.6.0-rc.0 → 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 +5 -5
- package/package.json +1 -1
- package/src/utils/utils.d.ts +1 -0
- package/src/utils/utils.js +12 -5
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
package/src/utils/utils.d.ts
CHANGED
@@ -23,3 +23,4 @@ export declare function getAppPaths(tree: Tree, type?: PlatformTypes): Array<str
|
|
23
23
|
export declare function prerun(options?: any, init?: boolean): (tree: Tree) => import("@angular-devkit/schematics/src/tree/interface").Tree;
|
24
24
|
export declare function sanitizeCommaDelimitedArg(input: string): Array<string>;
|
25
25
|
export declare function parseProjectNameFromPath(input: string): string;
|
26
|
+
export declare function toFileName(s: string): string;
|
package/src/utils/utils.js
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.parseProjectNameFromPath = exports.sanitizeCommaDelimitedArg = exports.prerun = exports.getAppPaths = exports.getRootTsConfigPath = exports.copy = exports.getNxWorkspaceConfig = exports.updateFile = exports.updateJsonFile = exports.getJsonFromFile = exports.jsonParse = exports.isTesting = exports.setTest = exports.isXplatWorkspace = exports.getAppName = exports.getGroupByName = exports.getFrontendFramework = exports.getPrefix = exports.getNpmScope = exports.supportedFrameworks = exports.supportedPlatformsWithNx = exports.supportedNxExtraPlatforms = exports.supportedPlatforms = void 0;
|
3
|
+
exports.toFileName = exports.parseProjectNameFromPath = exports.sanitizeCommaDelimitedArg = exports.prerun = exports.getAppPaths = exports.getRootTsConfigPath = exports.copy = exports.getNxWorkspaceConfig = exports.updateFile = exports.updateJsonFile = exports.getJsonFromFile = exports.jsonParse = exports.isTesting = exports.setTest = exports.isXplatWorkspace = exports.getAppName = exports.getGroupByName = exports.getFrontendFramework = exports.getPrefix = exports.getNpmScope = exports.supportedFrameworks = exports.supportedPlatformsWithNx = exports.supportedNxExtraPlatforms = exports.supportedPlatforms = void 0;
|
4
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
6
|
-
const workspace_1 = require("@nrwl/workspace");
|
7
6
|
exports.supportedPlatforms = [
|
8
7
|
'web',
|
9
8
|
'nativescript',
|
@@ -64,7 +63,7 @@ exports.isTesting = isTesting;
|
|
64
63
|
function jsonParse(content) {
|
65
64
|
if (content) {
|
66
65
|
// ensure comments are stripped when parsing (otherwise will fail)
|
67
|
-
return devkit_1.parseJson(content);
|
66
|
+
return (0, devkit_1.parseJson)(content);
|
68
67
|
}
|
69
68
|
return {};
|
70
69
|
}
|
@@ -77,7 +76,7 @@ exports.getJsonFromFile = getJsonFromFile;
|
|
77
76
|
function updateJsonFile(tree, path, jsonData) {
|
78
77
|
try {
|
79
78
|
// if (tree.exists(path)) {
|
80
|
-
tree.overwrite(path,
|
79
|
+
tree.overwrite(path, (0, devkit_1.serializeJson)(jsonData));
|
81
80
|
// }
|
82
81
|
return tree;
|
83
82
|
}
|
@@ -133,7 +132,8 @@ function getAppPaths(tree, type // by default, will return all app paths (consid
|
|
133
132
|
// check for platform via it's package (web is only app type that doesn't have a package)
|
134
133
|
switch (type) {
|
135
134
|
case 'nativescript':
|
136
|
-
if (tree.exists(`${dirPath}/nativescript.config.ts`) ||
|
135
|
+
if (tree.exists(`${dirPath}/nativescript.config.ts`) ||
|
136
|
+
tree.exists(`${dirPath}/nsconfig.json`)) {
|
137
137
|
appPaths.push(dirPath);
|
138
138
|
}
|
139
139
|
break;
|
@@ -293,3 +293,10 @@ function parseProjectNameFromPath(input) {
|
|
293
293
|
return input;
|
294
294
|
}
|
295
295
|
exports.parseProjectNameFromPath = parseProjectNameFromPath;
|
296
|
+
function toFileName(s) {
|
297
|
+
return s
|
298
|
+
.replace(/([a-z\d])([A-Z])/g, '$1_$2')
|
299
|
+
.toLowerCase()
|
300
|
+
.replace(/[ _]/g, '-');
|
301
|
+
}
|
302
|
+
exports.toFileName = toFileName;
|