@mutates/angular 0.3.0 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutates/angular",
3
- "version": "0.3.0",
3
+ "version": "1.0.0",
4
4
  "keywords": [
5
5
  "typescript",
6
6
  "ast",
@@ -18,7 +18,7 @@
18
18
  "main": "./src/index.js",
19
19
  "typings": "./src/index.d.ts",
20
20
  "dependencies": {
21
- "@mutates/core": "0.3.0",
21
+ "@mutates/core": "1.0.0",
22
22
  "multimatch": "^7.0.0",
23
23
  "ts-morph": "^22.0.0",
24
24
  "tslib": "^2.3.0"
@@ -1,4 +1 @@
1
- export * from './get-app-module';
2
1
  export * from './is-standalone';
3
- export * from './push-to-decorator-array-property';
4
- export * from './push-to-object-literal-array-property';
@@ -1,8 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./get-app-module"), exports);
5
4
  tslib_1.__exportStar(require("./is-standalone"), exports);
6
- tslib_1.__exportStar(require("./push-to-decorator-array-property"), exports);
7
- tslib_1.__exportStar(require("./push-to-object-literal-array-property"), exports);
8
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/helpers/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,0DAAgC;AAChC,6EAAmD;AACnD,kFAAwD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/helpers/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-app-module.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/module/get-app-module.ts"],"names":[],"mappings":";;;AAEA,4CAAoD;AAEpD,SAAgB,YAAY,CAAC,YAAoB;IAC/C,MAAM,WAAW,GAAG,IAAA,gCAAoB,EAAC,YAAY,CAAC,CAAC;IAEvD,MAAM,CAAC,oBAAoB,CAAC,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,EAAkB,CAAC;IAE3E,MAAM,CAAC,eAAe,CAAC,GAAG,oBAAoB,CAAC,kBAAkB,EAAwB,CAAC;IAE1F,OAAO,eAAe,CAAC;AACzB,CAAC;AARD,oCAQC"}
@@ -1 +1,2 @@
1
1
  export * from './get-ng-modules';
2
+ export * from './get-app-module';
@@ -2,4 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./get-ng-modules"), exports);
5
+ tslib_1.__exportStar(require("./get-app-module"), exports);
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/module/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/module/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,2DAAiC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-app-module.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/helpers/get-app-module.ts"],"names":[],"mappings":";;;AAEA,4CAAoD;AAEpD,SAAgB,YAAY,CAAC,YAAoB;IAC/C,MAAM,WAAW,GAAG,IAAA,gCAAoB,EAAC,YAAY,CAAC,CAAC;IAEvD,MAAM,CAAC,oBAAoB,CAAC,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,EAAkB,CAAC;IAE3E,MAAM,CAAC,eAAe,CAAC,GAAG,oBAAoB,CAAC,kBAAkB,EAAwB,CAAC;IAE1F,OAAO,eAAe,CAAC;AACzB,CAAC;AARD,oCAQC"}
@@ -1,5 +0,0 @@
1
- import type { ClassDeclaration } from 'ts-morph';
2
- export declare function pushToDecoratorArrayProperty(classDeclaration: ClassDeclaration, decoratorName: string, propertyName: string, initializer: string, { unique, forceToArray }?: {
3
- unique?: boolean;
4
- forceToArray?: boolean;
5
- }): void;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pushToDecoratorArrayProperty = void 0;
4
- const ts_morph_1 = require("ts-morph");
5
- const core_1 = require("@mutates/core");
6
- const push_to_object_literal_array_property_1 = require("./push-to-object-literal-array-property");
7
- // TODO: investigate how to handle consts in descriptors that don't accept array of array type, like styleUrls
8
- function pushToDecoratorArrayProperty(classDeclaration, decoratorName, propertyName, initializer, { unique = false, forceToArray = false } = {}) {
9
- const [decorator] = (0, core_1.getDecorators)(classDeclaration, {
10
- name: decoratorName,
11
- });
12
- const [metadata = decorator.addArgument(`{${propertyName}: []}`)] = decorator.getArguments();
13
- if (!ts_morph_1.Node.isObjectLiteralExpression(metadata)) {
14
- return;
15
- }
16
- (0, push_to_object_literal_array_property_1.pushToObjectLiteralArrayProperty)(metadata, propertyName, initializer, {
17
- unique,
18
- forceToArray,
19
- });
20
- }
21
- exports.pushToDecoratorArrayProperty = pushToDecoratorArrayProperty;
22
- //# sourceMappingURL=push-to-decorator-array-property.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"push-to-decorator-array-property.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/helpers/push-to-decorator-array-property.ts"],"names":[],"mappings":";;;AACA,uCAAgC;AAEhC,wCAA8C;AAE9C,mGAA2F;AAE3F,8GAA8G;AAC9G,SAAgB,4BAA4B,CAC1C,gBAAkC,EAClC,aAAqB,EACrB,YAAoB,EACpB,WAAmB,EACnB,EAAE,MAAM,GAAG,KAAK,EAAE,YAAY,GAAG,KAAK,KAAmD,EAAE;IAE3F,MAAM,CAAC,SAAS,CAAC,GAAG,IAAA,oBAAa,EAAC,gBAAgB,EAAE;QAClD,IAAI,EAAE,aAAa;KACpB,CAAC,CAAC;IAEH,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,WAAW,CAAC,IAAI,YAAY,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC;IAE7F,IAAI,CAAC,eAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9C,OAAO;IACT,CAAC;IAED,IAAA,wEAAgC,EAAC,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE;QACpE,MAAM;QACN,YAAY;KACb,CAAC,CAAC;AACL,CAAC;AArBD,oEAqBC"}
@@ -1,5 +0,0 @@
1
- import type { ObjectLiteralExpression } from 'ts-morph';
2
- export declare function pushToObjectLiteralArrayProperty(objectLiteral: ObjectLiteralExpression, propertyName: string, initializer: string, { unique, forceToArray }?: {
3
- unique?: boolean;
4
- forceToArray?: boolean;
5
- }): void;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pushToObjectLiteralArrayProperty = void 0;
4
- const ts_morph_1 = require("ts-morph");
5
- function pushToObjectLiteralArrayProperty(objectLiteral, propertyName, initializer, { unique = false, forceToArray = false } = {}) {
6
- var _a;
7
- const property = (_a = objectLiteral.getProperty(propertyName)) !== null && _a !== void 0 ? _a : objectLiteral.addProperty(`${propertyName}: []`);
8
- if (!ts_morph_1.Node.isPropertyAssignment(property)) {
9
- return;
10
- }
11
- if (forceToArray && !ts_morph_1.Node.isArrayLiteralExpression(property.getInitializer())) {
12
- property.setInitializer(`[${property.getInitializer().getText()}]`);
13
- }
14
- const importsInitializer = property.getInitializer();
15
- if (!ts_morph_1.Node.isArrayLiteralExpression(importsInitializer)) {
16
- return;
17
- }
18
- if (unique &&
19
- importsInitializer.getElements().some((element) => element.getText() === initializer)) {
20
- return;
21
- }
22
- importsInitializer.addElement(initializer);
23
- }
24
- exports.pushToObjectLiteralArrayProperty = pushToObjectLiteralArrayProperty;
25
- //# sourceMappingURL=push-to-object-literal-array-property.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"push-to-object-literal-array-property.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/lib/helpers/push-to-object-literal-array-property.ts"],"names":[],"mappings":";;;AACA,uCAAgC;AAEhC,SAAgB,gCAAgC,CAC9C,aAAsC,EACtC,YAAoB,EACpB,WAAmB,EACnB,EAAE,MAAM,GAAG,KAAK,EAAE,YAAY,GAAG,KAAK,KAAmD,EAAE;;IAE3F,MAAM,QAAQ,GACZ,MAAA,aAAa,CAAC,WAAW,CAAC,YAAY,CAAC,mCAAI,aAAa,CAAC,WAAW,CAAC,GAAG,YAAY,MAAM,CAAC,CAAC;IAE9F,IAAI,CAAC,eAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzC,OAAO;IACT,CAAC;IAED,IAAI,YAAY,IAAI,CAAC,eAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,EAAE,CAAC;QAC9E,QAAQ,CAAC,cAAc,CAAC,IAAI,QAAQ,CAAC,cAAc,EAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACvE,CAAC;IAED,MAAM,kBAAkB,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IAErD,IAAI,CAAC,eAAI,CAAC,wBAAwB,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACvD,OAAO;IACT,CAAC;IAED,IACE,MAAM;QACN,kBAAkB,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,WAAW,CAAC,EACrF,CAAC;QACD,OAAO;IACT,CAAC;IAED,kBAAkB,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAC7C,CAAC;AA/BD,4EA+BC"}
File without changes
File without changes