directus-template-cli 0.6.0-beta.2 → 0.7.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +0 -14
  2. package/dist/commands/apply.js +1 -1
  3. package/dist/commands/extract.d.ts +0 -2
  4. package/dist/commands/extract.js +2 -29
  5. package/dist/commands/init.d.ts +37 -0
  6. package/dist/commands/init.js +178 -0
  7. package/dist/lib/constants.d.ts +16 -0
  8. package/dist/lib/constants.js +17 -1
  9. package/dist/lib/extract/extract-content.d.ts +1 -1
  10. package/dist/lib/extract/extract-content.js +5 -9
  11. package/dist/lib/extract/extract-fields.js +1 -1
  12. package/dist/lib/extract/index.d.ts +1 -6
  13. package/dist/lib/extract/index.js +5 -12
  14. package/dist/lib/init/config.d.ts +3 -0
  15. package/dist/lib/init/config.js +15 -0
  16. package/dist/lib/init/index.d.ts +14 -0
  17. package/dist/lib/init/index.js +167 -0
  18. package/dist/lib/init/types.d.ts +30 -0
  19. package/dist/lib/init/types.js +2 -0
  20. package/dist/lib/load/load-collections.d.ts +2 -0
  21. package/dist/lib/load/load-collections.js +2 -0
  22. package/dist/lib/utils/animated-bunny.d.ts +2 -0
  23. package/dist/lib/utils/animated-bunny.js +71 -0
  24. package/dist/lib/utils/ensure-dir.d.ts +2 -0
  25. package/dist/lib/utils/ensure-dir.js +16 -0
  26. package/dist/lib/utils/get-template.js +2 -1
  27. package/dist/lib/utils/parse-github-url.d.ts +14 -0
  28. package/dist/lib/utils/parse-github-url.js +54 -0
  29. package/dist/lib/utils/wait.d.ts +7 -0
  30. package/dist/lib/utils/wait.js +13 -0
  31. package/dist/services/docker.d.ts +23 -0
  32. package/dist/services/docker.js +137 -0
  33. package/dist/services/github.d.ts +18 -0
  34. package/dist/services/github.js +57 -0
  35. package/oclif.manifest.json +81 -21
  36. package/package.json +14 -3
@@ -182,8 +182,7 @@
182
182
  "description": "Extract a template from a Directus instance.",
183
183
  "examples": [
184
184
  "$ directus-template-cli extract",
185
- "$ directus-template-cli extract -p --templateName=\"My Template\" --templateLocation=\"./my-template\" --directusToken=\"admin-token-here\" --directusUrl=\"http://localhost:8055\"",
186
- "$ directus-template-cli extract -p --templateName=\"My Template\" --templateLocation=\"./my-template\" --directusToken=\"admin-token-here\" --directusUrl=\"http://localhost:8055\" --excludeCollections=collection1,collection2"
185
+ "$ directus-template-cli extract -p --templateName=\"My Template\" --templateLocation=\"./my-template\" --directusToken=\"admin-token-here\" --directusUrl=\"http://localhost:8055\""
187
186
  ],
