@nx/dotnet 0.0.0-pr-32869-39cffae → 0.0.1

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.
Files changed (61) hide show
  1. package/dist/package.json +84 -0
  2. package/dist/plugin.d.ts +1 -1
  3. package/dist/plugin.d.ts.map +1 -1
  4. package/dist/plugin.js +1 -1
  5. package/dist/src/index.d.ts.map +1 -0
  6. package/dist/src/plugins/plugin.d.ts.map +1 -0
  7. package/dist/src/utils/cache.d.ts.map +1 -0
  8. package/dist/src/utils/dependency-detection.d.ts.map +1 -0
  9. package/dist/src/utils/dotnet-cli.d.ts.map +1 -0
  10. package/dist/src/utils/dotnet-project-parser.d.ts.map +1 -0
  11. package/dist/src/utils/logger.d.ts.map +1 -0
  12. package/dist/{utils → src/utils}/target-builder.d.ts +2 -2
  13. package/dist/src/utils/target-builder.d.ts.map +1 -0
  14. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  15. package/package.json +64 -51
  16. package/plugin.ts +5 -0
  17. package/src/index.ts +6 -0
  18. package/src/plugins/plugin.ts +230 -0
  19. package/src/utils/cache.ts +19 -0
  20. package/src/utils/dependency-detection.ts +84 -0
  21. package/src/utils/dotnet-cli.ts +52 -0
  22. package/src/utils/dotnet-project-parser.ts +105 -0
  23. package/src/utils/logger.ts +24 -0
  24. package/src/utils/target-builder.ts +657 -0
  25. package/tsconfig.json +16 -0
  26. package/tsconfig.lib.json +21 -0
  27. package/README.md__tmpl__ +0 -7
  28. package/dist/generators/init/init.d.ts +0 -6
  29. package/dist/generators/init/init.d.ts.map +0 -1
  30. package/dist/generators/init/init.js +0 -59
  31. package/dist/generators/init/schema.json +0 -34
  32. package/dist/index.d.ts.map +0 -1
  33. package/dist/plugins/plugin.d.ts.map +0 -1
  34. package/dist/utils/cache.d.ts.map +0 -1
  35. package/dist/utils/dependency-detection.d.ts.map +0 -1
  36. package/dist/utils/dotnet-cli.d.ts.map +0 -1
  37. package/dist/utils/dotnet-project-parser.d.ts.map +0 -1
  38. package/dist/utils/has-dotnet-plugin.d.ts +0 -3
  39. package/dist/utils/has-dotnet-plugin.d.ts.map +0 -1
  40. package/dist/utils/has-dotnet-plugin.js +0 -8
  41. package/dist/utils/logger.d.ts.map +0 -1
  42. package/dist/utils/target-builder.d.ts.map +0 -1
  43. package/dist/utils/versions.d.ts +0 -2
  44. package/dist/utils/versions.d.ts.map +0 -1
  45. package/dist/utils/versions.js +0 -5
  46. package/generators.json +0 -10
  47. /package/dist/{index.d.ts → src/index.d.ts} +0 -0
  48. /package/dist/{index.js → src/index.js} +0 -0
  49. /package/dist/{plugins → src/plugins}/plugin.d.ts +0 -0
  50. /package/dist/{plugins → src/plugins}/plugin.js +0 -0
  51. /package/dist/{utils → src/utils}/cache.d.ts +0 -0
  52. /package/dist/{utils → src/utils}/cache.js +0 -0
  53. /package/dist/{utils → src/utils}/dependency-detection.d.ts +0 -0
  54. /package/dist/{utils → src/utils}/dependency-detection.js +0 -0
  55. /package/dist/{utils → src/utils}/dotnet-cli.d.ts +0 -0
  56. /package/dist/{utils → src/utils}/dotnet-cli.js +0 -0
  57. /package/dist/{utils → src/utils}/dotnet-project-parser.d.ts +0 -0
  58. /package/dist/{utils → src/utils}/dotnet-project-parser.js +0 -0
  59. /package/dist/{utils → src/utils}/logger.d.ts +0 -0
  60. /package/dist/{utils → src/utils}/logger.js +0 -0
  61. /package/dist/{utils → src/utils}/target-builder.js +0 -0
