@pixpilot/scaffoldfy 0.4.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/LICENSE +21 -0
- package/README.md +431 -0
- package/dist/cli.cjs +2 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +2 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +468 -0
- package/dist/index.d.ts +468 -0
- package/dist/index.js +1 -0
- package/dist/src-Cn-rEwSc.js +13 -0
- package/dist/src-eu70b3xC.cjs +13 -0
- package/package.json +72 -0
- package/schema/tasks.schema.json +337 -0
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pixpilot/scaffoldfy",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.4.0",
|
|
5
|
+
"author": "PixPilot <m.doaie@hotmail.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/pixpilot/scaffoldfy.git",
|
|
10
|
+
"directory": "packages/scaffoldfy"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"template",
|
|
14
|
+
"initialization",
|
|
15
|
+
"cli",
|
|
16
|
+
"automation",
|
|
17
|
+
"project-setup",
|
|
18
|
+
"monorepo"
|
|
19
|
+
],
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.js",
|
|
24
|
+
"require": "./dist/index.cjs"
|
|
25
|
+
},
|
|
26
|
+
"./schema": "./schema/tasks.schema.json"
|
|
27
|
+
},
|
|
28
|
+
"bin": {
|
|
29
|
+
"scaffoldfy": "./dist/cli.js"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"schema"
|
|
34
|
+
],
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@inquirer/prompts": "^7.9.0",
|
|
40
|
+
"commander": "^14.0.1",
|
|
41
|
+
"handlebars": "^4.7.8"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/handlebars": "^4.1.0",
|
|
45
|
+
"@types/node": "^22.18.11",
|
|
46
|
+
"eslint": "^9.38.0",
|
|
47
|
+
"tsdown": "^0.15.8",
|
|
48
|
+
"typescript": "^5.9.3",
|
|
49
|
+
"@internal/tsconfig": "0.1.0",
|
|
50
|
+
"@internal/vitest-config": "0.1.0",
|
|
51
|
+
"@internal/prettier-config": "0.0.1",
|
|
52
|
+
"@internal/eslint-config": "0.3.0",
|
|
53
|
+
"@internal/tsdown-config": "0.1.0"
|
|
54
|
+
},
|
|
55
|
+
"prettier": "@internal/prettier-config",
|
|
56
|
+
"scripts": {
|
|
57
|
+
"clean": "git clean -xdf .cache .turbo dist",
|
|
58
|
+
"clean:all": "git clean -xdf .cache .turbo dist node_modules",
|
|
59
|
+
"build": "tsdown",
|
|
60
|
+
"build:watch": "tsdown --watch",
|
|
61
|
+
"test": "vitest --run --passWithNoTests",
|
|
62
|
+
"test:watch": "vitest --watch",
|
|
63
|
+
"test:ui": "vitest --ui",
|
|
64
|
+
"test:coverage": "vitest --coverage",
|
|
65
|
+
"typecheck": "tsc --noEmit",
|
|
66
|
+
"lint": "eslint",
|
|
67
|
+
"format": "prettier --check . --ignore-path ../../.gitignore --ignore-path ../../.prettierignore"
|
|
68
|
+
},
|
|
69
|
+
"main": "./dist/index.cjs",
|
|
70
|
+
"module": "./dist/index.js",
|
|
71
|
+
"types": "./dist/index.d.ts"
|
|
72
|
+
}
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Template Initialization Tasks",
|
|
4
|
+
"description": "Configuration for template initialization cleanup tasks",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"tasks": {
|
|
8
|
+
"type": "array",
|
|
9
|
+
"items": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"required": [
|
|
12
|
+
"id",
|
|
13
|
+
"name",
|
|
14
|
+
"description",
|
|
15
|
+
"required",
|
|
16
|
+
"enabled",
|
|
17
|
+
"type",
|
|
18
|
+
"config"
|
|
19
|
+
],
|
|
20
|
+
"properties": {
|
|
21
|
+
"id": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Unique identifier for the task"
|
|
24
|
+
},
|
|
25
|
+
"name": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Human-readable task name"
|
|
28
|
+
},
|
|
29
|
+
"description": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "Detailed description of what the task does"
|
|
32
|
+
},
|
|
33
|
+
"required": {
|
|
34
|
+
"type": "boolean",
|
|
35
|
+
"description": "Whether failure of this task should stop the process"
|
|
36
|
+
},
|
|
37
|
+
"enabled": {
|
|
38
|
+
"type": "boolean",
|
|
39
|
+
"description": "Whether this task should be executed"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"items": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
},
|
|
46
|
+
"description": "IDs of tasks that must run before this one"
|
|
47
|
+
},
|
|
48
|
+
"prompts": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"description": "Interactive prompts to collect user input before running the task",
|
|
51
|
+
"items": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"required": ["id", "type", "message"],
|
|
54
|
+
"properties": {
|
|
55
|
+
"id": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"description": "Unique identifier for the prompt value (alphanumeric, underscores, and hyphens only)",
|
|
58
|
+
"pattern": "^[\\w-]+$"
|
|
59
|
+
},
|
|
60
|
+
"type": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"enum": ["input", "select", "confirm", "password", "number"],
|
|
63
|
+
"description": "Type of prompt to display"
|
|
64
|
+
},
|
|
65
|
+
"message": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"description": "Prompt message to display to the user"
|
|
68
|
+
},
|
|
69
|
+
"required": {
|
|
70
|
+
"type": "boolean",
|
|
71
|
+
"description": "Whether the prompt value is required (cannot be empty)"
|
|
72
|
+
},
|
|
73
|
+
"global": {
|
|
74
|
+
"type": "boolean",
|
|
75
|
+
"description": "If true, this prompt value is available to all tasks (not just the current task). Global prompts are collected once and shared across all tasks."
|
|
76
|
+
},
|
|
77
|
+
"default": {
|
|
78
|
+
"description": "Default value for the prompt. Can be a static value or an object with 'type' and 'value' properties for executable defaults.",
|
|
79
|
+
"oneOf": [
|
|
80
|
+
{
|
|
81
|
+
"description": "Static default value (string, number, or boolean)"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"type": "object",
|
|
85
|
+
"description": "Default value configuration for static or executable values",
|
|
86
|
+
"required": ["type", "value"],
|
|
87
|
+
"properties": {
|
|
88
|
+
"type": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"enum": ["value", "execute"],
|
|
91
|
+
"description": "Type of default value. 'value' for static values, 'execute' for command execution."
|
|
92
|
+
},
|
|
93
|
+
"value": {
|
|
94
|
+
"description": "For 'value' type: the static value. For 'execute' type: the shell command to execute. Commands can be any shell command including git, npm, node, etc. The command output will be trimmed and auto-parsed as JSON, number, or boolean when applicable."
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"placeholder": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"description": "Placeholder text (for input prompts)"
|
|
103
|
+
},
|
|
104
|
+
"min": {
|
|
105
|
+
"type": "number",
|
|
106
|
+
"description": "Minimum value (for number prompts)"
|
|
107
|
+
},
|
|
108
|
+
"max": {
|
|
109
|
+
"type": "number",
|
|
110
|
+
"description": "Maximum value (for number prompts)"
|
|
111
|
+
},
|
|
112
|
+
"choices": {
|
|
113
|
+
"type": "array",
|
|
114
|
+
"description": "Available choices (for select prompts)",
|
|
115
|
+
"items": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"required": ["name", "value"],
|
|
118
|
+
"properties": {
|
|
119
|
+
"name": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"description": "Display name for the choice"
|
|
122
|
+
},
|
|
123
|
+
"value": {
|
|
124
|
+
"description": "Value to use when this choice is selected"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"type": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"enum": [
|
|
135
|
+
"update-json",
|
|
136
|
+
"template",
|
|
137
|
+
"regex-replace",
|
|
138
|
+
"replace-in-file",
|
|
139
|
+
"delete",
|
|
140
|
+
"rename",
|
|
141
|
+
"git-init",
|
|
142
|
+
"exec"
|
|
143
|
+
],
|
|
144
|
+
"description": "Type of task to execute"
|
|
145
|
+
},
|
|
146
|
+
"config": {
|
|
147
|
+
"type": "object",
|
|
148
|
+
"description": "Task-specific configuration",
|
|
149
|
+
"oneOf": [
|
|
150
|
+
{
|
|
151
|
+
"title": "Update JSON Config",
|
|
152
|
+
"properties": {
|
|
153
|
+
"file": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"description": "Path to the JSON file to update"
|
|
156
|
+
},
|
|
157
|
+
"updates": {
|
|
158
|
+
"type": "object",
|
|
159
|
+
"description": "Key-value pairs to update (supports nested paths with dot notation)"
|
|
160
|
+
},
|
|
161
|
+
"condition": {
|
|
162
|
+
"type": "string",
|
|
163
|
+
"description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"required": ["file", "updates"]
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"title": "Template Config",
|
|
170
|
+
"properties": {
|
|
171
|
+
"file": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"description": "Path to the file to create or overwrite"
|
|
174
|
+
},
|
|
175
|
+
"template": {
|
|
176
|
+
"type": "string",
|
|
177
|
+
"description": "Inline template string with {{variable}} placeholders. Cannot be used with templateFile."
|
|
178
|
+
},
|
|
179
|
+
"templateFile": {
|
|
180
|
+
"type": "string",
|
|
181
|
+
"description": "Path to external template file (relative to project root). Files with .hbs extension automatically use Handlebars templating. Cannot be used with template."
|
|
182
|
+
},
|
|
183
|
+
"condition": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"required": ["file"],
|
|
189
|
+
"oneOf": [
|
|
190
|
+
{
|
|
191
|
+
"required": ["template"]
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"required": ["templateFile"]
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"title": "Regex Replace Config",
|
|
200
|
+
"properties": {
|
|
201
|
+
"file": {
|
|
202
|
+
"type": "string",
|
|
203
|
+
"description": "Path to the file to modify"
|
|
204
|
+
},
|
|
205
|
+
"pattern": {
|
|
206
|
+
"type": "string",
|
|
207
|
+
"description": "Regular expression pattern to find"
|
|
208
|
+
},
|
|
209
|
+
"flags": {
|
|
210
|
+
"type": "string",
|
|
211
|
+
"description": "Regex flags (e.g., 'g', 'gm', 'gi')"
|
|
212
|
+
},
|
|
213
|
+
"replacement": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"description": "String to replace matches with"
|
|
216
|
+
},
|
|
217
|
+
"condition": {
|
|
218
|
+
"type": "string",
|
|
219
|
+
"description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"required": ["file", "pattern", "replacement"]
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"title": "Replace In File Config",
|
|
226
|
+
"properties": {
|
|
227
|
+
"file": {
|
|
228
|
+
"type": "string",
|
|
229
|
+
"description": "Path to the file to modify"
|
|
230
|
+
},
|
|
231
|
+
"replacements": {
|
|
232
|
+
"type": "array",
|
|
233
|
+
"items": {
|
|
234
|
+
"type": "object",
|
|
235
|
+
"properties": {
|
|
236
|
+
"find": {
|
|
237
|
+
"type": "string",
|
|
238
|
+
"description": "String to find"
|
|
239
|
+
},
|
|
240
|
+
"replace": {
|
|
241
|
+
"type": "string",
|
|
242
|
+
"description": "String to replace with"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"required": ["find", "replace"]
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"condition": {
|
|
249
|
+
"type": "string",
|
|
250
|
+
"description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"required": ["file", "replacements"]
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"title": "Delete Config",
|
|
257
|
+
"properties": {
|
|
258
|
+
"paths": {
|
|
259
|
+
"type": "array",
|
|
260
|
+
"items": {
|
|
261
|
+
"type": "string"
|
|
262
|
+
},
|
|
263
|
+
"description": "Array of file or directory paths to delete"
|
|
264
|
+
},
|
|
265
|
+
"condition": {
|
|
266
|
+
"type": "string",
|
|
267
|
+
"description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"required": ["paths"]
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"title": "Rename Config",
|
|
274
|
+
"properties": {
|
|
275
|
+
"from": {
|
|
276
|
+
"type": "string",
|
|
277
|
+
"description": "Current file or directory path"
|
|
278
|
+
},
|
|
279
|
+
"to": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"description": "New file or directory path"
|
|
282
|
+
},
|
|
283
|
+
"condition": {
|
|
284
|
+
"type": "string",
|
|
285
|
+
"description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
"required": ["from", "to"]
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"title": "Git Init Config",
|
|
292
|
+
"properties": {
|
|
293
|
+
"removeExisting": {
|
|
294
|
+
"type": "boolean",
|
|
295
|
+
"description": "Whether to remove existing .git directory"
|
|
296
|
+
},
|
|
297
|
+
"initialCommit": {
|
|
298
|
+
"type": "boolean",
|
|
299
|
+
"description": "Whether to create an initial commit"
|
|
300
|
+
},
|
|
301
|
+
"message": {
|
|
302
|
+
"type": "string",
|
|
303
|
+
"description": "Initial commit message"
|
|
304
|
+
},
|
|
305
|
+
"condition": {
|
|
306
|
+
"type": "string",
|
|
307
|
+
"description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
"required": ["removeExisting", "initialCommit"]
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"title": "Exec Config",
|
|
314
|
+
"properties": {
|
|
315
|
+
"command": {
|
|
316
|
+
"type": "string",
|
|
317
|
+
"description": "Shell command to execute"
|
|
318
|
+
},
|
|
319
|
+
"cwd": {
|
|
320
|
+
"type": "string",
|
|
321
|
+
"description": "Working directory for the command"
|
|
322
|
+
},
|
|
323
|
+
"condition": {
|
|
324
|
+
"type": "string",
|
|
325
|
+
"description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
"required": ["command"]
|
|
329
|
+
}
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
"required": ["tasks"]
|
|
337
|
+
}
|