188
187
  "flags": {
189
188
  "directusToken": {
@@ -206,16 +205,6 @@
206
205
  "multiple": false,
207
206
  "type": "option"
208
207
  },
209
- "excludeCollections": {
210
- "char": "e",
211
- "description": "Comma-separated list of collection names to exclude from extraction",
212
- "name": "excludeCollections",
213
- "required": false,
214
- "delimiter": ",",
215
- "hasDynamicHelp": false,
216
- "multiple": true,
217
- "type": "option"
218
- },
219
208
  "programmatic": {
220
209
  "char": "p",
221
210
  "description": "Run in programmatic mode (non-interactive) for use cases such as CI/CD pipelines.",
@@ -224,14 +213,6 @@
224
213
  "allowNo": false,
225
214
  "type": "boolean"
226
215
  },
227
- "skipFiles": {
228
- "char": "f",
229
- "description": "Skip extracting files and assets",
230
- "name": "skipFiles",
231
- "required": false,
232
- "allowNo": false,
233
- "type": "boolean"
234
- },
235
216
  "templateLocation": {
236
217
  "dependsOn": [
237
218
  "programmatic"
@@ -297,7 +278,86 @@
297
278
  "commands",
298
279
  "extract.js"
299
280
  ]
281
+ },
282
+ "init": {
283
+ "aliases": [],
284
+ "args": {
285
+ "directory": {
286
+ "default": ".",
287
+ "description": "Directory to create the project in",
288
+ "name": "directory",
289
+ "required": false
290
+ }
291
+ },
292
+ "description": "Initialize a new Directus + Frontend monorepo using official or community starters.",
293
+ "examples": [
294
+ "$ directus-template-cli init",
295
+ "$ directus-template-cli init my-project",
296
+ "$ directus-template-cli init --frontend=nextjs --template=simple-cms --programmatic",
297
+ "$ directus-template-cli init my-project --frontend=nextjs --template=simple-cms --programmatic"
298
+ ],
299
+ "flags": {
300
+ "frontend": {
301
+ "description": "Frontend framework to use (e.g., nextjs, nuxt, astro)",
302
+ "name": "frontend",
303
+ "hasDynamicHelp": false,
304
+ "multiple": false,
305
+ "type": "option"
306
+ },
307
+ "gitInit": {
308
+ "aliases": [
309
+ "git-init"
310
+ ],
311
+ "description": "Initialize a new Git repository",
312
+ "name": "gitInit",
313
+ "allowNo": true,
314
+ "type": "boolean"
315
+ },
316
+ "installDeps": {
317
+ "aliases": [
318
+ "install-deps"
319
+ ],
320
+ "description": "Install dependencies automatically",
321
+ "name": "installDeps",
322
+ "allowNo": true,
323
+ "type": "boolean"
324
+ },
325
+ "overrideDir": {
326
+ "description": "Override the default directory",
327
+ "name": "overrideDir",
328
+ "allowNo": false,
329
+ "type": "boolean"
330
+ },
331
+ "programmatic": {
332
+ "char": "p",
333
+ "description": "Run in programmatic mode (non-interactive)",
334
+ "name": "programmatic",
335
+ "allowNo": false,
336
+ "type": "boolean"
337
+ },
338
+ "template": {
339
+ "description": "Template name (e.g., simple-cms) or GitHub URL (e.g., https://github.com/directus-labs/starters/tree/main/simple-cms)",
340
+ "name": "template",
341
+ "hasDynamicHelp": false,
342
+ "multiple": false,
343
+ "type": "option"
344
+ }
345
+ },
346
+ "hasDynamicHelp": false,
347
+ "hiddenAliases": [],
348
+ "id": "init",
349
+ "pluginAlias": "directus-template-cli",
350
+ "pluginName": "directus-template-cli",
351
+ "pluginType": "core",
352
+ "strict": true,
353
+ "enableJsonFlag": false,
354
+ "isESM": false,
355
+ "relativePath": [
356
+ "dist",
357
+ "commands",
358
+ "init.js"
359
+ ]
300
360
  }
301
361
  },
302
- "version": "0.6.0-beta.2"
362
+ "version": "0.7.0-beta.2"
303
363
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "directus-template-cli",
3
- "version": "0.6.0-beta.2",
3
+ "version": "0.7.0-beta.2",
4
4
  "description": "CLI Utility for applying templates to a Directus instance.",
5
5
  "author": "bryantgillespie @bryantgillespie",
6
6
  "bin": {
@@ -17,16 +17,25 @@
17
17
  "/oclif.manifest.json"
18
18
  ],
19
19
  "dependencies": {
20
+ "@clack/prompts": "^0.10.0",
20
21
  "@directus/sdk": "^17.0.1",
21
22
  "@oclif/core": "^3.18.1",
22
23
  "@oclif/plugin-help": "^6.0.12",
23
24
  "@oclif/plugin-plugins": "^4.1.22",
25
+ "@octokit/rest": "^21.1.1",
24
26
  "bottleneck": "^2.19.5",
27
+ "chalk": "^5.4.1",
25
28
  "defu": "^6.1.4",
26
29
  "dotenv": "^16.4.1",
30
+ "execa": "^9.5.2",
27
31
  "formdata-node": "^6.0.3",
28
32
  "giget": "^1.2.1",
33
+ "glob": "^11.0.1",
29
34
  "inquirer": "^8.2.5",
35
+ "log-update": "^6.1.0",
36
+ "nypm": "^0.5.2",
37
+ "picocolors": "^1.1.1",
38
+ "pkg-types": "^1.3.1",
30
39
  "slugify": "^1.6.6"
31
40
  },
32
41
  "devDependencies": {
@@ -64,7 +73,8 @@
64
73
  "posttest": "npm run lint",
65
74
  "prepack": "npm run build && oclif manifest && oclif readme",
66
75
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
67
- "version": "oclif readme && git add README.md"
76
+ "version": "oclif readme && git add README.md",
77
+ "run": "./bin/run"
68
78
  },
69
79
  "engines": {
70
80
  "node": ">=18.0.0"
@@ -77,5 +87,6 @@
77
87
  "directus cms",
78
88
  "directus cli"
79
89
  ],
80
- "types": "dist/index.d.ts"
90
+ "types": "dist/index.d.ts",
91
+ "packageManager": "pnpm@9.15.4+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0"
81
92
  }