@@ -1,59 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initGenerator = initGenerator;
4
- exports.updateNxJsonConfiguration = updateNxJsonConfiguration;
5
- const devkit_1 = require("@nx/devkit");
6
- const versions_1 = require("../../utils/versions");
7
- const has_dotnet_plugin_1 = require("../../utils/has-dotnet-plugin");
8
- async function initGenerator(tree, options) {
9
- const tasks = [];
10
- if (!options.skipPackageJson && tree.exists('package.json')) {
11
- tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
12
- '@nx/dotnet': versions_1.nxVersion,
13
- }, undefined, options.keepExistingVersions));
14
- }
15
- addPlugin(tree);
16
- updateNxJsonConfiguration(tree);
17
- if (!options.skipFormat) {
18
- await (0, devkit_1.formatFiles)(tree);
19
- }
20
- return (0, devkit_1.runTasksInSerial)(...tasks);
21
- }
22
- function addPlugin(tree) {
23
- const nxJson = (0, devkit_1.readNxJson)(tree);
24
- if (!(0, has_dotnet_plugin_1.hasDotNetPlugin)(tree)) {
25
- nxJson.plugins ??= [];
26
- nxJson.plugins.push({
27
- plugin: '@nx/dotnet',
28
- options: {
29
- buildTargetName: 'build',
30
- testTargetName: 'test',
31
- cleanTargetName: 'clean',
32
- restoreTargetName: 'restore',
33
- publishTargetName: 'publish',
34
- packTargetName: 'pack',
35
- },
36
- });
37
- (0, devkit_1.updateNxJson)(tree, nxJson);
38
- }
39
- }
40
- function updateNxJsonConfiguration(tree) {
41
- const nxJson = (0, devkit_1.readNxJson)(tree);
42
- if (!nxJson.namedInputs) {
43
- nxJson.namedInputs = {};
44
- }
45
- // Default inputs include all project files
46
- const defaultFilesSet = nxJson.namedInputs.default ?? [];
47
- nxJson.namedInputs.default = Array.from(new Set([...defaultFilesSet, '{projectRoot}/**/*']));
48
- // Production inputs exclude test files and build outputs
49
- const productionFileSet = nxJson.namedInputs.production ?? [];
50
- nxJson.namedInputs.production = Array.from(new Set([
51
- ...productionFileSet,
52
- 'default',
53
- '!{projectRoot}/**/*.Tests/**/*',
54
- '!{projectRoot}/**/bin/**/*',
55
- '!{projectRoot}/**/obj/**/*',
56
- ]));
57
- (0, devkit_1.updateNxJson)(tree, nxJson);
58
- }
59
- exports.default = initGenerator;
@@ -1,34 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/schema",
3
- "$id": "NxDotNetInitSchema",
4
- "title": ".NET Init Generator",
5
- "description": "Initializes a .NET project in the current workspace.",
6
- "type": "object",
7
- "properties": {
8
- "skipFormat": {
9
- "description": "Skip formatting files.",
10
- "type": "boolean",
11
- "default": false,
12
- "x-priority": "internal"
13
- },
14
- "skipPackageJson": {
15
- "type": "boolean",
16
- "default": false,
17
- "description": "Do not add dependencies to `package.json`.",
18
- "x-priority": "internal"
19
- },
20
- "keepExistingVersions": {
21
- "type": "boolean",
22
- "x-priority": "internal",
23
- "description": "Keep existing dependencies versions",
24
- "default": false
25
- },
26
- "updatePackageScripts": {
27
- "type": "boolean",
28
- "x-priority": "internal",
29
- "description": "Update `package.json` scripts with inferred targets",
30
- "default": false
31
- }
32
- },
33
- "required": []
34
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,aAAa,EACb,kBAAkB,EAKnB,MAAM,YAAY,CAAC;AAoBpB,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAID,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAiD5D,CAAC;AAuDF,eAAO,MAAM,kBAAkB,EAAE,kBAAkB,CACjD,mBAAmB,CAmFpB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/utils/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAA+B,MAAM,YAAY,CAAC;AAG/E,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC;AAE/E,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,GAChB,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAI/B;AAED,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,QAGvC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dependency-detection.d.ts","sourceRoot":"","sources":["../../src/utils/dependency-detection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAiB,MAAM,YAAY,CAAC;AAGjE,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC7C,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWxB;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,MAAM,GAAG,SAAS,CAwBpB;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,aAAa,EAAE,MAAM,GACpB,MAAM,GAAG,SAAS,CA8BpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dotnet-cli.d.ts","sourceRoot":"","sources":["../../src/utils/dotnet-cli.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACnE;AAED,qBAAa,kBAAmB,YAAW,YAAY;IACzC,OAAO,CAAC,aAAa;gBAAb,aAAa,EAAE,MAAM;IAEnC,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAyCxE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dotnet-project-parser.d.ts","sourceRoot":"","sources":["../../src/utils/dotnet-project-parser.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,QAAQ,GAAG,QAAQ,GAAG,IAAI,CAAC;CACzC;AAED,wBAAgB,gBAAgB,CAAC,eAAe,EAAE,MAAM,GAAG,WAAW,CAmErE;AAED,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAU/D;AAED,wBAAgB,0BAA0B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAU1E"}
@@ -1,3 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export declare function hasDotNetPlugin(tree: Tree): boolean;
3
- //# sourceMappingURL=has-dotnet-plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"has-dotnet-plugin.d.ts","sourceRoot":"","sources":["../../src/utils/has-dotnet-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,IAAI,EAAE,MAAM,YAAY,CAAC;AAE9C,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAKnD"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasDotNetPlugin = hasDotNetPlugin;
4
- const devkit_1 = require("@nx/devkit");
5
- function hasDotNetPlugin(tree) {
6
- const nxJson = (0, devkit_1.readNxJson)(tree);
7
- return !!nxJson.plugins?.some((p) => typeof p === 'string' ? p === '@nx/dotnet' : p.plugin === '@nx/dotnet');
8
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAaA,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAIhD;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAIlD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"target-builder.d.ts","sourceRoot":"","sources":["../../src/utils/target-builder.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EAGrB,MAAM,YAAY,CAAC;AAOpB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;CACxB;AASD,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EAAE,EACtB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,aAAa,CAAC,CAyHxB"}
@@ -1,2 +0,0 @@
1
- export declare const nxVersion: any;
2
- //# sourceMappingURL=versions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../src/utils/versions.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,SAAS,KAAwC,CAAC"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.nxVersion = void 0;
4
- // eslint-disable-next-line @typescript-eslint/no-var-requires
5
- exports.nxVersion = require('../../package.json').version;
package/generators.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/nx/schemas/generators-schema.json",
3
- "generators": {
4
- "init": {
5
- "implementation": "./dist/generators/init/init",
6
- "schema": "./dist/generators/init/schema.json",
7
- "description": "Initialize .NET support in an Nx workspace"
8
- }
9
- }
10
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes