@n8n/node-cli 0.11.0 → 0.12.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/README.md +17 -0
- package/dist/build.tsbuildinfo +1 -1
- package/dist/commands/cloud-support.d.ts +14 -0
- package/dist/commands/cloud-support.js +136 -0
- package/dist/commands/cloud-support.js.map +1 -0
- package/dist/commands/dev/utils.d.ts +1 -1
- package/dist/commands/dev/utils.js +2 -2
- package/dist/commands/dev/utils.js.map +1 -1
- package/dist/commands/lint.d.ts +4 -0
- package/dist/commands/lint.js +89 -2
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/prerelease.js +1 -1
- package/dist/commands/prerelease.js.map +1 -1
- package/dist/configs/eslint.d.ts +2 -2
- package/dist/configs/eslint.js +50 -41
- package/dist/configs/eslint.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/template/templates/declarative/custom/template/package.json +4 -3
- package/dist/template/templates/declarative/github-issues/template/package.json +4 -3
- package/dist/template/templates/programmatic/example/template/package.json +4 -3
- package/dist/utils/child-process.js +1 -1
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/command-suggestions.d.ts +6 -0
- package/dist/utils/command-suggestions.js +30 -0
- package/dist/utils/command-suggestions.js.map +1 -0
- package/dist/utils/git.js +5 -5
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/package.d.ts +2 -2
- package/dist/utils/package.js.map +1 -1
- package/dist/utils/validation.d.ts +2 -0
- package/dist/utils/validation.js +8 -0
- package/dist/utils/validation.js.map +1 -1
- package/package.json +7 -6
- package/dist/template/templates/declarative/github-issues/template/eslint.config.mjs +0 -3
- package/dist/template/templates/programmatic/example/template/eslint.config.mjs +0 -3
- /package/dist/template/templates/{declarative/custom/template → shared/default}/eslint.config.mjs +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class CloudSupport extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
action: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
private enableCloudSupport;
|
|
10
|
+
private disableCloudSupport;
|
|
11
|
+
private updateEslintConfig;
|
|
12
|
+
private updateStrictMode;
|
|
13
|
+
private showCloudSupportStatus;
|
|
14
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const prompts_1 = require("@clack/prompts");
|
|
7
|
+
const core_1 = require("@oclif/core");
|
|
8
|
+
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
11
|
+
const command_suggestions_1 = require("../utils/command-suggestions");
|
|
12
|
+
const package_1 = require("../utils/package");
|
|
13
|
+
const prompts_2 = require("../utils/prompts");
|
|
14
|
+
class CloudSupport extends core_1.Command {
|
|
15
|
+
async run() {
|
|
16
|
+
const { args } = await this.parse(CloudSupport);
|
|
17
|
+
await (0, prompts_2.ensureN8nPackage)('cloud-support');
|
|
18
|
+
const workingDir = process.cwd();
|
|
19
|
+
if (args.action === 'enable') {
|
|
20
|
+
await this.enableCloudSupport(workingDir);
|
|
21
|
+
}
|
|
22
|
+
else if (args.action === 'disable') {
|
|
23
|
+
await this.disableCloudSupport(workingDir);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
await this.showCloudSupportStatus(workingDir);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async enableCloudSupport(workingDir) {
|
|
30
|
+
(0, prompts_1.intro)(picocolors_1.default.inverse(' n8n-node cloud-support enable '));
|
|
31
|
+
await this.updateEslintConfig(workingDir, true);
|
|
32
|
+
prompts_1.log.success(`Updated ${picocolors_1.default.cyan('eslint.config.mjs')} to use default config`);
|
|
33
|
+
await this.updateStrictMode(workingDir, true);
|
|
34
|
+
prompts_1.log.success(`Enabled strict mode in ${picocolors_1.default.cyan('package.json')}`);
|
|
35
|
+
const lintCommand = await (0, command_suggestions_1.suggestLintCommand)();
|
|
36
|
+
(0, prompts_1.outro)(`Cloud support enabled. Run "${lintCommand}" to check compliance - your node must pass linting to be eligible for n8n Cloud publishing.`);
|
|
37
|
+
}
|
|
38
|
+
async disableCloudSupport(workingDir) {
|
|
39
|
+
(0, prompts_1.intro)(picocolors_1.default.inverse(' n8n-node cloud-support disable '));
|
|
40
|
+
prompts_1.log.warning(`This will make your node ineligible for n8n Cloud verification!
|
|
41
|
+
|
|
42
|
+
The following changes will be made:
|
|
43
|
+
• Switch to ${picocolors_1.default.magenta('configWithoutCloudSupport')} in ${picocolors_1.default.cyan('eslint.config.mjs')}
|
|
44
|
+
• Disable strict mode in ${picocolors_1.default.cyan('package.json')}`);
|
|
45
|
+
const confirmed = await (0, prompts_2.withCancelHandler)((0, prompts_1.confirm)({
|
|
46
|
+
message: 'Are you sure you want to disable cloud support?',
|
|
47
|
+
initialValue: false,
|
|
48
|
+
}));
|
|
49
|
+
if (!confirmed) {
|
|
50
|
+
(0, prompts_2.onCancel)('Cloud support unchanged');
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
await this.updateEslintConfig(workingDir, false);
|
|
54
|
+
prompts_1.log.success(`Updated ${picocolors_1.default.cyan('eslint.config.mjs')} to use ${picocolors_1.default.magenta('configWithoutCloudSupport')}`);
|
|
55
|
+
await this.updateStrictMode(workingDir, false);
|
|
56
|
+
prompts_1.log.success(`Disabled strict mode in ${picocolors_1.default.cyan('package.json')}`);
|
|
57
|
+
(0, prompts_1.outro)("Cloud support disabled. Your node may pass linting but it won't pass verification for n8n Cloud.");
|
|
58
|
+
}
|
|
59
|
+
async updateEslintConfig(workingDir, enableCloud) {
|
|
60
|
+
const eslintConfigPath = node_path_1.default.resolve(workingDir, 'eslint.config.mjs');
|
|
61
|
+
const newConfig = enableCloud
|
|
62
|
+
? `import { config } from '@n8n/node-cli/eslint';
|
|
63
|
+
|
|
64
|
+
export default config;
|
|
65
|
+
`
|
|
66
|
+
: `import { configWithoutCloudSupport } from '@n8n/node-cli/eslint';
|
|
67
|
+
|
|
68
|
+
export default configWithoutCloudSupport;
|
|
69
|
+
`;
|
|
70
|
+
await promises_1.default.writeFile(eslintConfigPath, newConfig, 'utf-8');
|
|
71
|
+
}
|
|
72
|
+
async updateStrictMode(workingDir, enableStrict) {
|
|
73
|
+
await (0, package_1.updatePackageJson)(workingDir, (packageJson) => {
|
|
74
|
+
packageJson.n8n = packageJson.n8n ?? {};
|
|
75
|
+
packageJson.n8n.strict = enableStrict;
|
|
76
|
+
return packageJson;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
async showCloudSupportStatus(workingDir) {
|
|
80
|
+
(0, prompts_1.intro)(picocolors_1.default.inverse(' n8n-node cloud-support '));
|
|
81
|
+
try {
|
|
82
|
+
const packageJson = await (0, package_1.getPackageJson)(workingDir);
|
|
83
|
+
const eslintConfigPath = node_path_1.default.resolve(workingDir, 'eslint.config.mjs');
|
|
84
|
+
const isStrictMode = packageJson?.n8n?.strict === true;
|
|
85
|
+
let isUsingDefaultConfig = false;
|
|
86
|
+
try {
|
|
87
|
+
const eslintConfig = await promises_1.default.readFile(eslintConfigPath, 'utf-8');
|
|
88
|
+
const normalizedConfig = eslintConfig.replace(/\s+/g, ' ').trim();
|
|
89
|
+
const expectedDefault = "import { config } from '@n8n/node-cli/eslint'; export default config;";
|
|
90
|
+
isUsingDefaultConfig = normalizedConfig === expectedDefault;
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
}
|
|
94
|
+
const isCloudSupported = isStrictMode && isUsingDefaultConfig;
|
|
95
|
+
if (isCloudSupported) {
|
|
96
|
+
prompts_1.log.success(`✅ Cloud support is ${picocolors_1.default.green('ENABLED')}
|
|
97
|
+
• Strict mode: ${picocolors_1.default.green('enabled')}
|
|
98
|
+
• ESLint config: ${picocolors_1.default.green('using default config')}
|
|
99
|
+
• Status: ${picocolors_1.default.green('eligible')} for n8n Cloud verification ${picocolors_1.default.dim('(if lint passes)')}`);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
prompts_1.log.warning(`⚠️ Cloud support is ${picocolors_1.default.yellow('DISABLED')}
|
|
103
|
+
• Strict mode: ${isStrictMode ? picocolors_1.default.green('enabled') : picocolors_1.default.red('disabled')}
|
|
104
|
+
• ESLint config: ${isUsingDefaultConfig ? picocolors_1.default.green('using default config') : picocolors_1.default.red('using custom config')}
|
|
105
|
+
• Status: ${picocolors_1.default.red('NOT eligible')} for n8n Cloud verification`);
|
|
106
|
+
}
|
|
107
|
+
const enableCommand = await (0, command_suggestions_1.suggestCloudSupportCommand)('enable');
|
|
108
|
+
const disableCommand = await (0, command_suggestions_1.suggestCloudSupportCommand)('disable');
|
|
109
|
+
const lintCommand = await (0, command_suggestions_1.suggestLintCommand)();
|
|
110
|
+
prompts_1.log.info(`Available commands:
|
|
111
|
+
• ${enableCommand} - Enable cloud support
|
|
112
|
+
• ${disableCommand} - Disable cloud support
|
|
113
|
+
• ${lintCommand} - Check compliance for cloud publishing`);
|
|
114
|
+
(0, prompts_1.outro)('Use the commands above to change cloud support settings or check compliance');
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
prompts_1.log.error('Failed to read package.json or determine cloud support status');
|
|
118
|
+
(0, prompts_1.outro)('Make sure you are in the root directory of your node package');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
CloudSupport.description = 'Enable or disable cloud support for this node';
|
|
123
|
+
CloudSupport.examples = [
|
|
124
|
+
'<%= config.bin %> <%= command.id %>',
|
|
125
|
+
'<%= config.bin %> <%= command.id %> enable',
|
|
126
|
+
'<%= config.bin %> <%= command.id %> disable',
|
|
127
|
+
];
|
|
128
|
+
CloudSupport.args = {
|
|
129
|
+
action: core_1.Args.string({
|
|
130
|
+
description: 'Action to perform (defaults to showing current status)',
|
|
131
|
+
required: false,
|
|
132
|
+
options: ['enable', 'disable'],
|
|
133
|
+
}),
|
|
134
|
+
};
|
|
135
|
+
exports.default = CloudSupport;
|
|
136
|
+
//# sourceMappingURL=cloud-support.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-support.js","sourceRoot":"","sources":["../../src/commands/cloud-support.ts"],"names":[],"mappings":";;;;;AAAA,4CAA4D;AAC5D,sCAA4C;AAC5C,gEAAkC;AAClC,0DAA6B;AAC7B,4DAAoC;AAEpC,sEAA8F;AAC9F,8CAAqE;AACrE,8CAAiF;AAEjF,MAAqB,YAAa,SAAQ,cAAO;IAgBhD,KAAK,CAAC,GAAG;QACR,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAEhD,MAAM,IAAA,0BAAgB,EAAC,eAAe,CAAC,CAAC;QAExC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAEjC,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QAC3C,CAAC;aAAM,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YACtC,MAAM,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACP,MAAM,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC;QAC/C,CAAC;IACF,CAAC;IAEO,KAAK,CAAC,kBAAkB,CAAC,UAAkB;QAClD,IAAA,eAAK,EAAC,oBAAU,CAAC,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AQ,CAAC,CAAC;YACjE,MAAM,cAAc,GAAG,MAAM,IAAA,gDAA0B,EAAC,SAAS,CAAC,CAAC;YACnE,MAAM,WAAW,GAAG,MAAM,IAAA,wCAAkB,GAAE,CAAC;YAE/C,aAAG,CAAC,IAAI,CAAC;MACN,aAAa;MACb,cAAc;MACd,WAAW,0CAA0C,CAAC,CAAC;YAE1D,IAAA,eAAK,EAAC,6EAA6E,CAAC,CAAC;QACtF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,aAAG,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;YAC3E,IAAA,eAAK,EAAC,8DAA8D,CAAC,CAAC;QACvE,CAAC;IACF,CAAC;;AA3Je,wBAAW,GAAG,+CAA+C,CAAC;AAC9D,qBAAQ,GAAG;IAC1B,qCAAqC;IACrC,4CAA4C;IAC5C,6CAA6C;CAC7C,CAAC;AAEc,iBAAI,GAAG;IACtB,MAAM,EAAE,WAAI,CAAC,MAAM,CAAC;QACnB,WAAW,EAAE,wDAAwD;QACrE,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;KAC9B,CAAC;CACF,CAAC;kBAdkB,YAAY"}
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.commands = commands;
|
|
7
7
|
exports.readPackageName = readPackageName;
|
|
8
|
-
const
|
|
8
|
+
const node_child_process_1 = require("node:child_process");
|
|
9
9
|
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
10
10
|
const json_1 = require("../../utils/json");
|
|
11
11
|
function commands() {
|
|
@@ -84,7 +84,7 @@ function commands() {
|
|
|
84
84
|
.forEach(logger);
|
|
85
85
|
};
|
|
86
86
|
const runPersistentCommand = (cmd, args, opts = {}) => {
|
|
87
|
-
const child = (0,
|
|
87
|
+
const child = (0, node_child_process_1.spawn)(cmd, args, {
|
|
88
88
|
cwd: opts.cwd,
|
|
89
89
|
env: { ...process.env, ...opts.env },
|
|
90
90
|
stdio: ['inherit', 'pipe', 'pipe'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/commands/dev/utils.ts"],"names":[],"mappings":";;;;;AAOA,4BAsIC;AAED,0CAIC;AAlJD,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/commands/dev/utils.ts"],"names":[],"mappings":";;;;;AAOA,4BAsIC;AAED,0CAIC;AAlJD,2DAA8D;AAC9D,gEAAkC;AAGlC,2CAA6C;AAE7C,SAAgB,QAAQ;IACvB,MAAM,cAAc,GAAmB,EAAE,CAAC;IAC1C,IAAI,cAAc,GAAG,KAAK,CAAC;IAE3B,MAAM,aAAa,GAAG,CAAC,KAAmB,EAAQ,EAAE;QACnD,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,CAAC,KAAmB,EAAE,MAAsB,EAAQ,EAAE;QACvE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YACnB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC;IACF,CAAC,CAAC;IAEF,MAAM,oBAAoB,GAAG,GAAS,EAAE;QACvC,cAAc,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;QAC/D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAG,CAAC,MAA4B,EAAQ,EAAE;QAC/D,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjC,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,OAAO;QACR,CAAC;QAED,IAAI,WAAW,GAAG,CAAC,CAAC;QACpB,MAAM,aAAa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AS,EAAmB,WAAW,CAAC,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC;AACtF,CAAC"}
|
package/dist/commands/lint.d.ts
CHANGED
package/dist/commands/lint.js
CHANGED
|
@@ -1,19 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const core_1 = require("@oclif/core");
|
|
7
|
+
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
4
10
|
const child_process_1 = require("../utils/child-process");
|
|
11
|
+
const command_suggestions_1 = require("../utils/command-suggestions");
|
|
12
|
+
const package_1 = require("../utils/package");
|
|
13
|
+
const prompts_1 = require("../utils/prompts");
|
|
14
|
+
const validation_1 = require("../utils/validation");
|
|
5
15
|
class Lint extends core_1.Command {
|
|
6
16
|
async run() {
|
|
7
17
|
const { flags } = await this.parse(Lint);
|
|
18
|
+
await (0, prompts_1.ensureN8nPackage)('lint');
|
|
19
|
+
await this.checkStrictMode();
|
|
8
20
|
const args = ['.'];
|
|
9
21
|
if (flags.fix) {
|
|
10
22
|
args.push('--fix');
|
|
11
23
|
}
|
|
24
|
+
let eslintOutput = '';
|
|
12
25
|
try {
|
|
13
|
-
await (0, child_process_1.runCommand)('eslint', args, {
|
|
26
|
+
await (0, child_process_1.runCommand)('eslint', args, {
|
|
27
|
+
context: 'local',
|
|
28
|
+
stdio: 'pipe',
|
|
29
|
+
env: { ...process.env, FORCE_COLOR: '1' },
|
|
30
|
+
printOutput: ({ stdout, stderr }) => {
|
|
31
|
+
eslintOutput = Buffer.concat([...stdout, ...stderr]).toString();
|
|
32
|
+
process.stdout.write(Buffer.concat(stdout));
|
|
33
|
+
process.stderr.write(Buffer.concat(stderr));
|
|
34
|
+
},
|
|
35
|
+
});
|
|
14
36
|
}
|
|
15
37
|
catch (error) {
|
|
16
38
|
if (error instanceof child_process_1.ChildProcessError) {
|
|
39
|
+
await this.handleLintErrors(eslintOutput);
|
|
17
40
|
if (error.signal) {
|
|
18
41
|
process.kill(process.pid, error.signal);
|
|
19
42
|
}
|
|
@@ -24,8 +47,72 @@ class Lint extends core_1.Command {
|
|
|
24
47
|
throw error;
|
|
25
48
|
}
|
|
26
49
|
}
|
|
50
|
+
async checkStrictMode() {
|
|
51
|
+
try {
|
|
52
|
+
const workingDir = process.cwd();
|
|
53
|
+
const packageJson = await (0, package_1.getPackageJson)(workingDir);
|
|
54
|
+
if (!packageJson?.n8n?.strict) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
await this.verifyEslintConfig(workingDir);
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async verifyEslintConfig(workingDir) {
|
|
64
|
+
const eslintConfigPath = node_path_1.default.resolve(workingDir, 'eslint.config.mjs');
|
|
65
|
+
const templatePath = node_path_1.default.resolve(__dirname, '../template/templates/shared/default/eslint.config.mjs');
|
|
66
|
+
const expectedConfig = await promises_1.default.readFile(templatePath, 'utf-8');
|
|
67
|
+
try {
|
|
68
|
+
const currentConfig = await promises_1.default.readFile(eslintConfigPath, 'utf-8');
|
|
69
|
+
const normalizedCurrent = currentConfig.replace(/\s+/g, ' ').trim();
|
|
70
|
+
const normalizedExpected = expectedConfig.replace(/\s+/g, ' ').trim();
|
|
71
|
+
if (normalizedCurrent !== normalizedExpected) {
|
|
72
|
+
const enableCommand = await (0, command_suggestions_1.suggestCloudSupportCommand)('enable');
|
|
73
|
+
this.log(`${picocolors_1.default.red('Strict mode violation:')} ${picocolors_1.default.cyan('eslint.config.mjs')} has been modified from the default configuration.
|
|
74
|
+
|
|
75
|
+
${picocolors_1.default.dim('Expected:')}
|
|
76
|
+
${picocolors_1.default.gray(expectedConfig)}
|
|
77
|
+
|
|
78
|
+
To restore default config: ${enableCommand}
|
|
79
|
+
To disable strict mode: set ${picocolors_1.default.yellow('"strict": false')} in ${picocolors_1.default.cyan('package.json')} under the ${picocolors_1.default.yellow('"n8n"')} section.`);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if ((0, validation_1.isEnoentError)(error)) {
|
|
85
|
+
const enableCommand = await (0, command_suggestions_1.suggestCloudSupportCommand)('enable');
|
|
86
|
+
this.log(`${picocolors_1.default.red('Strict mode violation:')} ${picocolors_1.default.cyan('eslint.config.mjs')} not found. Expected default configuration.
|
|
87
|
+
|
|
88
|
+
To create default config: ${enableCommand}`);
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async handleLintErrors(eslintOutput) {
|
|
95
|
+
if (this.containsCloudOnlyErrors(eslintOutput)) {
|
|
96
|
+
const disableCommand = await (0, command_suggestions_1.suggestCloudSupportCommand)('disable');
|
|
97
|
+
this.log(`${picocolors_1.default.yellow('⚠️ n8n Cloud compatibility issues detected')}
|
|
98
|
+
|
|
99
|
+
These lint failures prevent verification to n8n Cloud.
|
|
100
|
+
|
|
101
|
+
To disable cloud compatibility checks:
|
|
102
|
+
${disableCommand}
|
|
103
|
+
|
|
104
|
+
${picocolors_1.default.dim(`Note: This will switch to ${picocolors_1.default.magenta('configWithoutCloudSupport')} and disable strict mode`)}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
containsCloudOnlyErrors(errorMessage) {
|
|
108
|
+
const cloudOnlyRules = [
|
|
109
|
+
'@n8n/eslint-plugin-community-nodes/no-restricted-globals',
|
|
110
|
+
'@n8n/eslint-plugin-community-nodes/no-restricted-imports',
|
|
111
|
+
];
|
|
112
|
+
return cloudOnlyRules.some((rule) => errorMessage.includes(rule));
|
|
113
|
+
}
|
|
27
114
|
}
|
|
28
|
-
Lint.description = 'Lint the node in the current directory. Includes auto-fixing.';
|
|
115
|
+
Lint.description = 'Lint the node in the current directory. Includes auto-fixing. In strict mode, verifies eslint config is unchanged from default.';
|
|
29
116
|
Lint.examples = ['<%= config.bin %> <%= command.id %>'];
|
|
30
117
|
Lint.flags = {
|
|
31
118
|
fix: core_1.Flags.boolean({ description: 'Automatically fix problems', default: false }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":";;;;;AAAA,sCAA6C;AAC7C,gEAAkC;AAClC,0DAA6B;AAC7B,4DAAoC;AAEpC,0DAAuE;AACvE,sEAA0E;AAC1E,8CAAkD;AAClD,8CAAoD;AACpD,oDAAoD;AAEpD,MAAqB,IAAK,SAAQ,cAAO;IAQxC,KAAK,CAAC,GAAG;QACR,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEzC,MAAM,IAAA,0BAAgB,EAAC,MAAM,CAAC,CAAC;QAE/B,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;QAE7B,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAEnB,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;YACf,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpB,CAAC;QAED,IAAI,YAAY,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC;YACJ,MAAM,IAAA,0BAAU,EAAC,QAAQ,EAAE,IAAI,EAAE;gBAChC,OAAO,EAAE,OAAO;gBAChB,KAAK,EAAE,MAAM;gBACb,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE;gBACzC,WAAW,EAAE,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command {
|
|
|
7
7
|
await this.parse(Prerelease);
|
|
8
8
|
const packageManager = (await (0, package_manager_1.detectPackageManager)()) ?? 'npm';
|
|
9
9
|
if (!process.env.RELEASE_MODE) {
|
|
10
|
-
|
|
10
|
+
this.log(`Run \`${packageManager} run release\` to publish the package`);
|
|
11
11
|
process.exit(1);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prerelease.js","sourceRoot":"","sources":["../../src/commands/prerelease.ts"],"names":[],"mappings":";;AAAA,sCAAsC;AAEtC,8DAAgE;AAEhE,MAAqB,UAAW,SAAQ,cAAO;IAO9C,KAAK,CAAC,GAAG;QACR,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAE7B,MAAM,cAAc,GAAG,CAAC,MAAM,IAAA,sCAAoB,GAAE,CAAC,IAAI,KAAK,CAAC;QAE/D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;YAC/B,
|
|
1
|
+
{"version":3,"file":"prerelease.js","sourceRoot":"","sources":["../../src/commands/prerelease.ts"],"names":[],"mappings":";;AAAA,sCAAsC;AAEtC,8DAAgE;AAEhE,MAAqB,UAAW,SAAQ,cAAO;IAO9C,KAAK,CAAC,GAAG;QACR,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAE7B,MAAM,cAAc,GAAG,CAAC,MAAM,IAAA,sCAAoB,GAAE,CAAC,IAAI,KAAK,CAAC;QAE/D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;YAC/B,IAAI,CAAC,GAAG,CAAC,SAAS,cAAc,uCAAuC,CAAC,CAAC;YACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;IACF,CAAC;;AAfe,sBAAW,GAC1B,6EAA6E,CAAC;AAC/D,mBAAQ,GAAG,CAAC,qCAAqC,CAAC,CAAC;AACnD,gBAAK,GAAG,EAAE,CAAC;AACX,iBAAM,GAAG,IAAI,CAAC;kBALV,UAAU"}
|
package/dist/configs/eslint.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const config: import("@typescript-eslint/utils/dist/ts-eslint").FlatConfig.ConfigArray;
|
|
2
|
+
export declare const configWithoutCloudSupport: import("@typescript-eslint/utils/dist/ts-eslint").FlatConfig.ConfigArray;
|
|
3
3
|
export default config;
|
package/dist/configs/eslint.js
CHANGED
|
@@ -3,53 +3,62 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.config = void 0;
|
|
6
|
+
exports.configWithoutCloudSupport = exports.config = void 0;
|
|
7
7
|
const js_1 = __importDefault(require("@eslint/js"));
|
|
8
|
+
const eslint_plugin_community_nodes_1 = require("@n8n/eslint-plugin-community-nodes");
|
|
8
9
|
const config_1 = require("eslint/config");
|
|
9
10
|
const eslint_import_resolver_typescript_1 = require("eslint-import-resolver-typescript");
|
|
10
11
|
const eslint_plugin_import_x_1 = __importDefault(require("eslint-plugin-import-x"));
|
|
11
12
|
const eslint_plugin_n8n_nodes_base_1 = __importDefault(require("eslint-plugin-n8n-nodes-base"));
|
|
12
13
|
const typescript_eslint_1 = __importDefault(require("typescript-eslint"));
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'import-x/resolver-next': [(0, eslint_import_resolver_typescript_1.createTypeScriptImportResolver)()],
|
|
27
|
-
},
|
|
28
|
-
}, {
|
|
29
|
-
files: ['package.json'],
|
|
30
|
-
rules: {
|
|
31
|
-
...eslint_plugin_n8n_nodes_base_1.default.configs.community.rules,
|
|
32
|
-
},
|
|
33
|
-
languageOptions: {
|
|
34
|
-
parser: typescript_eslint_1.default.parser,
|
|
35
|
-
parserOptions: {
|
|
36
|
-
extraFileExtensions: ['.json'],
|
|
14
|
+
function createConfig(supportCloud = true) {
|
|
15
|
+
return typescript_eslint_1.default.config((0, config_1.globalIgnores)(['dist']), {
|
|
16
|
+
files: ['**/*.ts'],
|
|
17
|
+
extends: [
|
|
18
|
+
js_1.default.configs.recommended,
|
|
19
|
+
typescript_eslint_1.default.configs.recommended,
|
|
20
|
+
supportCloud
|
|
21
|
+
? eslint_plugin_community_nodes_1.n8nCommunityNodesPlugin.configs.recommended
|
|
22
|
+
: eslint_plugin_community_nodes_1.n8nCommunityNodesPlugin.configs.recommendedWithoutN8nCloudSupport,
|
|
23
|
+
eslint_plugin_import_x_1.default.configs['flat/recommended'],
|
|
24
|
+
],
|
|
25
|
+
rules: {
|
|
26
|
+
'prefer-spread': 'off',
|
|
37
27
|
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
28
|
+
}, {
|
|
29
|
+
plugins: { 'n8n-nodes-base': eslint_plugin_n8n_nodes_base_1.default },
|
|
30
|
+
settings: {
|
|
31
|
+
'import-x/resolver-next': [(0, eslint_import_resolver_typescript_1.createTypeScriptImportResolver)()],
|
|
32
|
+
},
|
|
33
|
+
}, {
|
|
34
|
+
files: ['package.json'],
|
|
35
|
+
rules: {
|
|
36
|
+
...eslint_plugin_n8n_nodes_base_1.default.configs.community.rules,
|
|
37
|
+
},
|
|
38
|
+
languageOptions: {
|
|
39
|
+
parser: typescript_eslint_1.default.parser,
|
|
40
|
+
parserOptions: {
|
|
41
|
+
extraFileExtensions: ['.json'],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
}, {
|
|
45
|
+
files: ['./credentials/**/*.ts'],
|
|
46
|
+
rules: {
|
|
47
|
+
...eslint_plugin_n8n_nodes_base_1.default.configs.credentials.rules,
|
|
48
|
+
'n8n-nodes-base/cred-class-field-documentation-url-miscased': 'off',
|
|
49
|
+
'n8n-nodes-base/cred-class-field-type-options-password-missing': 'off',
|
|
50
|
+
},
|
|
51
|
+
}, {
|
|
52
|
+
files: ['./nodes/**/*.ts'],
|
|
53
|
+
rules: {
|
|
54
|
+
...eslint_plugin_n8n_nodes_base_1.default.configs.nodes.rules,
|
|
55
|
+
'n8n-nodes-base/node-class-description-inputs-wrong-regular-node': 'off',
|
|
56
|
+
'n8n-nodes-base/node-class-description-outputs-wrong': 'off',
|
|
57
|
+
'n8n-nodes-base/node-param-type-options-max-value-present': 'off',
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
exports.config = createConfig();
|
|
62
|
+
exports.configWithoutCloudSupport = createConfig(false);
|
|
54
63
|
exports.default = exports.config;
|
|
55
64
|
//# sourceMappingURL=eslint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.js","sourceRoot":"","sources":["../../src/configs/eslint.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"eslint.js","sourceRoot":"","sources":["../../src/configs/eslint.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAgC;AAChC,sFAA6E;AAC7E,0CAA8C;AAC9C,yFAAmF;AACnF,oFAAkD;AAClD,gGAA0D;AAC1D,0EAA+D;AAE/D,SAAS,YAAY,CAAC,YAAY,GAAG,IAAI;IACxC,OAAO,2BAAQ,CAAC,MAAM,CACrB,IAAA,sBAAa,EAAC,CAAC,MAAM,CAAC,CAAC,EACvB;QACC,KAAK,EAAE,CAAC,SAAS,CAAC;QAClB,OAAO,EAAE;YACR,YAAM,CAAC,OAAO,CAAC,WAAW;YA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
1
1
|
import Build from './commands/build';
|
|
2
|
+
import CloudSupport from './commands/cloud-support';
|
|
2
3
|
import Dev from './commands/dev';
|
|
3
4
|
import Lint from './commands/lint';
|
|
4
5
|
import New from './commands/new';
|
|
@@ -11,4 +12,5 @@ export declare const commands: {
|
|
|
11
12
|
prerelease: typeof Prerelease;
|
|
12
13
|
release: typeof Release;
|
|
13
14
|
lint: typeof Lint;
|
|
15
|
+
'cloud-support': typeof CloudSupport;
|
|
14
16
|
};
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.commands = void 0;
|
|
7
7
|
const build_1 = __importDefault(require("./commands/build"));
|
|
8
|
+
const cloud_support_1 = __importDefault(require("./commands/cloud-support"));
|
|
8
9
|
const dev_1 = __importDefault(require("./commands/dev"));
|
|
9
10
|
const lint_1 = __importDefault(require("./commands/lint"));
|
|
10
11
|
const new_1 = __importDefault(require("./commands/new"));
|
|
@@ -17,5 +18,6 @@ exports.commands = {
|
|
|
17
18
|
prerelease: prerelease_1.default,
|
|
18
19
|
release: release_1.default,
|
|
19
20
|
lint: lint_1.default,
|
|
21
|
+
'cloud-support': cloud_support_1.default,
|
|
20
22
|
};
|
|
21
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,6DAAqC;AACrC,yDAAiC;AACjC,2DAAmC;AACnC,yDAAiC;AACjC,uEAA+C;AAC/C,iEAAyC;AAE5B,QAAA,QAAQ,GAAG;IACvB,GAAG,EAAE,aAAG;IACR,KAAK,EAAE,eAAK;IACZ,GAAG,EAAE,aAAG;IACR,UAAU,EAAE,oBAAU;IACtB,OAAO,EAAE,iBAAO;IAChB,IAAI,EAAE,cAAI;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,6DAAqC;AACrC,6EAAoD;AACpD,yDAAiC;AACjC,2DAAmC;AACnC,yDAAiC;AACjC,uEAA+C;AAC/C,iEAAyC;AAE5B,QAAA,QAAQ,GAAG;IACvB,GAAG,EAAE,aAAG;IACR,KAAK,EAAE,eAAK;IACZ,GAAG,EAAE,aAAG;IACR,UAAU,EAAE,oBAAU;IACtB,OAAO,EAAE,iBAAO;IAChB,IAAI,EAAE,cAAI;IAEV,eAAe,EAAE,uBAAY;CAC7B,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "{{nodePackageName}}",
|
|
3
3
|
"version": "0.1.0",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"homepage": "
|
|
6
|
+
"homepage": "",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"n8n-community-node-package"
|
|
9
9
|
],
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": ""
|
|
16
|
+
"url": "https://github.com/<...>/n8n-nodes-<...>.git"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "n8n-node build",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"n8n": {
|
|
31
31
|
"n8nNodesApiVersion": 1,
|
|
32
|
+
"strict": true,
|
|
32
33
|
"credentials": [],
|
|
33
34
|
"nodes": [
|
|
34
35
|
"dist/nodes/Example/Example.node.js"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "{{nodePackageName}}",
|
|
3
3
|
"version": "0.1.0",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"homepage": "
|
|
6
|
+
"homepage": "",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"n8n-community-node-package"
|
|
9
9
|
],
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": ""
|
|
16
|
+
"url": "https://github.com/<...>/n8n-nodes-<...>.git"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "n8n-node build",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"n8n": {
|
|
31
31
|
"n8nNodesApiVersion": 1,
|
|
32
|
+
"strict": true,
|
|
32
33
|
"credentials": [
|
|
33
34
|
"dist/credentials/GithubIssuesApi.credentials.js",
|
|
34
35
|
"dist/credentials/GithubIssuesOAuth2Api.credentials.js"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "{{nodePackageName}}",
|
|
3
3
|
"version": "0.1.0",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"homepage": "
|
|
6
|
+
"homepage": "",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"n8n-community-node-package"
|
|
9
9
|
],
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": ""
|
|
16
|
+
"url": "https://github.com/<...>/n8n-nodes-<...>.git"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "n8n-node build",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"n8n": {
|
|
31
31
|
"n8nNodesApiVersion": 1,
|
|
32
|
+
"strict": true,
|
|
32
33
|
"credentials": [],
|
|
33
34
|
"nodes": [
|
|
34
35
|
"dist/nodes/Example/Example.node.js"
|
|
@@ -49,11 +49,11 @@ async function runCommand(cmd, args = [], opts = {}) {
|
|
|
49
49
|
reject(new ChildProcessError(error.message, null, null));
|
|
50
50
|
});
|
|
51
51
|
child.on('close', (code, signal) => {
|
|
52
|
+
printOutput();
|
|
52
53
|
if (code === 0) {
|
|
53
54
|
resolve();
|
|
54
55
|
}
|
|
55
56
|
else {
|
|
56
|
-
printOutput();
|
|
57
57
|
reject(new ChildProcessError(`${cmd} exited with code ${code}${signal ? ` (signal: ${signal})` : ''}`, code, signal));
|
|
58
58
|
}
|
|
59
59
|
});
|