@o3r/schematics 10.1.0-prerelease.0 → 10.1.0-prerelease.10

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/schematics",
3
- "version": "10.1.0-prerelease.0",
3
+ "version": "10.1.0-prerelease.10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -30,7 +30,7 @@
30
30
  "@angular-devkit/core": "~17.2.0",
31
31
  "@angular-devkit/schematics": "~17.2.0",
32
32
  "@angular/cli": "~17.2.0",
33
- "@o3r/telemetry": "^10.1.0-prerelease.0",
33
+ "@o3r/telemetry": "^10.1.0-prerelease.10",
34
34
  "@schematics/angular": "~17.2.0",
35
35
  "eslint": "^8.42.0",
36
36
  "rxjs": "^7.8.1",
@@ -54,6 +54,7 @@
54
54
  "dependencies": {
55
55
  "chalk": "^4.1.2",
56
56
  "globby": "^11.1.0",
57
+ "inquirer": "~8.2.6",
57
58
  "minimatch": "~9.0.3",
58
59
  "semver": "^7.5.2",
59
60
  "tslib": "^2.5.3"
@@ -78,11 +79,12 @@
78
79
  "@nx/eslint-plugin": "~18.0.2",
79
80
  "@nx/jest": "~18.0.2",
80
81
  "@nx/js": "~18.0.2",
81
- "@o3r/build-helpers": "^10.1.0-prerelease.0",
82
- "@o3r/eslint-plugin": "^10.1.0-prerelease.0",
83
- "@o3r/telemetry": "^10.1.0-prerelease.0",
82
+ "@o3r/build-helpers": "^10.1.0-prerelease.10",
83
+ "@o3r/eslint-plugin": "^10.1.0-prerelease.10",
84
+ "@o3r/telemetry": "^10.1.0-prerelease.10",
84
85
  "@schematics/angular": "~17.2.0",
85
86
  "@stylistic/eslint-plugin-ts": "^1.5.4",
87
+ "@types/inquirer": "~8.2.10",
86
88
  "@types/jest": "~29.5.2",
87
89
  "@types/node": "^20.0.0",
88
90
  "@types/semver": "^7.3.13",
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"update-imports.d.ts","sourceRoot":"","sources":["../../../src/utility/update-imports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAavD,0DAA0D;AAC1D,MAAM,WAAW,cAAc;IAC7B,CAAC,WAAW,EAAE,MAAM,GAAG;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;CAC5F;AAGD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,OAAO,CAAC,SAAS,EACzB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,EAAE,CAAC,UAAU,EACzB,aAAa,EAAE,MAAM,EACrB,oBAAoB,EAAE,MAAM,EAC5B,UAAU,GAAE,cAAmB,EAC/B,eAAe,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,UAkG7C"}
1
+ {"version":3,"file":"update-imports.d.ts","sourceRoot":"","sources":["../../../src/utility/update-imports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAgBvD,0DAA0D;AAC1D,MAAM,WAAW,cAAc;IAC7B,CAAC,WAAW,EAAE,MAAM,GAAG;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;CAC5F;AAGD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,OAAO,CAAC,SAAS,EACzB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,EAAE,CAAC,UAAU,EACzB,aAAa,EAAE,MAAM,EACrB,oBAAoB,EAAE,MAAM,EAC5B,UAAU,GAAE,cAAmB,EAC/B,eAAe,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,UAoG7C"}
@@ -31,9 +31,10 @@ function updateImportsInFile(logger, tree, sourceFile, importsRegexp, renamePack
31
31
  // We store the import line to be able to remove it afterwards
32
32
  importNodes.push(imp);
33
33
  // We retrieve all the symbols listed in the import statement
34
- const namedImport = imp.importClause && imp.importClause.getChildAt(0);
34
+ const namedImport = imp.importClause?.namedBindings;
35
+ const isTypeOnlyImport = !!imp.importClause && ts.isTypeOnlyImportDeclaration(imp.importClause);
35
36
  const imports = namedImport && ts.isNamedImports(namedImport) ?
36
- namedImport.elements.map((element) => ({ symbol: element.getText(), location: importFrom })) :
37
+ namedImport.elements.map((element) => ({ symbol: element.getText(), isTypeOnlyImport, location: importFrom })) :
37
38
  [];
38
39
  // And associate them to the Otter package
39
40
  oldImportedSymbolsPerPackage[otterPackage].push(...imports);
@@ -62,7 +63,7 @@ function updateImportsInFile(logger, tree, sourceFile, importsRegexp, renamePack
62
63
  acc[importFrom] = [];
63
64
  }
64
65
  const newNameForExportedValue = mapImports[oldPackageName]?.[importSymbol.symbol]?.newValue;
65
- acc[importFrom].push(newNameForExportedValue || importSymbol.symbol);
66
+ acc[importFrom].push(`${importSymbol.isTypeOnlyImport ? 'type ' : ''}${newNameForExportedValue || importSymbol.symbol}`);
66
67
  });
67
68
  return acc;
68
69
  }, {});
@@ -1 +1 @@
1
- {"version":3,"file":"update-imports.js","sourceRoot":"","sources":["../../../src/utility/update-imports.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AAEjC,qEAAkE;AAoBlE;;;;;;;;;GASG;AACH,SAAgB,mBAAmB,CACjC,MAAyB,EACzB,IAAU,EACV,UAAyB,EACzB,aAAqB,EACrB,oBAA4B,EAC5B,aAA6B,EAAE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../src/utility/wrapper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AASvD;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,EAAE,gBAgEnD,CAAC"}
1
+ {"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../../src/utility/wrapper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAUvD;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,EAAE,gBAkEnD,CAAC"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createSchematicWithMetricsIfInstalled = void 0;
4
- const prompt_1 = require("@angular/cli/src/utilities/prompt");
5
4
  const dependencies_1 = require("@schematics/angular/utility/dependencies");
5
+ const inquirer_1 = require("inquirer");
6
6
  const node_fs_1 = require("node:fs");
7
7
  const path = require("node:path");
8
8
  const rxjs_1 = require("rxjs");
@@ -32,11 +32,16 @@ const createSchematicWithMetricsIfInstalled = (schematicFn) => (opts) => async (
32
32
  && context.interactive
33
33
  && packageJson.config?.o3rMetrics !== false) {
34
34
  context.logger.debug('`@o3r/telemetry` is not available.\nAsking to add the dependency\n' + e.toString());
35
- const isReplyPositive = await (0, prompt_1.askConfirmation)(`
35
+ const question = {
36
+ type: 'confirm',
37
+ name: 'isReplyPositive',
38
+ message: `
36
39
  Would you like to share anonymous data about the usage of Otter builders and schematics with the Otter Team at Amadeus ?
37
40
  It will help us to improve our tools.
38
41
  For more details and instructions on how to change these settings, see https://github.com/AmadeusITGroup/otter/blob/main/docs/telemetry/README.md.
39
- `, false);
42
+ `
43
+ };
44
+ const { isReplyPositive } = await (0, inquirer_1.prompt)([question]);
40
45
  if (isReplyPositive) {
41
46
  const version = JSON.parse((0, node_fs_1.readFileSync)(path.join(__dirname, '..', '..', 'package.json'), 'utf-8')).version;
42
47
  context.addTask(new index_1.NodePackage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