@rxap/plugin-n8n 20.0.2 → 20.1.0-dev.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.
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
+ # [20.1.0-dev.1](https://gitlab.com/rxap/packages/compare/@rxap/plugin-n8n@20.1.0-dev.0...@rxap/plugin-n8n@20.1.0-dev.1) (2025-02-17)
7
+
8
+ **Note:** Version bump only for package @rxap/plugin-n8n
9
+
10
+ # [20.1.0-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/plugin-n8n@20.0.2...@rxap/plugin-n8n@20.1.0-dev.0) (2025-02-17)
11
+
12
+ ### Bug Fixes
13
+
14
+ - add the office npm keyword ([49e0165](https://gitlab.com/rxap/packages/commit/49e01658bddd4cbf4fe42f9bb6c9f7a5e3b55051))
15
+ - only include nodes projects ([a298f8a](https://gitlab.com/rxap/packages/commit/a298f8acf0145c9634b793c785883e16f1d86f12))
16
+ - update the package json ([4316b0a](https://gitlab.com/rxap/packages/commit/4316b0a7a609f3cd5a2bf278d747e18eb8faa723))
17
+
18
+ ### Features
19
+
20
+ - add plugin ([ed0689e](https://gitlab.com/rxap/packages/commit/ed0689e90cb283e6501f05ee15ca7c5d0a3661f2))
21
+
6
22
  ## [20.0.2](https://gitlab.com/rxap/packages/compare/@rxap/plugin-n8n@20.0.1...@rxap/plugin-n8n@20.0.2) (2025-02-13)
7
23
 
8
24
  **Note:** Version bump only for package @rxap/plugin-n8n
package/GETSTARTED.md CHANGED
@@ -0,0 +1,25 @@
1
+ ## Create a new n8n package
2
+
3
+ **Create the publishable js library**
4
+ ```sh
5
+ nx g @nx/js:library \
6
+ --directory=packages/n8n/nodes/cqrs \
7
+ --importPath=@rxap/n8n-nodes-cqrs \
8
+ --linter=eslint \
9
+ --name=n8n-nodes-cqrs \
10
+ --useProjectJson=true
11
+ ```
12
+
13
+ **Init the n8n library**
14
+ ```sh
15
+ nx g @rxap/plugin-n8n:init --project n8n-nodes-cqrs
16
+ ```
17
+
18
+ **Add a new node to the library**
19
+ ```sh
20
+ nx g @rxap/plugin-n8n:node \
21
+ --name sanitizeHtml \
22
+ --description "" \
23
+ --project n8n-nodes-sanitize-html \
24
+ --nodeNamePrefix ""
25
+ ```
package/README.md CHANGED
@@ -1,60 +1,54 @@
1
- #
2
- @rxap/plugin-n8n
1
+ This package provides generators for initializing and creating n8n plugins within an Nx workspace. It includes generators for initializing a workspace or project for n8n development, as well as a generator for creating new n8n nodes. The package also includes utilities for updating project configurations and package.json files to support n8n plugin development.
3
2
 
4
3
  [![npm version](https://img.shields.io/npm/v/@rxap/plugin-n8n?style=flat-square)](https://www.npmjs.com/package/@rxap/plugin-n8n)
5
- [![commitizen
6
- friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](https://commitizen.github.io/cz-cli/)
7
- [![styled with
8
- prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
9
- ![Libraries.io dependency status for latest release, scoped npm
10
- package](https://img.shields.io/librariesio/release/npm/@rxap/plugin-n8n)
4
+ [![commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](https://commitizen.github.io/cz-cli/)
5
+ [![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
6
+ ![Libraries.io dependency status for latest release, scoped npm package](https://img.shields.io/librariesio/release/npm/@rxap/plugin-n8n)
11
7
  ![npm](https://img.shields.io/npm/dm/@rxap/plugin-n8n)
12
8
  ![NPM](https://img.shields.io/npm/l/@rxap/plugin-n8n)
9
+
13
10
  - [Installation](#installation)
14
11
  - [Generators](#generators)
12
+ - [init](#init)
13
+ - [node](#node)
15
14
 
16
15
  # Installation
17
16
 
18
17
  **Add the package to your workspace:**
19
18
  ```bash
20
- @rxap/plugin-n8n
19
+ yarn add @rxap/plugin-n8n
20
+ ```
21
+ **Execute the init generator:**
22
+ ```bash
23
+ yarn nx g @rxap/plugin-n8n:init
21
24
  ```
22
- **Execute the init generator:** ```bash yarn nx g
23
- @rxap/plugin-n8n:init ```
24
25
  # Generators
25
26
 
26
- ##
27
- init
28
- >
29
- Initialize the package in the workspace
30
-
31
- ```bash yarn nx g
32
- @rxap/plugin-n8n:init
33
- ```
34
-
35
- ##
36
- node
37
- >
38
- node generator
39
-
40
- ```bash yarn nx g
41
- @rxap/plugin-n8n:node
42
- ```
43
-
44
- ##
45
- init
46
- >
47
- Initialize the package in the workspace
48
-
49
- ```bash yarn nx g
50
- @rxap/plugin-n8n:init
51
- ```
52
-
53
- ##
54
- node
55
- >
56
- node generator
57
-
58
- ```bash yarn nx g
59
- @rxap/plugin-n8n:node
60
- ```
27
+ ## init
28
+ > Initialize the package in the workspace
29
+
30
+ ```bash
31
+ nx g @rxap/plugin-n8n:init
32
+ ```
33
+
34
+ Option | Type | Default | Description
35
+ --- | --- | --- | ---
36
+ project | string | |
37
+ projects | array | |
38
+ skipFormat | boolean | false |
39
+ overwrite | boolean | false | Whether to overwrite existing files
40
+ skipProjects | boolean | false | Whether to skip executing project specific initialization
41
+
42
+ ## node
43
+ > node generator
44
+
45
+ ```bash
46
+ nx g @rxap/plugin-n8n:node
47
+ ```
48
+
49
+ Option | Type | Default | Description
50
+ --- | --- | --- | ---
51
+ name | string | |
52
+ project | string | |
53
+ description | string | |
54
+ nodeNamePrefix | string | |
package/package.json CHANGED
@@ -1,15 +1,17 @@
1
1
  {
2
- "version": "20.0.2",
2
+ "version": "20.1.0-dev.1",
3
3
  "name": "@rxap/plugin-n8n",
4
4
  "description": "This package provides generators for initializing and creating n8n plugins within an Nx workspace. It includes generators for initializing a workspace or project for n8n development, as well as a generator for creating new n8n nodes. The package also includes utilities for updating project configurations and package.json files to support n8n plugin development.\n",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "dependencies": {
7
7
  "@nx/devkit": "20.4.2",
8
- "@rxap/plugin-library": "^20.1.1",
8
+ "@rxap/plugin-library": "^20.1.2-dev.1",
9
9
  "@rxap/ts-morph": "^1.5.3",
10
10
  "@rxap/utilities": "^16.4.2",
11
- "@rxap/workspace-ts-morph": "^19.1.9",
12
- "@rxap/workspace-utilities": "^19.6.1",
11
+ "@rxap/workspace-ts-morph": "^19.1.10-dev.0",
12
+ "@rxap/workspace-utilities": "^19.6.2-dev.0",
13
+ "colors": "1.4.0",
14
+ "nx": "20.4.2",
13
15
  "ts-morph": "18.0.0",
14
16
  "tslib": "2.6.2"
15
17
  },
@@ -44,6 +46,14 @@
44
46
  "schematics": "./generators.json",
45
47
  "type": "commonjs",
46
48
  "typings": "./src/index.d.ts",
47
- "gitHead": "402887412674e616554624b2c11770ca36982b78",
49
+ "gitHead": "0b022b6165e06718ce3edf73ae1d5375f0ff3413",
50
+ "exports": {
51
+ "./package.json": "./package.json",
52
+ ".": {
53
+ "types": "./src/index.d.ts",
54
+ "default": "./src/index.js"
55
+ },
56
+ "./plugin": "./src/plugin.js"
57
+ },
48
58
  "types": "./src/index.d.ts"
49
59
  }
@@ -32,15 +32,9 @@ function initGenerator(tree, options) {
32
32
  }
33
33
  console.log('library n8n init generator:', options);
34
34
  (0, init_workspace_1.initWorkspace)(tree, options);
35
- if (!options.skipProjects) {
36
- for (const [projectName, project] of (0, devkit_1.getProjects)(tree).entries()) {
37
- if (skipProject(tree, options, project, projectName)) {
38
- continue;
39
- }
40
- (0, workspace_utilities_1.GenerateSerializedSchematicFile)(tree, (0, workspace_utilities_1.GetProjectRoot)(tree, projectName), '@rxap/plugin-library', 'init', (0, utilities_1.DeleteProperties)(options, ['project', 'projects', 'overwrite', 'skipProjects']));
41
- yield (0, init_project_1.initProject)(tree, projectName, project, options);
42
- (0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
43
- }
35
+ for (const [projectName, project] of (0, workspace_utilities_1.ForeachInitProject)(tree, options, skipProject)) {
36
+ yield (0, init_project_1.initProject)(tree, projectName, project, options);
37
+ (0, workspace_utilities_1.GenerateSerializedSchematicFile)(tree, (0, workspace_utilities_1.GetProjectRoot)(tree, projectName), '@rxap/plugin-library', 'init', (0, utilities_1.DeleteProperties)(options, ['project', 'projects', 'overwrite', 'skipProjects']));
44
38
  }
45
39
  if (!options.skipFormat) {
46
40
  yield (0, devkit_1.formatFiles)(tree);
@@ -1 +1 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/n8n/src/generators/init/generator.ts"],"names":[],"mappings":";;AAgDA,sCAoCC;;AApFD,uCAMoB;AACpB,+CAGyB;AACzB,mEAKmC;AACnC,iDAA6C;AAC7C,qDAAiD;AAGjD,SAAS,WAAW,CAClB,IAAU,EACV,OAA4B,EAC5B,OAA6B,EAC7B,WAAmB;IAGnB,IAAI,OAAO,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,WAAW,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,IAAA,2CAAqB,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,CAAC;QAC/D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,IAAA,kCAAY,EAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AAEf,CAAC;AAED,SAAsB,aAAa,CAAC,IAAU,EAAE,OAA4B;;;QAC1E,MAAA,OAAO,CAAC,OAAO,oCAAf,OAAO,CAAC,OAAO,GAAK,SAAS,EAAC;QAC9B,MAAA,OAAO,CAAC,QAAQ,oCAAhB,OAAO,CAAC,QAAQ,GAAK,EAAE,EAAC;QACxB,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACpB,IAAA,4BAAgB,EAAC,OAAO,CAAC,QAAQ,EAAE,CAAE,OAAO,CAAC,OAAO,CAAE,CAAC,CAAC;QAC1D,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC;QAEpD,IAAA,8BAAa,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE7B,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;YAE1B,KAAK,MAAM,CAAE,WAAW,EAAE,OAAO,CAAE,IAAI,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;gBAEnE,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,CAAC;oBACrD,SAAS;gBACX,CAAC;gBAED,IAAA,qDAA+B,EAC7B,IAAI,EACJ,IAAA,oCAAc,EAAC,IAAI,EAAE,WAAW,CAAC,EACjC,sBAAsB,EACtB,MAAM,EACN,IAAA,4BAAgB,EAAC,OAAO,EAAE,CAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,CAAE,CAAC,CAClF,CAAC;gBAEF,MAAM,IAAA,0BAAW,EAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;gBAEvD,IAAA,mCAA0B,EAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;YACzD,CAAC;QAEH,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YACxB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;CAAA;AAED,kBAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/n8n/src/generators/init/generator.ts"],"names":[],"mappings":";;AAiDA,sCA2BC;;AA5ED,uCAMoB;AACpB,+CAGyB;AACzB,mEAMmC;AACnC,iDAA6C;AAC7C,qDAAiD;AAGjD,S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AAC,IAAI,EAAE,WAAW,CAAC,EACjC,sBAAsB,EACtB,MAAM,EACN,IAAA,4BAAgB,EAAC,OAAO,EAAE,CAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,CAAE,CAAC,CAClF,CAAC;QAEJ,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YACxB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;CAAA;AAED,kBAAe,aAAa,CAAC"}
@@ -2,7 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.initWorkspace = initWorkspace;
4
4
  const plugin_library_1 = require("@rxap/plugin-library");
5
+ const workspace_utilities_1 = require("@rxap/workspace-utilities");
5
6
  function initWorkspace(tree, options) {
6
7
  (0, plugin_library_1.LibraryInitWorkspace)(tree, options);
8
+ (0, workspace_utilities_1.UpdateNxJson)(tree, nxJson => {
9
+ if ((0, workspace_utilities_1.IsRxapRepository)(tree)) {
10
+ (0, workspace_utilities_1.CoerceNxPlugin)(nxJson, './packages/plugin/n8n/src/plugin.ts');
11
+ }
12
+ else {
13
+ (0, workspace_utilities_1.CoerceNxPlugin)(nxJson, '@rxap/plugin-n8n');
14
+ }
15
+ });
7
16
  }
8
17
  //# sourceMappingURL=init-workspace.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init-workspace.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/n8n/src/generators/init/init-workspace.ts"],"names":[],"mappings":";;AAIA,sCAEC;AALD,yDAA4D;AAG5D,SAAgB,aAAa,CAAC,IAAU,EAAE,OAA4B;IACpE,IAAA,qCAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACtC,CAAC"}
1
+ {"version":3,"file":"init-workspace.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/n8n/src/generators/init/init-workspace.ts"],"names":[],"mappings":";;AASA,sCASC;AAjBD,yDAA4D;AAC5D,mEAImC;AAGnC,SAAgB,aAAa,CAAC,IAAU,EAAE,OAA4B;IACpE,IAAA,qCAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpC,IAAA,kCAAY,EAAC,IAAI,EAAE,MAAM,CAAC,EAAE;QAC1B,IAAI,IAAA,sCAAgB,EAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,IAAA,oCAAc,EAAC,MAAM,EAAE,qCAAqC,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACN,IAAA,oCAAc,EAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,15 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateProjectPackageJson = updateProjectPackageJson;
4
+ const utilities_1 = require("@rxap/utilities");
4
5
  const workspace_utilities_1 = require("@rxap/workspace-utilities");
5
6
  function updateProjectPackageJson(tree, projectName) {
6
7
  (0, workspace_utilities_1.UpdateProjectPackageJson)(tree, packageJson => {
7
- var _a, _b, _c, _d;
8
- var _e, _f, _g;
8
+ var _a, _b, _c, _d, _e;
9
+ var _f, _g, _h;
9
10
  (_a = packageJson.n8n) !== null && _a !== void 0 ? _a : (packageJson.n8n = {});
10
- (_b = (_e = packageJson.n8n).n8nNodesApiVersion) !== null && _b !== void 0 ? _b : (_e.n8nNodesApiVersion = 1);
11
- (_c = (_f = packageJson.n8n).nodes) !== null && _c !== void 0 ? _c : (_f.nodes = []);
12
- (_d = (_g = packageJson.n8n).credentials) !== null && _d !== void 0 ? _d : (_g.credentials = []);
11
+ (_b = (_f = packageJson.n8n).n8nNodesApiVersion) !== null && _b !== void 0 ? _b : (_f.n8nNodesApiVersion = 1);
12
+ (_c = (_g = packageJson.n8n).nodes) !== null && _c !== void 0 ? _c : (_g.nodes = []);
13
+ (_d = (_h = packageJson.n8n).credentials) !== null && _d !== void 0 ? _d : (_h.credentials = []);
14
+ (_e = packageJson.keywords) !== null && _e !== void 0 ? _e : (packageJson.keywords = []);
15
+ (0, utilities_1.CoerceArrayItems)(packageJson.keywords, ['n8n-community-node-package']);
13
16
  }, { projectName });
14
17
  }
15
18
  //# sourceMappingURL=update-project-package-json.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-project-package-json.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/n8n/src/generators/init/update-project-package-json.ts"],"names":[],"mappings":";;AAGA,4DASC;AAXD,mEAAqE;AAErE,SAAgB,wBAAwB,CAAC,IAAU,EAAE,WAAmB;IAEtE,IAAA,8CAAwB,EAAC,IAAI,EAAE,WAAW,CAAC,EAAE;;;QAC3C,MAAA,WAAW,CAAC,GAAG,oCAAf,WAAW,CAAC,GAAG,GAAK,EAAE,EAAC;QACvB,YAAA,WAAW,CAAC,GAAG,EAAC,kBAAkB,uCAAlB,kBAAkB,GAAK,CAAC,EAAC;QACzC,YAAA,WAAW,CAAC,GAAG,EAAC,KAAK,uCAAL,KAAK,GAAK,EAAE,EAAC;QAC7B,YAAA,WAAW,CAAC,GAAG,EAAC,WAAW,uCAAX,WAAW,GAAK,EAAE,EAAC;IACrC,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;AAEtB,CAAC"}
1
+ {"version":3,"file":"update-project-package-json.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/n8n/src/generators/init/update-project-package-json.ts"],"names":[],"mappings":";;AAIA,4DAWC;AAdD,+CAAmD;AACnD,mEAAqE;AAErE,SAAgB,wBAAwB,CAAC,IAAU,EAAE,WAAmB;IAEtE,IAAA,8CAAwB,EAAC,IAAI,EAAE,WAAW,CAAC,EAAE;;;QAC3C,MAAA,WAAW,CAAC,GAAG,oCAAf,WAAW,CAAC,GAAG,GAAK,EAAE,EAAC;QACvB,YAAA,WAAW,CAAC,GAAG,EAAC,kBAAkB,uCAAlB,kBAAkB,GAAK,CAAC,EAAC;QACzC,YAAA,WAAW,CAAC,GAAG,EAAC,KAAK,uCAAL,KAAK,GAAK,EAAE,EAAC;QAC7B,YAAA,WAAW,CAAC,GAAG,EAAC,WAAW,uCAAX,WAAW,GAAK,EAAE,EAAC;QACnC,MAAA,WAAW,CAAC,QAAQ,oCAApB,WAAW,CAAC,QAAQ,GAAK,EAAE,EAAC;QAC5B,IAAA,4BAAgB,EAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,4BAA4B,CAAC,CAAC,CAAC;IACzE,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;AAEtB,CAAC"}
@@ -17,18 +17,5 @@ function updateProjectTargets(project, options) {
17
17
  'output': './src/lib',
18
18
  },
19
19
  ]);
20
- const fixDependencies = (0, workspace_utilities_1.GetTarget)(project, 'fix-dependencies');
21
- if (fixDependencies) {
22
- (0, workspace_utilities_1.CoerceTarget)(project, 'fix-dependencies', {
23
- "options": {
24
- "options": {
25
- "onlyDependencies": true,
26
- "peerDependencies": [
27
- "n8n-workflow"
28
- ]
29
- }
30
- }
31
- }, workspace_utilities_1.Strategy.MERGE);
32
- }
33
20
  }
34
21
  //# sourceMappingURL=update-project-targets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-project-targets.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/n8n/src/generators/init/update-project-targets.ts"],"names":[],"mappings":";;AASA,oDAgCC;AAxCD,mEAKmC;AAGnC,SAAgB,oBAAoB,CAAC,OAA6B,EAAE,OAA4B;;IAE9F,MAAM,KAAK,GAAG,IAAA,+BAAS,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,mCAAI,EAAE,CAAC;IAE1C,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,wCAAyC,OAAO,CAAC,IAAK,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,MAAA,YAAY,CAAC,MAAM,oCAAnB,YAAY,CAAC,MAAM,GAAK,EAAE,EAAC;IAC3B,IAAA,kCAAY,EAAC,YAAY,CAAC,MAAM,EAAE;QAChC;YACE,OAAO,EAAE,KAAK,OAAO,CAAC,IAAI,UAAU;YACpC,MAAM,EAAE,qBAAqB;YAC7B,QAAQ,EAAE,WAAW;SACtB;KACF,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,IAAA,+BAAS,EAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;IAC/D,IAAI,eAAe,EAAE,CAAC;QACpB,IAAA,kCAAY,EAAC,OAAO,EAAE,kBAAkB,EAAE;YACxC,SAAS,EAAE;gBACT,SAAS,EAAE;oBACT,kBAAkB,EAAE,IAAI;oBACxB,kBAAkB,EAAE;wBAClB,cAAc;qBACf;iBACF;aACF;SACF,EAAE,8BAAQ,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;AAEH,CAAC"}
1
+ {"version":3,"file":"update-project-targets.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/n8n/src/generators/init/update-project-targets.ts"],"names":[],"mappings":";;AAOA,oDAkBC;AAxBD,mEAGmC;AAGnC,SAAgB,oBAAoB,CAAC,OAA6B,EAAE,OAA4B;;IAE9F,MAAM,KAAK,GAAG,IAAA,+BAAS,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,mCAAI,EAAE,CAAC;IAE1C,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,wCAAyC,OAAO,CAAC,IAAK,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,MAAA,YAAY,CAAC,MAAM,oCAAnB,YAAY,CAAC,MAAM,GAAK,EAAE,EAAC;IAC3B,IAAA,kCAAY,EAAC,YAAY,CAAC,MAAM,EAAE;QAChC;YACE,OAAO,EAAE,KAAK,OAAO,CAAC,IAAI,UAAU;YACpC,MAAM,EAAE,qBAAqB;YAC7B,QAAQ,EAAE,WAAW;SACtB;KACF,CAAC,CAAC;AAEL,CAAC"}
@@ -4,10 +4,12 @@ exports.nodeGenerator = nodeGenerator;
4
4
  const tslib_1 = require("tslib");
5
5
  const create_node_json_1 = require("./create-node-json");
6
6
  const create_node_ts_1 = require("./create-node-ts");
7
+ const update_package_json_1 = require("./update-package-json");
7
8
  function nodeGenerator(tree_1, _a) {
8
9
  return tslib_1.__awaiter(this, arguments, void 0, function* (tree, { project, name, nodeNamePrefix = 'rxap', description = name }) {
9
10
  (0, create_node_json_1.createNodeJson)(tree, project, name, nodeNamePrefix);
10
11
  (0, create_node_ts_1.createNodeTs)(tree, project, name, nodeNamePrefix, description);
12
+ (0, update_package_json_1.updatePackageJson)(tree, project, name);
11
13
  });
12
14
  }
13
15
  exports.default = nodeGenerator;
@@ -1 +1 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/n8n/src/generators/node/generator.ts"],"names":[],"mappings":";;AAKA,sCAGC;;AAPD,yDAAoD;AACpD,qDAAgD;AAGhD,SAAsB,aAAa;iEAAC,IAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,GAAG,MAAM,EAAE,WAAW,GAAG,IAAI,EAAuB;QACjI,IAAA,iCAAc,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QACpD,IAAA,6BAAY,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;IACjE,CAAC;CAAA;AAED,kBAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/n8n/src/generators/node/generator.ts"],"names":[],"mappings":";;AAMA,sCAIC;;AATD,yDAAoD;AACpD,qDAAgD;AAEhD,+DAA0D;AAE1D,SAAsB,aAAa;iEAAC,IAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,GAAG,MAAM,EAAE,WAAW,GAAG,IAAI,EAAuB;QACjI,IAAA,iCAAc,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QACpD,IAAA,6BAAY,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;QAC/D,IAAA,uCAAiB,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;CAAA;AAED,kBAAe,aAAa,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { CreateNodesV2 } from '@nx/devkit';
2
+ import 'colors';
3
+ export interface PluginOptions {
4
+ }
5
+ export declare function normalizeOptions(options: PluginOptions | undefined): PluginOptions;
6
+ export declare const createNodesV2: CreateNodesV2<PluginOptions>;
package/src/plugin.js ADDED
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createNodesV2 = void 0;
4
+ exports.normalizeOptions = normalizeOptions;
5
+ const tslib_1 = require("tslib");
6
+ const workspace_utilities_1 = require("@rxap/workspace-utilities");
7
+ const tree_1 = require("nx/src/generators/tree");
8
+ const globs_1 = require("nx/src/utils/globs");
9
+ const path_1 = require("path");
10
+ require("colors");
11
+ function normalizeOptions(options) {
12
+ return options !== null && options !== void 0 ? options : {};
13
+ }
14
+ exports.createNodesV2 = [
15
+ (0, globs_1.combineGlobPatterns)([
16
+ '**/tsconfig.lib.json'
17
+ ]),
18
+ (configFilePaths, options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
19
+ const normalizedOptions = normalizeOptions(options);
20
+ const includedConfigFilePaths = yield Promise.all(configFilePaths.map((configFilePath) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
21
+ if (yield shouldHaveProjectConfiguration(configFilePath, normalizedOptions, context)) {
22
+ return configFilePath;
23
+ }
24
+ return undefined;
25
+ }))).then((configFilePathOrUndefinedList) => configFilePathOrUndefinedList.filter((value) => value !== undefined));
26
+ const results = yield Promise.all(includedConfigFilePaths.map((configFilePath) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
27
+ const [projectPath, projectConfiguration] = yield createProjectConfiguration(configFilePath, normalizedOptions, context);
28
+ return [configFilePath, projectPath, projectConfiguration];
29
+ })));
30
+ return results.map(([configFilePath, projectPath, projectConfiguration]) => [
31
+ configFilePath,
32
+ {
33
+ projects: {
34
+ [projectPath]: projectConfiguration,
35
+ },
36
+ },
37
+ ]);
38
+ }),
39
+ ];
40
+ function shouldHaveProjectConfiguration(configFilePath, options, context) {
41
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
42
+ var _a;
43
+ const projectPath = (0, path_1.dirname)(configFilePath);
44
+ const tree = new tree_1.FsTree(context.workspaceRoot, false);
45
+ const projectConfiguration = (0, workspace_utilities_1.FindProjectByPath)(tree, projectPath);
46
+ if (!projectConfiguration) {
47
+ // console.log(`The folder of the file '${ configFilePath }' is not the root of a project. Skipping`.yellow);
48
+ return false;
49
+ }
50
+ if (!((_a = projectConfiguration.tags) === null || _a === void 0 ? void 0 : _a.includes('n8n'))) {
51
+ // console.log(`The project ${projectConfiguration.name} does not have the tag 'n8n'`);
52
+ return false;
53
+ }
54
+ for (const _ of (0, workspace_utilities_1.SearchFile)(tree, projectPath, path => path.endsWith('.node.json'))) {
55
+ return true;
56
+ }
57
+ // console.log(`The project ${projectConfiguration.name} does not contain a *.node.json file`);
58
+ return false;
59
+ });
60
+ }
61
+ function createProjectConfiguration(configFilePath, options, context) {
62
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
63
+ const projectPath = (0, path_1.dirname)(configFilePath);
64
+ const targets = {};
65
+ targets['fix-dependencies'] = createFixDependenciesTarget();
66
+ return [
67
+ projectPath, {
68
+ targets,
69
+ },
70
+ ];
71
+ });
72
+ }
73
+ function createFixDependenciesTarget() {
74
+ return {
75
+ executor: '@rxap/plugin-library:fix-dependencies',
76
+ inputs: ["production", "^production"],
77
+ outputs: ['{projectRoot}/package.json'],
78
+ options: {
79
+ onlyDependencies: true,
80
+ peerDependencies: ['n8n-workflow']
81
+ }
82
+ };
83
+ }
84
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../../packages/plugin/n8n/src/plugin.ts"],"names":[],"mappings":";;;AAmBA,4CAIC;;AAjBD,mEAGmC;AACnC,iDAAgD;AAEhD,8CAAyD;AACzD,+BAA+B;AAC/B,kBAAgB;AAKhB,SAAgB,gBAAgB,CAC9B,OAAkC;IAElC,OAAO,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;AACvB,CAAC;AAEY,QAAA,aAAa,GAAiC;IACzD,IAAA,2BAAmB,EAAC;QAClB,sBAAsB;KACvB,CAAC;IACF,CAAO,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;QAC1C,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAEpD,MAAM,uBAAuB,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/C,eAAe,CAAC,GAAG,CAAC,CAAO,cAAc,EAAE,EAAE;YAC3C,IACE,MAAM,8BAA8B,CAClC,cAAc,EACd,iBAAiB,EACjB,OAAO,CACR,EACD,CAAC;gBACD,OAAO,cAAc,CAAC;YACxB,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC,CAAA,CAAC,CACH,CAAC,IAAI,CAAC,CAAC,6BAA6B,EAAE,EAAE,CACvC,6BAA6B,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CACrE,CAAC;QAEF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,uBAAuB,CAAC,GAAG,CAAC,CAAO,cAAc,EAAE,EAAE;YACnD,MAAM,CAAE,WAAW,EAAE,oBAAoB,CAAE,GACzC,MAAM,0BAA0B,CAC9B,cAAc,EACd,iBAAiB,EACjB,OAAO,CACR,CAAC;YACJ,OAAO,CAAE,cAAc,EAA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