@trackunit/nx-utils 0.0.9 → 0.0.10
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 +2 -0
- package/package.json +1 -2
- package/src/index.js +0 -2
- package/src/index.js.map +1 -1
- package/src/ast/astUtils.d.ts +0 -17
- package/src/ast/astUtils.js +0 -78
- package/src/ast/astUtils.js.map +0 -1
- package/src/fileUpdater.d.ts +0 -8
- package/src/fileUpdater.js +0 -24
- package/src/fileUpdater.js.map +0 -1
- package/src/index.d.ts +0 -5
- package/src/nxTestUtils.d.ts +0 -7
- package/src/projectUtils.d.ts +0 -37
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.0.10](https://github.com/Trackunit/manager/compare/nx-utils/0.0.9...nx-utils/0.0.10) (2023-04-19)
|
|
6
|
+
|
|
5
7
|
## [0.0.9](https://github.com/Trackunit/manager/compare/nx-utils/0.0.8...nx-utils/0.0.9) (2023-04-19)
|
|
6
8
|
|
|
7
9
|
## [0.0.8](https://github.com/Trackunit/manager/compare/nx-utils/0.0.7...nx-utils/0.0.8) (2023-04-14)
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/nx-utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"repository": "https://github.com/Trackunit/manager",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@phenomnomnominal/tsquery": "4.2.0",
|
|
9
8
|
"tslib": "2.4.1"
|
|
10
9
|
},
|
|
11
10
|
"types": "./src/index.d.ts"
|
package/src/index.js
CHANGED
|
@@ -9,8 +9,6 @@ Object.defineProperty(exports, "readFile", { enumerable: true, get: function ()
|
|
|
9
9
|
Object.defineProperty(exports, "readJson", { enumerable: true, get: function () { return testing_1.readJson; } });
|
|
10
10
|
Object.defineProperty(exports, "uniq", { enumerable: true, get: function () { return testing_1.uniq; } });
|
|
11
11
|
Object.defineProperty(exports, "updateFile", { enumerable: true, get: function () { return testing_1.updateFile; } });
|
|
12
|
-
tslib_1.__exportStar(require("./ast/astUtils"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./fileUpdater"), exports);
|
|
14
12
|
tslib_1.__exportStar(require("./nxTestUtils"), exports);
|
|
15
13
|
tslib_1.__exportStar(require("./projectUtils"), exports);
|
|
16
14
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/nx/utils/src/index.ts"],"names":[],"mappings":";;;;AAAA,iDAAiD;AACjD,mDAAgG;AAAvF,0GAAA,eAAe,OAAA;AAAE,mGAAA,QAAQ,OAAA;AAAE,mGAAA,QAAQ,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAE,qGAAA,UAAU,OAAA;AAC9D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/nx/utils/src/index.ts"],"names":[],"mappings":";;;;AAAA,iDAAiD;AACjD,mDAAgG;AAAvF,0GAAA,eAAe,OAAA;AAAE,mGAAA,QAAQ,OAAA;AAAE,mGAAA,QAAQ,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAE,qGAAA,UAAU,OAAA;AAC9D,wDAA8B;AAC9B,yDAA+B","sourcesContent":["// eslint-disable-next-line no-restricted-imports\nexport { checkFilesExist, readFile, readJson, uniq, updateFile } from \"@nrwl/nx-plugin/testing\";\nexport * from \"./nxTestUtils\";\nexport * from \"./projectUtils\";\n"]}
|
package/src/ast/astUtils.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This function removes a property with a given name from an object literal
|
|
3
|
-
* provided as a text string.
|
|
4
|
-
*
|
|
5
|
-
* @param {string} fileContent The source code as text
|
|
6
|
-
* @param {string} propertyNames The properties to remove from the object
|
|
7
|
-
*/
|
|
8
|
-
export declare function removePropertyWithName(fileContent: string, ...propertyNames: string[]): string;
|
|
9
|
-
/**
|
|
10
|
-
* This function adds a new property with a given name and value to an object literal
|
|
11
|
-
* provided as a text string.
|
|
12
|
-
*
|
|
13
|
-
* @param {string} fileContent - the source code as text
|
|
14
|
-
* @param {string} propertyName - the name of the property to add
|
|
15
|
-
* @param {string | string[]} propertyValue - the value of the property to add
|
|
16
|
-
*/
|
|
17
|
-
export declare function addPropertyWithName(fileContent: string, propertyName: string, propertyValue: string | string[] | Record<string, string>): string;
|
package/src/ast/astUtils.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addPropertyWithName = exports.removePropertyWithName = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
6
|
-
const ts = tslib_1.__importStar(require("typescript"));
|
|
7
|
-
/**
|
|
8
|
-
* This function removes a property with a given name from an object literal
|
|
9
|
-
* provided as a text string.
|
|
10
|
-
*
|
|
11
|
-
* @param {string} fileContent The source code as text
|
|
12
|
-
* @param {string} propertyNames The properties to remove from the object
|
|
13
|
-
*/
|
|
14
|
-
function removePropertyWithName(fileContent, ...propertyNames) {
|
|
15
|
-
const sourceFile = tsquery_1.tsquery.ast(fileContent);
|
|
16
|
-
const updatedSourceFile = tsquery_1.tsquery.map(sourceFile, "ObjectLiteralExpression", node => {
|
|
17
|
-
if (ts.isObjectLiteralExpression(node)) {
|
|
18
|
-
// Filter out the given property
|
|
19
|
-
const updatedProperties = node.properties.filter(property => {
|
|
20
|
-
return !(ts.isPropertyAssignment(property) &&
|
|
21
|
-
ts.isIdentifier(property.name) &&
|
|
22
|
-
propertyNames.includes(property.name.text));
|
|
23
|
-
});
|
|
24
|
-
return ts.factory.createObjectLiteralExpression(updatedProperties, true);
|
|
25
|
-
}
|
|
26
|
-
return node;
|
|
27
|
-
});
|
|
28
|
-
return ts.createPrinter().printFile(updatedSourceFile);
|
|
29
|
-
}
|
|
30
|
-
exports.removePropertyWithName = removePropertyWithName;
|
|
31
|
-
/**
|
|
32
|
-
* This function adds a new property with a given name and value to an object literal
|
|
33
|
-
* provided as a text string.
|
|
34
|
-
*
|
|
35
|
-
* @param {string} fileContent - the source code as text
|
|
36
|
-
* @param {string} propertyName - the name of the property to add
|
|
37
|
-
* @param {string | string[]} propertyValue - the value of the property to add
|
|
38
|
-
*/
|
|
39
|
-
function addPropertyWithName(fileContent, propertyName, propertyValue) {
|
|
40
|
-
const sourceFile = tsquery_1.tsquery.ast(fileContent);
|
|
41
|
-
const updatedSourceFile = tsquery_1.tsquery.map(sourceFile, "ObjectLiteralExpression", node => {
|
|
42
|
-
if (ts.isObjectLiteralExpression(node)) {
|
|
43
|
-
// Add a new property to the object literal
|
|
44
|
-
let updatedProperties;
|
|
45
|
-
if (typeof propertyValue === "string") {
|
|
46
|
-
updatedProperties = [
|
|
47
|
-
...node.properties,
|
|
48
|
-
ts.factory.createPropertyAssignment(ts.factory.createIdentifier(propertyName), ts.factory.createStringLiteral(propertyValue)),
|
|
49
|
-
];
|
|
50
|
-
}
|
|
51
|
-
else if (Array.isArray(propertyValue)) {
|
|
52
|
-
const arrayLiteral = ts.factory.createArrayLiteralExpression(propertyValue.map(value => ts.factory.createStringLiteral(value)));
|
|
53
|
-
updatedProperties = [
|
|
54
|
-
...node.properties,
|
|
55
|
-
ts.factory.createPropertyAssignment(ts.factory.createIdentifier(propertyName), arrayLiteral),
|
|
56
|
-
];
|
|
57
|
-
}
|
|
58
|
-
else if (typeof propertyValue === "object") {
|
|
59
|
-
updatedProperties = [
|
|
60
|
-
...node.properties,
|
|
61
|
-
ts.factory.createPropertyAssignment(ts.factory.createIdentifier(propertyName), ts.factory.createObjectLiteralExpression(createObjectLiteralElementLike(propertyValue))),
|
|
62
|
-
];
|
|
63
|
-
}
|
|
64
|
-
return ts.factory.createObjectLiteralExpression(updatedProperties, true);
|
|
65
|
-
}
|
|
66
|
-
return node;
|
|
67
|
-
});
|
|
68
|
-
return ts.createPrinter().printFile(updatedSourceFile);
|
|
69
|
-
}
|
|
70
|
-
exports.addPropertyWithName = addPropertyWithName;
|
|
71
|
-
function createObjectLiteralElementLike(obj) {
|
|
72
|
-
const properties = [];
|
|
73
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
74
|
-
properties.push(ts.factory.createPropertyAssignment(ts.factory.createStringLiteral(key), ts.factory.createStringLiteral(value)));
|
|
75
|
-
}
|
|
76
|
-
return properties;
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=astUtils.js.map
|
package/src/ast/astUtils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"astUtils.js","sourceRoot":"","sources":["../../../../../../libs/nx/utils/src/ast/astUtils.ts"],"names":[],"mappings":"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","sourcesContent":["import { tsquery } from \"@phenomnomnominal/tsquery\";\nimport * as ts from \"typescript\";\n\n/**\n * This function removes a property with a given name from an object literal\n * provided as a text string.\n *\n * @param {string} fileContent The source code as text\n * @param {string} propertyNames The properties to remove from the object\n */\nexport function removePropertyWithName(fileContent: string, ...propertyNames: string[]) {\n const sourceFile = tsquery.ast(fileContent);\n const updatedSourceFile = tsquery.map(sourceFile, \"ObjectLiteralExpression\", node => {\n if (ts.isObjectLiteralExpression(node)) {\n // Filter out the given property\n const updatedProperties = node.properties.filter(property => {\n return !(\n ts.isPropertyAssignment(property) &&\n ts.isIdentifier(property.name) &&\n propertyNames.includes(property.name.text)\n );\n });\n return ts.factory.createObjectLiteralExpression(updatedProperties, true);\n }\n return node;\n });\n return ts.createPrinter().printFile(updatedSourceFile);\n}\n\n/**\n * This function adds a new property with a given name and value to an object literal\n * provided as a text string.\n *\n * @param {string} fileContent - the source code as text\n * @param {string} propertyName - the name of the property to add\n * @param {string | string[]} propertyValue - the value of the property to add\n */\nexport function addPropertyWithName(\n fileContent: string,\n propertyName: string,\n propertyValue: string | string[] | Record<string, string>\n) {\n const sourceFile = tsquery.ast(fileContent);\n const updatedSourceFile = tsquery.map(sourceFile, \"ObjectLiteralExpression\", node => {\n if (ts.isObjectLiteralExpression(node)) {\n // Add a new property to the object literal\n let updatedProperties;\n if (typeof propertyValue === \"string\") {\n updatedProperties = [\n ...node.properties,\n ts.factory.createPropertyAssignment(\n ts.factory.createIdentifier(propertyName),\n ts.factory.createStringLiteral(propertyValue)\n ),\n ];\n } else if (Array.isArray(propertyValue)) {\n const arrayLiteral = ts.factory.createArrayLiteralExpression(\n propertyValue.map(value => ts.factory.createStringLiteral(value))\n );\n updatedProperties = [\n ...node.properties,\n ts.factory.createPropertyAssignment(ts.factory.createIdentifier(propertyName), arrayLiteral),\n ];\n } else if (typeof propertyValue === \"object\") {\n updatedProperties = [\n ...node.properties,\n ts.factory.createPropertyAssignment(\n ts.factory.createIdentifier(propertyName),\n ts.factory.createObjectLiteralExpression(createObjectLiteralElementLike(propertyValue))\n ),\n ];\n }\n return ts.factory.createObjectLiteralExpression(updatedProperties, true);\n }\n return node;\n });\n return ts.createPrinter().printFile(updatedSourceFile);\n}\n\nfunction createObjectLiteralElementLike(obj: Record<string, string>): ts.ObjectLiteralElementLike[] {\n const properties: ts.ObjectLiteralElementLike[] = [];\n for (const [key, value] of Object.entries(obj)) {\n properties.push(\n ts.factory.createPropertyAssignment(ts.factory.createStringLiteral(key), ts.factory.createStringLiteral(value))\n );\n }\n return properties;\n}\n"]}
|
package/src/fileUpdater.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Tree } from "@nrwl/devkit";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param tree File system tree
|
|
5
|
-
* @param path Path to source file in the Tree
|
|
6
|
-
* @param updater Function that maps the current file content to a new to be written to the Tree
|
|
7
|
-
*/
|
|
8
|
-
export declare const updateFileInTree: (tree: Tree, path: string, updater: (fileContent: string) => string) => void;
|
package/src/fileUpdater.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateFileInTree = void 0;
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @param tree File system tree
|
|
7
|
-
* @param path Path to source file in the Tree
|
|
8
|
-
* @param updater Function that maps the current file content to a new to be written to the Tree
|
|
9
|
-
*/
|
|
10
|
-
const updateFileInTree = (tree, path, updater) => {
|
|
11
|
-
if (!tree.exists(path)) {
|
|
12
|
-
throw new Error("File not found: " + path);
|
|
13
|
-
}
|
|
14
|
-
const fileContent = tree.read(path, "utf-8");
|
|
15
|
-
if (!fileContent) {
|
|
16
|
-
throw new Error("File is empty: " + path);
|
|
17
|
-
}
|
|
18
|
-
const result = updater(fileContent);
|
|
19
|
-
if (result !== fileContent) {
|
|
20
|
-
tree.write(path, result);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
exports.updateFileInTree = updateFileInTree;
|
|
24
|
-
//# sourceMappingURL=fileUpdater.js.map
|
package/src/fileUpdater.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fileUpdater.js","sourceRoot":"","sources":["../../../../../libs/nx/utils/src/fileUpdater.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,CAAC,IAAU,EAAE,IAAY,EAAE,OAAwC,EAAE,EAAE;IACrG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;KAC5C;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7C,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;KAC3C;IACD,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEpC,IAAI,MAAM,KAAK,WAAW,EAAE;QAC1B,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KAC1B;AACH,CAAC,CAAC;AAdW,QAAA,gBAAgB,oBAc3B","sourcesContent":["import { Tree } from \"@nrwl/devkit\";\n\n/**\n *\n * @param tree File system tree\n * @param path Path to source file in the Tree\n * @param updater Function that maps the current file content to a new to be written to the Tree\n */\nexport const updateFileInTree = (tree: Tree, path: string, updater: (fileContent: string) => string) => {\n if (!tree.exists(path)) {\n throw new Error(\"File not found: \" + path);\n }\n\n const fileContent = tree.read(path, \"utf-8\");\n if (!fileContent) {\n throw new Error(\"File is empty: \" + path);\n }\n const result = updater(fileContent);\n\n if (result !== fileContent) {\n tree.write(path, result);\n }\n};\n"]}
|
package/src/index.d.ts
DELETED
package/src/nxTestUtils.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ensures that a project has been setup in the e2e directory
|
|
3
|
-
* It will also copy `@nrwl` packages to the e2e directory
|
|
4
|
-
* When yarn install works in nx-plugin we can replace this file.
|
|
5
|
-
* - https://github.com/nrwl/nx/issues/15263
|
|
6
|
-
*/
|
|
7
|
-
export declare const ensureNxProject: (npmPackageName: string, pluginDistPath: string) => void;
|
package/src/projectUtils.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
export interface ProjectDistPath {
|
|
3
|
-
package: string;
|
|
4
|
-
path: string;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Run a command asynchronously inside the e2e directory.
|
|
8
|
-
*
|
|
9
|
-
* @param command command to run
|
|
10
|
-
* @param projectName the name of the project in e2e directory
|
|
11
|
-
* @param opts options
|
|
12
|
-
*/
|
|
13
|
-
export declare function runCommandAsync(command: string, projectName: string, opts?: {
|
|
14
|
-
silenceError?: boolean;
|
|
15
|
-
env?: NodeJS.ProcessEnv;
|
|
16
|
-
}): Promise<{
|
|
17
|
-
stdout: string;
|
|
18
|
-
stderr: string;
|
|
19
|
-
}>;
|
|
20
|
-
/**
|
|
21
|
-
* Run a nx command asynchronously inside the e2e directory
|
|
22
|
-
*
|
|
23
|
-
* @param command command to run
|
|
24
|
-
* @param projectName the name of the project in e2e directory
|
|
25
|
-
* @param opts options
|
|
26
|
-
*/
|
|
27
|
-
export declare function runNxCommandAsync(command: string, projectName: string, opts?: {
|
|
28
|
-
silenceError?: boolean;
|
|
29
|
-
env?: NodeJS.ProcessEnv;
|
|
30
|
-
}): Promise<{
|
|
31
|
-
stdout: string;
|
|
32
|
-
stderr: string;
|
|
33
|
-
}>;
|
|
34
|
-
/**
|
|
35
|
-
* Ensure nx projects are in package.json in tmp nxRootDir
|
|
36
|
-
*/
|
|
37
|
-
export declare const ensureNxProjects: (dependencies: ProjectDistPath[], devDependencies: ProjectDistPath[], nxRootDir: string, packageManager?: string) => Promise<void>;
|