@lenne.tech/cli 1.28.0 → 1.30.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/build/cli.js +7 -1
- package/build/commands/frontend/angular.js +48 -46
- package/build/commands/frontend/convert-mode.js +41 -39
- package/build/commands/frontend/nuxt.js +49 -47
- package/build/commands/fullstack/add-api.js +34 -32
- package/build/commands/fullstack/add-app.js +25 -23
- package/build/commands/fullstack/convert-mode.js +85 -65
- package/build/commands/fullstack/init.js +12 -0
- package/build/commands/fullstack/update.js +24 -0
- package/build/commands/server/add-property.js +42 -40
- package/build/commands/server/convert-mode.js +41 -39
- package/build/commands/server/create.js +65 -63
- package/build/commands/server/module.js +56 -54
- package/build/commands/server/object.js +42 -40
- package/build/commands/server/permissions.js +60 -58
- package/build/commands/tools/crawl.js +92 -90
- package/build/extensions/frontend-helper.js +8 -37
- package/build/extensions/server.js +8 -38
- package/build/extensions/tools.js +10 -1
- package/build/lib/command-help.js +209 -0
- package/build/lib/vendor-claude-md.js +227 -0
- package/docs/commands.md +39 -0
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.help = void 0;
|
|
15
16
|
const path_1 = require("path");
|
|
16
17
|
const framework_detection_1 = require("../../lib/framework-detection");
|
|
17
18
|
const object_1 = __importDefault(require("./object"));
|
|
@@ -70,6 +71,60 @@ function detectControllerType(filesystem, path) {
|
|
|
70
71
|
/**
|
|
71
72
|
* Create a new server module
|
|
72
73
|
*/
|
|
74
|
+
exports.help = {
|
|
75
|
+
aliases: ['m'],
|
|
76
|
+
configuration: 'commands.server.module.*',
|
|
77
|
+
description: 'Create server module',
|
|
78
|
+
name: 'module',
|
|
79
|
+
options: [
|
|
80
|
+
{ description: 'Module name', flag: '--name', required: true, type: 'string' },
|
|
81
|
+
{
|
|
82
|
+
description: 'Controller type',
|
|
83
|
+
flag: '--controller',
|
|
84
|
+
required: false,
|
|
85
|
+
type: 'string',
|
|
86
|
+
values: ['Rest', 'GraphQL', 'Both', 'auto'],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
default: false,
|
|
90
|
+
description: 'Skip all interactive prompts',
|
|
91
|
+
flag: '--noConfirm',
|
|
92
|
+
required: false,
|
|
93
|
+
type: 'boolean',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
default: false,
|
|
97
|
+
description: 'Skip lint fix after generation',
|
|
98
|
+
flag: '--skipLint',
|
|
99
|
+
required: false,
|
|
100
|
+
type: 'boolean',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
default: false,
|
|
104
|
+
description: 'Preview what would be generated without creating files',
|
|
105
|
+
flag: '--dryRun',
|
|
106
|
+
required: false,
|
|
107
|
+
type: 'boolean',
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
propertyFlags: {
|
|
111
|
+
attributes: [
|
|
112
|
+
{ description: 'Property name', name: 'name', type: 'string' },
|
|
113
|
+
{
|
|
114
|
+
description: 'Property type',
|
|
115
|
+
name: 'type',
|
|
116
|
+
type: 'string',
|
|
117
|
+
values: ['string', 'number', 'boolean', 'bigint', 'Date', 'ObjectId', 'Json'],
|
|
118
|
+
},
|
|
119
|
+
{ description: 'Optional field', name: 'nullable', type: 'boolean' },
|
|
120
|
+
{ description: 'Array of this type', name: 'array', type: 'boolean' },
|
|
121
|
+
{ description: 'Enum type reference', name: 'enum', type: 'string' },
|
|
122
|
+
{ description: 'Embedded object/schema reference', name: 'schema', type: 'string' },
|
|
123
|
+
{ description: 'Reference module for ObjectId fields', name: 'reference', type: 'string' },
|
|
124
|
+
],
|
|
125
|
+
pattern: '--prop-<attribute>-<index>',
|
|
126
|
+
},
|
|
127
|
+
};
|
|
73
128
|
const NewCommand = {
|
|
74
129
|
alias: ['m'],
|
|
75
130
|
description: 'Create server module',
|
|
@@ -83,60 +138,7 @@ const NewCommand = {
|
|
|
83
138
|
// Retrieve the tools we need
|
|
84
139
|
const { config, filesystem, helper, parameters, patching, print: { divider, error, info, spin, success }, prompt: { ask, confirm }, server, strings: { camelCase, kebabCase, pascalCase }, system, template, } = toolbox;
|
|
85
140
|
// Handle --help-json flag
|
|
86
|
-
if (toolbox.tools.helpJson({
|
|
87
|
-
aliases: ['m'],
|
|
88
|
-
configuration: 'commands.server.module.*',
|
|
89
|
-
description: 'Create server module',
|
|
90
|
-
name: 'module',
|
|
91
|
-
options: [
|
|
92
|
-
{ description: 'Module name', flag: '--name', required: true, type: 'string' },
|
|
93
|
-
{
|
|
94
|
-
description: 'Controller type',
|
|
95
|
-
flag: '--controller',
|
|
96
|
-
required: false,
|
|
97
|
-
type: 'string',
|
|
98
|
-
values: ['Rest', 'GraphQL', 'Both', 'auto'],
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
default: false,
|
|
102
|
-
description: 'Skip all interactive prompts',
|
|
103
|
-
flag: '--noConfirm',
|
|
104
|
-
required: false,
|
|
105
|
-
type: 'boolean',
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
default: false,
|
|
109
|
-
description: 'Skip lint fix after generation',
|
|
110
|
-
flag: '--skipLint',
|
|
111
|
-
required: false,
|
|
112
|
-
type: 'boolean',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
default: false,
|
|
116
|
-
description: 'Preview what would be generated without creating files',
|
|
117
|
-
flag: '--dryRun',
|
|
118
|
-
required: false,
|
|
119
|
-
type: 'boolean',
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
propertyFlags: {
|
|
123
|
-
attributes: [
|
|
124
|
-
{ description: 'Property name', name: 'name', type: 'string' },
|
|
125
|
-
{
|
|
126
|
-
description: 'Property type',
|
|
127
|
-
name: 'type',
|
|
128
|
-
type: 'string',
|
|
129
|
-
values: ['string', 'number', 'boolean', 'bigint', 'Date', 'ObjectId', 'Json'],
|
|
130
|
-
},
|
|
131
|
-
{ description: 'Optional field', name: 'nullable', type: 'boolean' },
|
|
132
|
-
{ description: 'Array of this type', name: 'array', type: 'boolean' },
|
|
133
|
-
{ description: 'Enum type reference', name: 'enum', type: 'string' },
|
|
134
|
-
{ description: 'Embedded object/schema reference', name: 'schema', type: 'string' },
|
|
135
|
-
{ description: 'Reference module for ObjectId fields', name: 'reference', type: 'string' },
|
|
136
|
-
],
|
|
137
|
-
pattern: '--prop-<attribute>-<index>',
|
|
138
|
-
},
|
|
139
|
-
})) {
|
|
141
|
+
if (toolbox.tools.helpJson(exports.help)) {
|
|
140
142
|
return;
|
|
141
143
|
}
|
|
142
144
|
// Start timer
|
|
@@ -12,12 +12,53 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.help = void 0;
|
|
15
16
|
const path_1 = require("path");
|
|
16
17
|
const framework_detection_1 = require("../../lib/framework-detection");
|
|
17
18
|
const module_1 = __importDefault(require("./module"));
|
|
18
19
|
/**
|
|
19
20
|
* Create a new server object
|
|
20
21
|
*/
|
|
22
|
+
exports.help = {
|
|
23
|
+
aliases: ['o'],
|
|
24
|
+
configuration: 'commands.server.object.*',
|
|
25
|
+
description: 'Create embedded object',
|
|
26
|
+
name: 'object',
|
|
27
|
+
options: [
|
|
28
|
+
{ description: 'Object name', flag: '--name', required: true, type: 'string' },
|
|
29
|
+
{
|
|
30
|
+
default: false,
|
|
31
|
+
description: 'Skip lint fix after generation',
|
|
32
|
+
flag: '--skipLint',
|
|
33
|
+
required: false,
|
|
34
|
+
type: 'boolean',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
default: false,
|
|
38
|
+
description: 'Preview what would be generated without creating files',
|
|
39
|
+
flag: '--dryRun',
|
|
40
|
+
required: false,
|
|
41
|
+
type: 'boolean',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
propertyFlags: {
|
|
45
|
+
attributes: [
|
|
46
|
+
{ description: 'Property name', name: 'name', type: 'string' },
|
|
47
|
+
{
|
|
48
|
+
description: 'Property type',
|
|
49
|
+
name: 'type',
|
|
50
|
+
type: 'string',
|
|
51
|
+
values: ['string', 'number', 'boolean', 'bigint', 'Date', 'ObjectId', 'Json'],
|
|
52
|
+
},
|
|
53
|
+
{ description: 'Optional field', name: 'nullable', type: 'boolean' },
|
|
54
|
+
{ description: 'Array of this type', name: 'array', type: 'boolean' },
|
|
55
|
+
{ description: 'Enum type reference', name: 'enum', type: 'string' },
|
|
56
|
+
{ description: 'Embedded object/schema reference', name: 'schema', type: 'string' },
|
|
57
|
+
{ description: 'Reference module for ObjectId fields', name: 'reference', type: 'string' },
|
|
58
|
+
],
|
|
59
|
+
pattern: '--prop-<attribute>-<index>',
|
|
60
|
+
},
|
|
61
|
+
};
|
|
21
62
|
const NewCommand = {
|
|
22
63
|
alias: ['o'],
|
|
23
64
|
description: 'Create embedded object',
|
|
@@ -30,46 +71,7 @@ const NewCommand = {
|
|
|
30
71
|
// Retrieve the tools we need
|
|
31
72
|
const { config, filesystem, helper, parameters, print: { divider, error, info, spin, success }, prompt: { confirm }, server, strings: { camelCase, kebabCase, pascalCase }, system, template, } = toolbox;
|
|
32
73
|
// Handle --help-json flag
|
|
33
|
-
if (toolbox.tools.helpJson({
|
|
34
|
-
aliases: ['o'],
|
|
35
|
-
configuration: 'commands.server.object.*',
|
|
36
|
-
description: 'Create embedded object',
|
|
37
|
-
name: 'object',
|
|
38
|
-
options: [
|
|
39
|
-
{ description: 'Object name', flag: '--name', required: true, type: 'string' },
|
|
40
|
-
{
|
|
41
|
-
default: false,
|
|
42
|
-
description: 'Skip lint fix after generation',
|
|
43
|
-
flag: '--skipLint',
|
|
44
|
-
required: false,
|
|
45
|
-
type: 'boolean',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
default: false,
|
|
49
|
-
description: 'Preview what would be generated without creating files',
|
|
50
|
-
flag: '--dryRun',
|
|
51
|
-
required: false,
|
|
52
|
-
type: 'boolean',
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
propertyFlags: {
|
|
56
|
-
attributes: [
|
|
57
|
-
{ description: 'Property name', name: 'name', type: 'string' },
|
|
58
|
-
{
|
|
59
|
-
description: 'Property type',
|
|
60
|
-
name: 'type',
|
|
61
|
-
type: 'string',
|
|
62
|
-
values: ['string', 'number', 'boolean', 'bigint', 'Date', 'ObjectId', 'Json'],
|
|
63
|
-
},
|
|
64
|
-
{ description: 'Optional field', name: 'nullable', type: 'boolean' },
|
|
65
|
-
{ description: 'Array of this type', name: 'array', type: 'boolean' },
|
|
66
|
-
{ description: 'Enum type reference', name: 'enum', type: 'string' },
|
|
67
|
-
{ description: 'Embedded object/schema reference', name: 'schema', type: 'string' },
|
|
68
|
-
{ description: 'Reference module for ObjectId fields', name: 'reference', type: 'string' },
|
|
69
|
-
],
|
|
70
|
-
pattern: '--prop-<attribute>-<index>',
|
|
71
|
-
},
|
|
72
|
-
})) {
|
|
74
|
+
if (toolbox.tools.helpJson(exports.help)) {
|
|
73
75
|
return;
|
|
74
76
|
}
|
|
75
77
|
// Start timer
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.help = void 0;
|
|
12
13
|
const child_process_1 = require("child_process");
|
|
13
14
|
const fs_1 = require("fs");
|
|
14
15
|
const path_1 = require("path");
|
|
@@ -179,6 +180,64 @@ function printConsoleSummary(print, report) {
|
|
|
179
180
|
/**
|
|
180
181
|
* Scan server permissions and generate report
|
|
181
182
|
*/
|
|
183
|
+
exports.help = {
|
|
184
|
+
aliases: ['p'],
|
|
185
|
+
configuration: 'commands.server.permissions.*',
|
|
186
|
+
description: 'Scan server permissions and generate report',
|
|
187
|
+
name: 'permissions',
|
|
188
|
+
options: [
|
|
189
|
+
{
|
|
190
|
+
description: 'Project path containing src/server/modules/',
|
|
191
|
+
flag: '--path',
|
|
192
|
+
required: false,
|
|
193
|
+
type: 'string',
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
default: 'html',
|
|
197
|
+
description: 'Report output format',
|
|
198
|
+
flag: '--format',
|
|
199
|
+
required: false,
|
|
200
|
+
type: 'string',
|
|
201
|
+
values: ['md', 'json', 'html'],
|
|
202
|
+
},
|
|
203
|
+
{ description: 'Output file name', flag: '--output', required: false, type: 'string' },
|
|
204
|
+
{
|
|
205
|
+
default: true,
|
|
206
|
+
description: 'Open report in default application',
|
|
207
|
+
flag: '--open',
|
|
208
|
+
required: false,
|
|
209
|
+
type: 'boolean',
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
default: false,
|
|
213
|
+
description: 'Disable opening report',
|
|
214
|
+
flag: '--no-open',
|
|
215
|
+
required: false,
|
|
216
|
+
type: 'boolean',
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
default: false,
|
|
220
|
+
description: 'Print summary to console',
|
|
221
|
+
flag: '--console',
|
|
222
|
+
required: false,
|
|
223
|
+
type: 'boolean',
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
default: false,
|
|
227
|
+
description: 'Exit with code 1 if warnings found',
|
|
228
|
+
flag: '--fail-on-warnings',
|
|
229
|
+
required: false,
|
|
230
|
+
type: 'boolean',
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
default: false,
|
|
234
|
+
description: 'Skip all interactive prompts',
|
|
235
|
+
flag: '--noConfirm',
|
|
236
|
+
required: false,
|
|
237
|
+
type: 'boolean',
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
};
|
|
182
241
|
const PermissionsCommand = {
|
|
183
242
|
alias: ['p'],
|
|
184
243
|
description: 'Scan server permissions',
|
|
@@ -188,64 +247,7 @@ const PermissionsCommand = {
|
|
|
188
247
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
189
248
|
const { config, filesystem, parameters, print, print: { error, info, spin, success }, template, } = toolbox;
|
|
190
249
|
// Handle --help-json flag
|
|
191
|
-
if (toolbox.tools.helpJson({
|
|
192
|
-
aliases: ['p'],
|
|
193
|
-
configuration: 'commands.server.permissions.*',
|
|
194
|
-
description: 'Scan server permissions and generate report',
|
|
195
|
-
name: 'permissions',
|
|
196
|
-
options: [
|
|
197
|
-
{
|
|
198
|
-
description: 'Project path containing src/server/modules/',
|
|
199
|
-
flag: '--path',
|
|
200
|
-
required: false,
|
|
201
|
-
type: 'string',
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
default: 'html',
|
|
205
|
-
description: 'Report output format',
|
|
206
|
-
flag: '--format',
|
|
207
|
-
required: false,
|
|
208
|
-
type: 'string',
|
|
209
|
-
values: ['md', 'json', 'html'],
|
|
210
|
-
},
|
|
211
|
-
{ description: 'Output file name', flag: '--output', required: false, type: 'string' },
|
|
212
|
-
{
|
|
213
|
-
default: true,
|
|
214
|
-
description: 'Open report in default application',
|
|
215
|
-
flag: '--open',
|
|
216
|
-
required: false,
|
|
217
|
-
type: 'boolean',
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
default: false,
|
|
221
|
-
description: 'Disable opening report',
|
|
222
|
-
flag: '--no-open',
|
|
223
|
-
required: false,
|
|
224
|
-
type: 'boolean',
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
default: false,
|
|
228
|
-
description: 'Print summary to console',
|
|
229
|
-
flag: '--console',
|
|
230
|
-
required: false,
|
|
231
|
-
type: 'boolean',
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
default: false,
|
|
235
|
-
description: 'Exit with code 1 if warnings found',
|
|
236
|
-
flag: '--fail-on-warnings',
|
|
237
|
-
required: false,
|
|
238
|
-
type: 'boolean',
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
default: false,
|
|
242
|
-
description: 'Skip all interactive prompts',
|
|
243
|
-
flag: '--noConfirm',
|
|
244
|
-
required: false,
|
|
245
|
-
type: 'boolean',
|
|
246
|
-
},
|
|
247
|
-
],
|
|
248
|
-
})) {
|
|
250
|
+
if (toolbox.tools.helpJson(exports.help)) {
|
|
249
251
|
return;
|
|
250
252
|
}
|
|
251
253
|
info('Scan server permissions');
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.help = void 0;
|
|
12
13
|
const path_1 = require("path");
|
|
13
14
|
const crawler_1 = require("../../lib/crawler");
|
|
14
15
|
/**
|
|
@@ -18,6 +19,96 @@ const crawler_1 = require("../../lib/crawler");
|
|
|
18
19
|
* shares the defuddle + Turndown extraction pipeline but runs headless
|
|
19
20
|
* from Node and follows links / sitemaps automatically.
|
|
20
21
|
*/
|
|
22
|
+
exports.help = {
|
|
23
|
+
aliases: ['cr'],
|
|
24
|
+
description: 'Crawl a website into Markdown files (for Claude Code knowledge bases)',
|
|
25
|
+
name: 'crawl',
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
description: 'Start URL (absolute http/https URL)',
|
|
29
|
+
flag: '--url',
|
|
30
|
+
required: true,
|
|
31
|
+
type: 'string',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
default: '.',
|
|
35
|
+
description: 'Output directory (created if missing)',
|
|
36
|
+
flag: '--out',
|
|
37
|
+
type: 'string',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
default: 0,
|
|
41
|
+
description: 'Link depth. 0 = only start page; 1 = + direct links; N = up to N hops; "all" (or -1) = follow every same-origin link until --max-pages is reached',
|
|
42
|
+
flag: '--depth',
|
|
43
|
+
type: 'number|all',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
default: true,
|
|
47
|
+
description: 'Download images and inline them with local paths',
|
|
48
|
+
flag: '--images',
|
|
49
|
+
type: 'boolean',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
default: true,
|
|
53
|
+
description: 'Also seed queue from <origin>/sitemap.xml',
|
|
54
|
+
flag: '--sitemap',
|
|
55
|
+
type: 'boolean',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
default: 4,
|
|
59
|
+
description: 'Parallel HTTP requests',
|
|
60
|
+
flag: '--concurrency',
|
|
61
|
+
type: 'number',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
default: 200,
|
|
65
|
+
description: 'Maximum number of pages to crawl (safety cap)',
|
|
66
|
+
flag: '--max-pages',
|
|
67
|
+
type: 'number',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
description: 'CSS selector for the main content container',
|
|
71
|
+
flag: '--selector',
|
|
72
|
+
type: 'string',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
default: 20000,
|
|
76
|
+
description: 'HTTP request timeout in ms',
|
|
77
|
+
flag: '--timeout',
|
|
78
|
+
type: 'number',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
default: false,
|
|
82
|
+
description: 'Shortcut for --depth all (follows every same-origin link until --max-pages)',
|
|
83
|
+
flag: '--all',
|
|
84
|
+
type: 'boolean',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
default: true,
|
|
88
|
+
description: "Render pages through a headless browser before extracting (for SPAs like Vue/Nuxt/React/Angular). Uses playwright-core with system Chrome / Edge, falling back to Playwright's bundled chromium. Disable with --no-render for plain HTTP fetches.",
|
|
89
|
+
flag: '--render',
|
|
90
|
+
type: 'boolean',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
default: false,
|
|
94
|
+
description: 'If --render cannot find any browser, auto-install Playwright chromium (one-time ~170 MB download).',
|
|
95
|
+
flag: '--install-browser',
|
|
96
|
+
type: 'boolean',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
default: true,
|
|
100
|
+
description: 'After a multi-page crawl, remove any .md or image files inside <outDir>/pages and <outDir>/images that were not written by this run. Disable with --no-prune to preserve old files.',
|
|
101
|
+
flag: '--prune',
|
|
102
|
+
type: 'boolean',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
default: false,
|
|
106
|
+
description: 'Skip confirmation prompts',
|
|
107
|
+
flag: '--noConfirm',
|
|
108
|
+
type: 'boolean',
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
};
|
|
21
112
|
const NewCommand = {
|
|
22
113
|
alias: ['cr'],
|
|
23
114
|
description: 'Crawl site to Markdown',
|
|
@@ -26,96 +117,7 @@ const NewCommand = {
|
|
|
26
117
|
run: (toolbox) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
118
|
var _a, _b, _c, _d, _e;
|
|
28
119
|
const { config, filesystem, helper, parameters, print: { error, info, spin, success, warning }, prompt: { confirm }, tools, } = toolbox;
|
|
29
|
-
if (tools.helpJson({
|
|
30
|
-
aliases: ['cr'],
|
|
31
|
-
description: 'Crawl a website into Markdown files (for Claude Code knowledge bases)',
|
|
32
|
-
name: 'crawl',
|
|
33
|
-
options: [
|
|
34
|
-
{
|
|
35
|
-
description: 'Start URL (absolute http/https URL)',
|
|
36
|
-
flag: '--url',
|
|
37
|
-
required: true,
|
|
38
|
-
type: 'string',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
default: '.',
|
|
42
|
-
description: 'Output directory (created if missing)',
|
|
43
|
-
flag: '--out',
|
|
44
|
-
type: 'string',
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
default: 0,
|
|
48
|
-
description: 'Link depth. 0 = only start page; 1 = + direct links; N = up to N hops; "all" (or -1) = follow every same-origin link until --max-pages is reached',
|
|
49
|
-
flag: '--depth',
|
|
50
|
-
type: 'number|all',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
default: true,
|
|
54
|
-
description: 'Download images and inline them with local paths',
|
|
55
|
-
flag: '--images',
|
|
56
|
-
type: 'boolean',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
default: true,
|
|
60
|
-
description: 'Also seed queue from <origin>/sitemap.xml',
|
|
61
|
-
flag: '--sitemap',
|
|
62
|
-
type: 'boolean',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
default: 4,
|
|
66
|
-
description: 'Parallel HTTP requests',
|
|
67
|
-
flag: '--concurrency',
|
|
68
|
-
type: 'number',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
default: 200,
|
|
72
|
-
description: 'Maximum number of pages to crawl (safety cap)',
|
|
73
|
-
flag: '--max-pages',
|
|
74
|
-
type: 'number',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
description: 'CSS selector for the main content container',
|
|
78
|
-
flag: '--selector',
|
|
79
|
-
type: 'string',
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
default: 20000,
|
|
83
|
-
description: 'HTTP request timeout in ms',
|
|
84
|
-
flag: '--timeout',
|
|
85
|
-
type: 'number',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
default: false,
|
|
89
|
-
description: 'Shortcut for --depth all (follows every same-origin link until --max-pages)',
|
|
90
|
-
flag: '--all',
|
|
91
|
-
type: 'boolean',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
default: true,
|
|
95
|
-
description: "Render pages through a headless browser before extracting (for SPAs like Vue/Nuxt/React/Angular). Uses playwright-core with system Chrome / Edge, falling back to Playwright's bundled chromium. Disable with --no-render for plain HTTP fetches.",
|
|
96
|
-
flag: '--render',
|
|
97
|
-
type: 'boolean',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
default: false,
|
|
101
|
-
description: 'If --render cannot find any browser, auto-install Playwright chromium (one-time ~170 MB download).',
|
|
102
|
-
flag: '--install-browser',
|
|
103
|
-
type: 'boolean',
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
default: true,
|
|
107
|
-
description: 'After a multi-page crawl, remove any .md or image files inside <outDir>/pages and <outDir>/images that were not written by this run. Disable with --no-prune to preserve old files.',
|
|
108
|
-
flag: '--prune',
|
|
109
|
-
type: 'boolean',
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
default: false,
|
|
113
|
-
description: 'Skip confirmation prompts',
|
|
114
|
-
flag: '--noConfirm',
|
|
115
|
-
type: 'boolean',
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
})) {
|
|
120
|
+
if (tools.helpJson(exports.help)) {
|
|
119
121
|
return 'crawl';
|
|
120
122
|
}
|
|
121
123
|
tools.nonInteractiveHint('lt tools crawl <url> --out <dir> --depth 1 --noConfirm');
|
|
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.FrontendHelper = void 0;
|
|
13
13
|
const markdown_table_1 = require("../lib/markdown-table");
|
|
14
|
+
const vendor_claude_md_1 = require("../lib/vendor-claude-md");
|
|
14
15
|
/**
|
|
15
16
|
* Frontend helper functions for project scaffolding
|
|
16
17
|
* Provides reusable methods for setting up Nuxt and Angular frontends
|
|
@@ -390,17 +391,10 @@ class FrontendHelper {
|
|
|
390
391
|
// ── 6. Clean CLAUDE.md vendor marker ─────────────────────────────────
|
|
391
392
|
const claudeMdPath = path.join(dest, 'CLAUDE.md');
|
|
392
393
|
if (filesystem.exists(claudeMdPath)) {
|
|
393
|
-
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
const startIdx = content.indexOf(markerStart);
|
|
398
|
-
const endIdx = content.indexOf(markerEnd, startIdx);
|
|
399
|
-
if (endIdx > startIdx) {
|
|
400
|
-
content = content.slice(0, startIdx) + content.slice(endIdx + markerEnd.length);
|
|
401
|
-
content = content.replace(/^\n+/, '');
|
|
402
|
-
filesystem.write(claudeMdPath, content);
|
|
403
|
-
}
|
|
394
|
+
const content = filesystem.read(claudeMdPath) || '';
|
|
395
|
+
const cleaned = (0, vendor_claude_md_1.removeVendorBlock)(content, vendor_claude_md_1.FRONTEND_VENDOR_MARKER);
|
|
396
|
+
if (cleaned !== content) {
|
|
397
|
+
filesystem.write(claudeMdPath, cleaned);
|
|
404
398
|
}
|
|
405
399
|
}
|
|
406
400
|
// ── Post-conversion verification ─────────────────────────────────────
|
|
@@ -615,32 +609,9 @@ class FrontendHelper {
|
|
|
615
609
|
const claudeMdPath = path.join(dest, 'CLAUDE.md');
|
|
616
610
|
if (filesystem.exists(claudeMdPath)) {
|
|
617
611
|
const existing = filesystem.read(claudeMdPath) || '';
|
|
618
|
-
const
|
|
619
|
-
if (
|
|
620
|
-
|
|
621
|
-
marker,
|
|
622
|
-
'',
|
|
623
|
-
'# Vendor-Mode Notice (Frontend)',
|
|
624
|
-
'',
|
|
625
|
-
'This frontend project runs in **vendor mode**: the `@lenne.tech/nuxt-extensions`',
|
|
626
|
-
'module has been copied directly into `app/core/` as first-class',
|
|
627
|
-
'project code. There is **no** `@lenne.tech/nuxt-extensions` npm dependency.',
|
|
628
|
-
'',
|
|
629
|
-
'- **Read framework code from `app/core/**`** — not from `node_modules/`.',
|
|
630
|
-
"- **nuxt.config.ts** references `'./app/core/module'` instead of",
|
|
631
|
-
" `'@lenne.tech/nuxt-extensions'`.",
|
|
632
|
-
'- **Baseline + patch log** live in `app/core/VENDOR.md`. Log any',
|
|
633
|
-
' substantial local change there so the `nuxt-extensions-core-updater`',
|
|
634
|
-
' agent can classify it at sync time.',
|
|
635
|
-
'- **Update flow:** run `/lt-dev:frontend:update-nuxt-extensions-core`.',
|
|
636
|
-
'- **Contribute back:** run `/lt-dev:frontend:contribute-nuxt-extensions-core`.',
|
|
637
|
-
'- **Freshness check:** `pnpm run check:vendor-freshness` warns when',
|
|
638
|
-
' upstream has a newer release than the baseline.',
|
|
639
|
-
'',
|
|
640
|
-
'---',
|
|
641
|
-
'',
|
|
642
|
-
].join('\n');
|
|
643
|
-
filesystem.write(claudeMdPath, vendorBlock + existing);
|
|
612
|
+
const patched = (0, vendor_claude_md_1.insertVendorBlockIfMissing)(existing, vendor_claude_md_1.FRONTEND_VENDOR_MARKER, (0, vendor_claude_md_1.buildFrontendVendorBlock)());
|
|
613
|
+
if (patched !== existing) {
|
|
614
|
+
filesystem.write(claudeMdPath, patched);
|
|
644
615
|
}
|
|
645
616
|
}
|
|
646
617
|
// Merge upstream CLAUDE.md sections
|