@rxap/plugin-utilities 16.1.0-dev.16 → 16.1.0-dev.18
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/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/package.json +8 -8
- package/src/index.d.ts +8 -7
- package/src/index.js +10 -7
- package/src/index.js.map +1 -1
- package/src/lib/project-source-root-files.d.ts +3 -0
- package/src/lib/project-source-root-files.js +25 -0
- package/src/lib/project-source-root-files.js.map +1 -0
- package/src/lib/project.d.ts +1 -1
- package/src/lib/project.js +3 -1
- package/src/lib/project.js.map +1 -1
- package/src/lib/skip-non-generators-project.js +2 -2
- package/src/lib/skip-non-generators-project.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [16.1.0-dev.18](https://gitlab.com/rxap/packages/compare/@rxap/plugin-utilities@16.1.0-dev.17...@rxap/plugin-utilities@16.1.0-dev.18) (2023-10-02)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- introduce Is\*Project functions ([0f4a53a](https://gitlab.com/rxap/packages/commit/0f4a53a2a68c7f854d819c005a30957d8b1cb3c6))
|
|
11
|
+
|
|
12
|
+
# [16.1.0-dev.17](https://gitlab.com/rxap/packages/compare/@rxap/plugin-utilities@16.1.0-dev.16...@rxap/plugin-utilities@16.1.0-dev.17) (2023-10-02)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- if project source root is not defined use the project joined with src ([198eef9](https://gitlab.com/rxap/packages/commit/198eef996f2c5c640da453417dadea338a13198b))
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- add ProjectSourceRoot files utility functions ([49213ae](https://gitlab.com/rxap/packages/commit/49213aea481555b77536fe598987fb92a8754d76))
|
|
21
|
+
|
|
6
22
|
# [16.1.0-dev.16](https://gitlab.com/rxap/packages/compare/@rxap/plugin-utilities@16.1.0-dev.15...@rxap/plugin-utilities@16.1.0-dev.16) (2023-09-27)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @rxap/plugin-utilities
|
package/README.md
CHANGED
|
@@ -17,5 +17,5 @@ yarn add @rxap/plugin-utilities
|
|
|
17
17
|
```
|
|
18
18
|
**Install peer dependencies:**
|
|
19
19
|
```bash
|
|
20
|
-
yarn add @nx/devkit@^16.5.0 @rxap/generator-utilities@^1.1.0-dev.
|
|
20
|
+
yarn add @nx/devkit@^16.5.0 @rxap/generator-utilities@^1.1.0-dev.16 @rxap/node-utilities@^1.1.0-dev.13 @rxap/workspace-utilities@^0.1.0-dev.19 tslib@2.6.2
|
|
21
21
|
```
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "16.1.0-dev.
|
|
2
|
+
"version": "16.1.0-dev.18",
|
|
3
3
|
"name": "@rxap/plugin-utilities",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"dependencies": {
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|
|
12
12
|
"@nx/devkit": "^16.5.0",
|
|
13
|
-
"@rxap/generator-utilities": "^1.1.0-dev.
|
|
14
|
-
"@rxap/node-utilities": "^1.1.0-dev.
|
|
15
|
-
"@rxap/workspace-utilities": "^0.1.0-dev.
|
|
13
|
+
"@rxap/generator-utilities": "^1.1.0-dev.16",
|
|
14
|
+
"@rxap/node-utilities": "^1.1.0-dev.13",
|
|
15
|
+
"@rxap/workspace-utilities": "^0.1.0-dev.19",
|
|
16
16
|
"tslib": "2.6.2",
|
|
17
17
|
"@rxap/utilities": "16.0.0-dev.19"
|
|
18
18
|
},
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"packageGroup": [
|
|
37
37
|
{
|
|
38
38
|
"package": "@rxap/generator-utilities",
|
|
39
|
-
"version": "1.1.0-dev.
|
|
39
|
+
"version": "1.1.0-dev.16"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"package": "@rxap/node-utilities",
|
|
43
|
-
"version": "1.1.0-dev.
|
|
43
|
+
"version": "1.1.0-dev.13"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"package": "@rxap/workspace-utilities",
|
|
47
|
-
"version": "0.1.0-dev.
|
|
47
|
+
"version": "0.1.0-dev.19"
|
|
48
48
|
}
|
|
49
49
|
]
|
|
50
50
|
},
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"directory": "packages/plugin/utilities"
|
|
59
59
|
},
|
|
60
60
|
"type": "commonjs",
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "c7b46326beb6e27752ac60aa1cf79fa048cc1e2d",
|
|
62
62
|
"main": "./src/index.js",
|
|
63
63
|
"types": "./src/index.d.ts"
|
|
64
64
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export * from './lib/
|
|
1
|
+
export * from './lib/generators';
|
|
2
2
|
export * from './lib/get-all-package-dependencies-for-project';
|
|
3
|
-
export * from './lib/
|
|
4
|
-
export * from './lib/project';
|
|
5
|
-
export * from './lib/project-root-files';
|
|
3
|
+
export * from './lib/get-direct-package-dependencies-for-project';
|
|
6
4
|
export * from './lib/get-target-configuration-name-list';
|
|
7
5
|
export * from './lib/guess-output-path';
|
|
8
|
-
export * from './lib/
|
|
9
|
-
export * from './lib/project-target';
|
|
6
|
+
export * from './lib/project-package-json';
|
|
10
7
|
export * from './lib/project-package-name-mapping';
|
|
8
|
+
export * from './lib/project-root-files';
|
|
9
|
+
export * from './lib/project-source-root-files';
|
|
10
|
+
export * from './lib/project-target';
|
|
11
|
+
export * from './lib/project';
|
|
11
12
|
export * from './lib/skip-non-generators-project';
|
|
12
|
-
export * from './lib/
|
|
13
|
+
export * from './lib/yarn-run';
|
package/src/index.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
|
|
4
|
+
// region
|
|
5
|
+
tslib_1.__exportStar(require("./lib/generators"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./lib/get-all-package-dependencies-for-project"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./lib/
|
|
7
|
-
tslib_1.__exportStar(require("./lib/project"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./lib/project-root-files"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./lib/get-direct-package-dependencies-for-project"), exports);
|
|
9
8
|
tslib_1.__exportStar(require("./lib/get-target-configuration-name-list"), exports);
|
|
10
9
|
tslib_1.__exportStar(require("./lib/guess-output-path"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./lib/
|
|
12
|
-
tslib_1.__exportStar(require("./lib/project-target"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./lib/project-package-json"), exports);
|
|
13
11
|
tslib_1.__exportStar(require("./lib/project-package-name-mapping"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./lib/project-root-files"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./lib/project-source-root-files"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./lib/project-target"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./lib/project"), exports);
|
|
14
16
|
tslib_1.__exportStar(require("./lib/skip-non-generators-project"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./lib/
|
|
17
|
+
tslib_1.__exportStar(require("./lib/yarn-run"), exports);
|
|
18
|
+
// endregion
|
|
16
19
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/plugin/utilities/src/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/plugin/utilities/src/index.ts"],"names":[],"mappings":";;;AAAA,UAAU;AACV,2DAAiC;AACjC,yFAA+D;AAC/D,4FAAkE;AAClE,mFAAyD;AACzD,kEAAwC;AACxC,qEAA2C;AAC3C,6EAAmD;AACnD,mEAAyC;AACzC,0EAAgD;AAChD,+DAAqC;AACrC,wDAA8B;AAC9B,4EAAkD;AAClD,yDAA+B;AAC/B,YAAY"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
export declare function ReadFileFromProjectSourceRoot(context: ExecutorContext, fileName: string, requiredOrDefaultContent?: string | true): string;
|
|
3
|
+
export declare function WriteFileToProjectSourceRoot(context: ExecutorContext, fileName: string, content: string): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WriteFileToProjectSourceRoot = exports.ReadFileFromProjectSourceRoot = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const project_1 = require("./project");
|
|
7
|
+
function ReadFileFromProjectSourceRoot(context, fileName, requiredOrDefaultContent = '') {
|
|
8
|
+
const projectSourceRoot = (0, project_1.GetProjectSourceRoot)(context);
|
|
9
|
+
const filePath = (0, path_1.join)(context.root, projectSourceRoot, fileName);
|
|
10
|
+
if (!(0, fs_1.existsSync)(filePath)) {
|
|
11
|
+
if (requiredOrDefaultContent === true) {
|
|
12
|
+
throw new Error(`The file ${filePath} not exists!`);
|
|
13
|
+
}
|
|
14
|
+
return requiredOrDefaultContent;
|
|
15
|
+
}
|
|
16
|
+
return (0, fs_1.readFileSync)(filePath, 'utf-8');
|
|
17
|
+
}
|
|
18
|
+
exports.ReadFileFromProjectSourceRoot = ReadFileFromProjectSourceRoot;
|
|
19
|
+
function WriteFileToProjectSourceRoot(context, fileName, content) {
|
|
20
|
+
const projectSourceRoot = (0, project_1.GetProjectSourceRoot)(context);
|
|
21
|
+
const filePath = (0, path_1.join)(context.root, projectSourceRoot, fileName);
|
|
22
|
+
(0, fs_1.writeFileSync)(filePath, content);
|
|
23
|
+
}
|
|
24
|
+
exports.WriteFileToProjectSourceRoot = WriteFileToProjectSourceRoot;
|
|
25
|
+
//# sourceMappingURL=project-source-root-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-source-root-files.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/project-source-root-files.ts"],"names":[],"mappings":";;;AACA,2BAIY;AACZ,+BAA4B;AAC5B,uCAAiD;AAEjD,SAAgB,6BAA6B,CAC3C,OAAwB,EACxB,QAAgB,EAChB,2BAA0C,EAAE;IAE5C,MAAM,iBAAiB,GAAG,IAAA,8BAAoB,EAAC,OAAO,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IACjE,IAAI,CAAC,IAAA,eAAU,EAAC,QAAQ,CAAC,EAAE;QACzB,IAAI,wBAAwB,KAAK,IAAI,EAAE;YACrC,MAAM,IAAI,KAAK,CAAC,YAAa,QAAS,cAAc,CAAC,CAAC;SACvD;QACD,OAAO,wBAAwB,CAAC;KACjC;IACD,OAAO,IAAA,iBAAY,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAdD,sEAcC;AAED,SAAgB,4BAA4B,CAAC,OAAwB,EAAE,QAAgB,EAAE,OAAe;IACtG,MAAM,iBAAiB,GAAG,IAAA,8BAAoB,EAAC,OAAO,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IACjE,IAAA,kBAAa,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC;AAJD,oEAIC"}
|
package/src/lib/project.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ExecutorContext } from '@nx/devkit';
|
|
2
2
|
export declare function GetProjectConfiguration(context: ExecutorContext, projectName?: string | undefined): import("@nx/devkit").ProjectConfiguration;
|
|
3
3
|
export declare function GetProjectRoot(context: ExecutorContext, projectName?: string | undefined): string;
|
|
4
|
-
export declare function GetProjectSourceRoot(context: ExecutorContext, projectName?: string | undefined): string
|
|
4
|
+
export declare function GetProjectSourceRoot(context: ExecutorContext, projectName?: string | undefined): string;
|
package/src/lib/project.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetProjectSourceRoot = exports.GetProjectRoot = exports.GetProjectConfiguration = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
4
5
|
function GetProjectConfiguration(context, projectName = context.projectName) {
|
|
5
6
|
const { projectsConfigurations } = context;
|
|
6
7
|
if (!projectsConfigurations) {
|
|
@@ -22,8 +23,9 @@ function GetProjectRoot(context, projectName = context.projectName) {
|
|
|
22
23
|
}
|
|
23
24
|
exports.GetProjectRoot = GetProjectRoot;
|
|
24
25
|
function GetProjectSourceRoot(context, projectName = context.projectName) {
|
|
26
|
+
var _a;
|
|
25
27
|
const projectConfiguration = GetProjectConfiguration(context, projectName);
|
|
26
|
-
return projectConfiguration.sourceRoot;
|
|
28
|
+
return (_a = projectConfiguration.sourceRoot) !== null && _a !== void 0 ? _a : (0, path_1.join)(projectConfiguration.root, 'src');
|
|
27
29
|
}
|
|
28
30
|
exports.GetProjectSourceRoot = GetProjectSourceRoot;
|
|
29
31
|
//# sourceMappingURL=project.js.map
|
package/src/lib/project.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/project.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/project.ts"],"names":[],"mappings":";;;AACA,+BAA4B;AAE5B,SAAgB,uBAAuB,CAAC,OAAwB,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW;IACjG,MAAM,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC;IAE3C,IAAI,CAAC,sBAAsB,EAAE;QAC3B,MAAM,IAAI,KAAK,CACb,iHAAiH,CAAC,CAAC;KACtH;IAED,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,2FAA2F,CAAC,CAAC;KAC9G;IAED,MAAM,oBAAoB,GAAG,sBAAsB,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAE1E,IAAI,CAAC,oBAAoB,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,0CAA2C,WAAY,cAAc,CAAC,CAAC;KACxF;IAED,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAnBD,0DAmBC;AAED,SAAgB,cAAc,CAAC,OAAwB,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW;IACxF,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3E,OAAO,oBAAoB,CAAC,IAAI,CAAC;AACnC,CAAC;AAHD,wCAGC;AAED,SAAgB,oBAAoB,CAAC,OAAwB,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW;;IAC9F,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3E,OAAO,MAAA,oBAAoB,CAAC,UAAU,mCAAI,IAAA,WAAI,EAAC,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACnF,CAAC;AAHD,oDAGC"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SkipNonGeneratorsProject = void 0;
|
|
4
4
|
const generator_utilities_1 = require("@rxap/generator-utilities");
|
|
5
|
+
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
5
6
|
const generators_1 = require("./generators");
|
|
6
7
|
function SkipNonGeneratorsProject(tree, options, project, projectName) {
|
|
7
|
-
var _a;
|
|
8
8
|
if ((0, generator_utilities_1.SkipProject)(tree, options, project, projectName)) {
|
|
9
9
|
return true;
|
|
10
10
|
}
|
|
11
|
-
if (!(
|
|
11
|
+
if (!(0, workspace_utilities_1.IsPluginProject)(project)) {
|
|
12
12
|
return true;
|
|
13
13
|
}
|
|
14
14
|
if (!(0, generators_1.HasGenerators)(tree, project)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skip-non-generators-project.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/skip-non-generators-project.ts"],"names":[],"mappings":";;;AAIA,mEAGmC;AACnC,6CAA6C;AAE7C,SAAgB,wBAAwB,CACtC,IAAU,EACV,OAA2B,EAC3B,OAA6B,EAC7B,WAAmB
|
|
1
|
+
{"version":3,"file":"skip-non-generators-project.js","sourceRoot":"","sources":["../../../../../../packages/plugin/utilities/src/lib/skip-non-generators-project.ts"],"names":[],"mappings":";;;AAIA,mEAGmC;AACnC,mEAA4D;AAC5D,6CAA6C;AAE7C,SAAgB,wBAAwB,CACtC,IAAU,EACV,OAA2B,EAC3B,OAA6B,EAC7B,WAAmB;IAEnB,IAAI,IAAA,iCAAW,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;QACpD,OAAO,IAAI,CAAC;KACb;IACD,IAAI,CAAC,IAAA,qCAAe,EAAC,OAAO,CAAC,EAAE;QAC7B,OAAO,IAAI,CAAC;KACb;IACD,IAAI,CAAC,IAAA,0BAAa,EAAC,IAAI,EAAE,OAAO,CAAC,EAAE;QACjC,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAjBD,4DAiBC"}
|