@stacksjs/actions 0.58.73 → 0.59.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.
Files changed (108) hide show
  1. package/dist/action.d.ts +36 -0
  2. package/dist/add.d.ts +6 -0
  3. package/dist/build/component-libs.d.ts +1 -0
  4. package/dist/build/core.d.ts +1 -0
  5. package/dist/build/stacks.d.ts +1 -0
  6. package/dist/build.d.ts +9 -0
  7. package/dist/bump.d.ts +1 -0
  8. package/dist/changelog.d.ts +1 -0
  9. package/dist/clean.d.ts +1 -0
  10. package/dist/commit.d.ts +3 -0
  11. package/dist/copy-types.d.ts +5 -0
  12. package/dist/database/seed.d.ts +1 -0
  13. package/dist/deploy/index.d.ts +1 -0
  14. package/dist/dev/components.d.ts +1 -0
  15. package/dist/dev/docs.d.ts +1 -0
  16. package/dist/dev/index.d.ts +10 -0
  17. package/dist/examples.d.ts +5 -0
  18. package/dist/fresh.d.ts +1 -0
  19. package/dist/generate/component-meta.d.ts +5 -0
  20. package/dist/generate/ide-helpers.d.ts +6 -0
  21. package/dist/generate/index.d.ts +13 -0
  22. package/dist/generate/lib-entries.d.ts +2 -0
  23. package/dist/generate/vscode-custom-data.d.ts +6 -0
  24. package/dist/helpers/component-meta.d.ts +22 -0
  25. package/dist/helpers/lib-entries.d.ts +13 -0
  26. package/dist/helpers/package-json.d.ts +3 -0
  27. package/dist/helpers/utils.d.ts +18 -0
  28. package/dist/helpers/vscode-custom-data.d.ts +2 -0
  29. package/dist/index.d.ts +7 -0
  30. package/dist/key-generate.d.ts +1 -0
  31. package/dist/lint/fix.d.ts +1 -0
  32. package/dist/lint/index.d.ts +1 -0
  33. package/dist/make.d.ts +20 -0
  34. package/dist/prepublish.d.ts +1 -0
  35. package/dist/release.d.ts +2 -0
  36. package/dist/test/coverage.d.ts +1 -0
  37. package/dist/test/feature.d.ts +1 -0
  38. package/dist/test/ui.d.ts +1 -0
  39. package/dist/test/unit.d.ts +1 -0
  40. package/dist/test.d.ts +1 -0
  41. package/dist/tinker.d.ts +1 -0
  42. package/dist/typecheck.d.ts +1 -0
  43. package/dist/types.d.ts +3 -0
  44. package/dist/upgrade/dependencies.d.ts +1 -0
  45. package/dist/upgrade/framework.d.ts +1 -0
  46. package/dist/upgrade/index.d.ts +1 -0
  47. package/dist/upgrade.d.ts +4 -0
  48. package/package.json +5 -3
  49. package/src/bump.ts +8 -3
  50. package/src/check/ports.ts +11 -8
  51. package/src/deploy/index.ts +2 -6
  52. package/src/dev/index.ts +1 -1
  53. package/src/find-projects.ts +1 -1
  54. package/src/generate/index.ts +1 -1
  55. package/src/helpers/utils.ts +10 -14
  56. package/src/index.ts +1 -2
  57. package/src/lint/fix.ts +1 -0
  58. package/src/upgrade/shell.ts +5 -5
  59. package/dist/src/add.js +0 -29
  60. package/dist/src/build/component-libs.js +0 -6
  61. package/dist/src/build/core.js +0 -21
  62. package/dist/src/build/stacks.js +0 -8
  63. package/dist/src/build.js +0 -219
  64. package/dist/src/bump.js +0 -14
  65. package/dist/src/changelog.js +0 -17
  66. package/dist/src/clean.js +0 -6
  67. package/dist/src/commit.js +0 -17
  68. package/dist/src/copy-types.js +0 -14
  69. package/dist/src/database/seed.js +0 -1
  70. package/dist/src/deploy/index.js +0 -31
  71. package/dist/src/dev/components.js +0 -11
  72. package/dist/src/dev/docs.js +0 -7
  73. package/dist/src/dev/index.js +0 -92
  74. package/dist/src/examples.js +0 -43
  75. package/dist/src/fresh.js +0 -18
  76. package/dist/src/generate/component-meta.js +0 -59
  77. package/dist/src/generate/ide-helpers.js +0 -91
  78. package/dist/src/generate/index.js +0 -154
  79. package/dist/src/generate/lib-entries.js +0 -170
  80. package/dist/src/generate/vscode-custom-data.js +0 -91
  81. package/dist/src/helpers/component-meta.js +0 -50
  82. package/dist/src/helpers/index.js +0 -48
  83. package/dist/src/helpers/lib-entries.js +0 -161
  84. package/dist/src/helpers/package-json.js +0 -136
  85. package/dist/src/helpers/utils.js +0 -48
  86. package/dist/src/helpers/vscode-custom-data.js +0 -83
  87. package/dist/src/index.js +0 -590
  88. package/dist/src/key-generate.js +0 -10
  89. package/dist/src/lint/fix.js +0 -12
  90. package/dist/src/lint/index.js +0 -17
  91. package/dist/src/make.js +0 -291
  92. package/dist/src/prepublish.js +0 -14
  93. package/dist/src/release.js +0 -559
  94. package/dist/src/test/coverage.js +0 -6
  95. package/dist/src/test/feature.js +0 -6
  96. package/dist/src/test/ui.js +0 -6
  97. package/dist/src/test/unit.js +0 -6
  98. package/dist/src/test.js +0 -6
  99. package/dist/src/tinker.js +0 -5
  100. package/dist/src/typecheck.js +0 -6
  101. package/dist/src/types.js +0 -21
  102. package/dist/src/upgrade/dependencies.js +0 -6
  103. package/dist/src/upgrade/framework.js +0 -1
  104. package/dist/src/upgrade/index.js +0 -58
  105. package/dist/src/upgrade.js +0 -47
  106. package/src/generate/caddyfile.ts +0 -44
  107. package/src/helpers/index.ts +0 -1
  108. package/src/start-caddy.ts +0 -13
package/dist/src/index.js DELETED
@@ -1,590 +0,0 @@
1
- // @bun
2
- // src/helpers/utils.ts
3
- import * as storage from "@stacksjs/storage";
4
- import {buddyOptions, runCommand, runCommands} from "@stacksjs/cli";
5
- import {log} from "@stacksjs/logging";
6
- import * as p from "@stacksjs/path";
7
- import {err, handleError} from "@stacksjs/error-handling";
8
- async function runAction(action, options) {
9
- const opts = buddyOptions();
10
- const path = p.relativeActionsPath(`${action}.ts`);
11
- const cmd = `bun --bun ${path} ${opts}`.trimEnd();
12
- const optionsWithCwd = {
13
- cwd: options?.cwd || p.projectPath(),
14
- ...options
15
- };
16
- log.debug("runAction:", cmd);
17
- log.debug("action options:", optionsWithCwd);
18
- if (!hasAction(action))
19
- return err(handleError(`The specified action "${action}" does not exist`));
20
- return await runCommand(cmd, optionsWithCwd);
21
- }
22
- async function runActions(actions, options) {
23
- log.debug("runActions:", actions);
24
- log.debug("actions options:", options);
25
- if (!actions.length)
26
- return err("No actions were specified");
27
- for (const action of actions) {
28
- if (!hasAction(action))
29
- return err(`The specified action "${action}" does not exist`);
30
- }
31
- const opts = buddyOptions();
32
- const o = {
33
- cwd: options?.cwd || p.projectPath(),
34
- ...options
35
- };
36
- const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)} ${opts}`);
37
- return await runCommands(commands, o);
38
- }
39
- function hasAction(action) {
40
- if (storage.isFile(p.functionsPath(`actions/${action}.ts`)))
41
- return true;
42
- return storage.isFile(p.actionsPath(`${action}.ts`));
43
- }
44
- // src/dev/index.ts
45
- import {log as log2} from "@stacksjs/logging";
46
- import {Action} from "@stacksjs/enums";
47
- async function runDevServer(options) {
48
- log2.info("Starting your Frontend Engine...");
49
- await runAction(Action.Dev, options);
50
- }
51
- async function runFrontendDevServer(options) {
52
- log2.info("Starting your UI Engine...");
53
- await runAction(Action.Dev, options);
54
- }
55
- async function runBackendDevServer(options) {
56
- runApiDevServer(options);
57
- }
58
- async function runApiDevServer(options) {
59
- log2.info("Starting your API...");
60
- await runAction(Action.DevApi, options);
61
- }
62
- async function runComponentsDevServer(options) {
63
- log2.info("Starting your Library Engine...");
64
- await runAction(Action.DevComponents, options);
65
- }
66
- async function runDashboardDevServer(options) {
67
- log2.info("Starting your Dashboard...");
68
- await runAction(Action.DevDashboard, options);
69
- }
70
- async function runSystemTrayDevServer(options) {
71
- log2.info("Starting your System Tray...");
72
- await runAction(Action.DevSystemTray, options);
73
- }
74
- async function runDesktopDevServer(options) {
75
- log2.info("Starting your Desktop Engine...");
76
- await runAction(Action.DevDesktop, options);
77
- }
78
- async function runDocsDevServer(options) {
79
- log2.info("Starting your Docs Engine...");
80
- await runAction(Action.DevDocs, options);
81
- }
82
-
83
- // src/generate/index.ts
84
- import process from "process";
85
- import {log as log3} from "@stacksjs/logging";
86
- import {Action as Action2, NpmScript} from "@stacksjs/enums";
87
- import {runCommand as runCommand2} from "@stacksjs/cli";
88
- import {runNpmScript} from "@stacksjs/utils";
89
- import {frameworkPath, projectPath as projectPath2} from "@stacksjs/path";
90
- async function invoke(options) {
91
- if (options?.types)
92
- await generateTypes(options);
93
- else if (options?.entries)
94
- await generateLibEntries(options);
95
- else if (options?.webTypes)
96
- await generateWebTypes(options);
97
- else if (options?.customData)
98
- await generateVsCodeCustomData(options);
99
- else if (options?.ideHelpers)
100
- await generateIdeHelpers(options);
101
- else if (options?.componentMeta)
102
- await generateComponentMeta(options);
103
- else if (options?.coreSymlink)
104
- await generateCoreSymlink();
105
- }
106
- function generate(options) {
107
- return invoke(options);
108
- }
109
- async function generateLibEntries(options) {
110
- const result = await runAction(Action2.GenerateLibraryEntries, {
111
- ...options,
112
- cwd: projectPath2()
113
- });
114
- if (result.isErr()) {
115
- log3.error("There was an error generating your library entry points", result.error);
116
- process.exit();
117
- }
118
- log3.success("Library entry points generated successfully");
119
- }
120
- async function generateWebTypes(options) {
121
- const result = await runNpmScript(NpmScript.GenerateWebTypes, options);
122
- if (result.isErr()) {
123
- log3.error("There was an error generating the web-types.json file.", result.error);
124
- process.exit();
125
- }
126
- log3.success("Successfully generated the web-types.json file");
127
- }
128
- async function generateVsCodeCustomData(options) {
129
- const result = await runNpmScript(NpmScript.GenerateVsCodeCustomData, {
130
- cwd: frameworkPath(),
131
- ...options
132
- });
133
- if (result.isErr()) {
134
- log3.error("There was an error generating the custom-elements.json file.", result.error);
135
- process.exit();
136
- }
137
- await runAction(Action2.LintFix, { verbose: true });
138
- log3.success("Successfully generated the custom-elements.json file");
139
- }
140
- async function generateIdeHelpers(options) {
141
- const result = await runNpmScript(NpmScript.GenerateIdeHelpers, options);
142
- if (result.isErr()) {
143
- log3.error("There was an error generating IDE helpers.", result.error);
144
- process.exit();
145
- }
146
- await runAction(Action2.LintFix, { verbose: true });
147
- log3.success("Successfully generated IDE helpers");
148
- }
149
- async function generateComponentMeta(options) {
150
- const result = await runNpmScript(NpmScript.GenerateComponentMeta, options);
151
- if (result.isErr()) {
152
- log3.error("There was an error generating your component meta information.", result.error);
153
- process.exit();
154
- }
155
- await runAction(Action2.LintFix, { verbose: true });
156
- log3.success("Successfully generated component meta information");
157
- }
158
- async function generateTypes(options) {
159
- const result = await runNpmScript(NpmScript.GenerateTypes, {
160
- cwd: frameworkPath(),
161
- ...options
162
- });
163
- if (result.isErr()) {
164
- log3.error("There was an error generating your types.", result.error);
165
- process.exit();
166
- }
167
- log3.success("Types were generated successfully");
168
- }
169
- function generateMigrations() {
170
- log3.success("Successfully updated migrations");
171
- }
172
- function generatePkgxConfig() {
173
- log3.success("Successfully generated `./pkgx.yaml` based on your config");
174
- }
175
- async function generateSeeder() {
176
- }
177
- async function generateCoreSymlink() {
178
- await runCommand2(`ln -s ${frameworkPath()} ${projectPath2(".stacks")}`);
179
- }
180
-
181
- // src/examples.ts
182
- import process2 from "process";
183
- import {log as log4} from "@stacksjs/logging";
184
- import {hasComponents} from "@stacksjs/storage";
185
- import {runNpmScript as runNpmScript2} from "@stacksjs/utils";
186
- import {ExitCode} from "@stacksjs/types";
187
- import {NpmScript as NpmScript2} from "@stacksjs/enums";
188
- async function invoke2(options) {
189
- if (options.components || options.vue)
190
- await componentExample(options);
191
- else if (options.webComponents || options.elements)
192
- await webComponentExample(options);
193
- else
194
- log4.error("An unsupported option was used. Please try again, check the documentation & report the issue, if needed.");
195
- }
196
- async function examples(options) {
197
- return invoke2(options);
198
- }
199
- async function componentExample(options) {
200
- if (hasComponents()) {
201
- await runNpmScript2(NpmScript2.ExampleVue, options);
202
- log4.success("Your component library was built successfully");
203
- } else {
204
- log4.info("No components found.");
205
- }
206
- }
207
- async function webComponentExample(options) {
208
- if (hasComponents()) {
209
- log4.info("Building your Web Component library...");
210
- await runNpmScript2(NpmScript2.BuildWebComponents, options);
211
- log4.success("Your Web Component library was built successfully");
212
- } else {
213
- log4.info("No components found.");
214
- process2.exit(ExitCode.FatalError);
215
- }
216
- }
217
-
218
- // src/commit.ts
219
- import {log as log5} from "@stacksjs/logging";
220
- import {runNpmScript as runNpmScript3} from "@stacksjs/utils";
221
- import {NpmScript as NpmScript3} from "@stacksjs/enums";
222
- async function invoke3(options) {
223
- log5.info("Committing...");
224
- await runNpmScript3(NpmScript3.Commit, options);
225
- log5.success("Committed");
226
- }
227
- async function commit(options) {
228
- return invoke3(options);
229
- }
230
-
231
- // src/add.ts
232
- import {installPackage} from "@stacksjs/cli";
233
- async function invoke4(options) {
234
- if (options?.table)
235
- await addTable();
236
- if (options?.calendar)
237
- await addCalendar();
238
- }
239
- async function add(options) {
240
- return invoke4(options);
241
- }
242
- async function addTable() {
243
- await installPackage("@stacksjs/table");
244
- }
245
- async function addCalendar() {
246
- await installPackage("@stacksjs/calendar");
247
- }
248
- async function installPackages(names) {
249
- for (const name of names)
250
- await installPackage(name);
251
- }
252
-
253
- // src/make.ts
254
- import process3 from "process";
255
- import {italic} from "@stacksjs/cli";
256
- import {log as log6} from "@stacksjs/logging";
257
- import {createFolder, doesFolderExist, writeTextFile} from "@stacksjs/storage";
258
- import {frameworkPath as frameworkPath2, projectPath as projectPath3, resolve} from "@stacksjs/path";
259
- async function invoke5(options) {
260
- if (options.component)
261
- await makeComponent(options);
262
- if (options.database)
263
- makeDatabase(options);
264
- if (options.function)
265
- await makeFunction(options);
266
- if (options.language)
267
- await makeLanguage(options);
268
- if (options.notification)
269
- await makeNotification(options);
270
- if (options.page)
271
- await makePage(options);
272
- if (options.stack)
273
- makeStack(options);
274
- }
275
- async function make(options) {
276
- return invoke5(options);
277
- }
278
- async function makeComponent(options) {
279
- try {
280
- const name = options.name;
281
- log6.info("Creating your component...");
282
- await createComponent(options);
283
- log6.success(`Created ${italic(name)} component`);
284
- } catch (error) {
285
- log6.error("There was an error creating your component", error);
286
- process3.exit();
287
- }
288
- }
289
- async function createComponent(options) {
290
- const name = options.name;
291
- await writeTextFile({
292
- path: `./components/${name}.stx`,
293
- data: `<script setup lang="ts">
294
- // eslint-disable-next-line no-console
295
- console.log('Hello World component created')
296
- </script>
297
-
298
- <template>
299
- <div>
300
- Some HTML block
301
- </div>
302
- </template>
303
- `
304
- });
305
- }
306
- function makeDatabase(options) {
307
- try {
308
- const name = options.name;
309
- log6.info(`Creating your ${italic(name)} database...`);
310
- createDatabase(options);
311
- log6.success(`Created ${italic(name)} database`);
312
- } catch (error) {
313
- log6.error("There was an error creating your database", error);
314
- process3.exit();
315
- }
316
- }
317
- function createDatabase(options) {
318
- console.log("options", options);
319
- }
320
- function factory(options) {
321
- try {
322
- const name = options.name;
323
- log6.info(`Creating your ${italic(name)} factory...`);
324
- createDatabase(options);
325
- log6.success(`Created ${italic(name)} factory`);
326
- } catch (error) {
327
- log6.error("There was an error creating your factory", error);
328
- process3.exit();
329
- }
330
- }
331
- function createFactory(options) {
332
- console.log("options", options);
333
- }
334
- async function makeNotification(options) {
335
- try {
336
- const name = options.name;
337
- log6.info(`Creating your ${italic(name)} notification...`);
338
- await createNotification(options);
339
- log6.success(`Created ${italic(name)} notification`);
340
- } catch (error) {
341
- log6.error("There was an error creating your notification", error);
342
- process3.exit();
343
- }
344
- }
345
- async function makePage(options) {
346
- try {
347
- const name = options.name;
348
- log6.info("Creating your page...");
349
- await createPage(options);
350
- log6.success(`Created ${name} page`);
351
- } catch (error) {
352
- log6.error("There was an error creating your page", error);
353
- process3.exit();
354
- }
355
- }
356
- async function createPage(options) {
357
- const name = options.name;
358
- await writeTextFile({
359
- path: `./pages/${name}.stx`,
360
- data: `<script setup lang="ts">
361
- // eslint-disable-next-line no-console
362
- console.log('Hello World page created')
363
- </script>
364
-
365
- <template>
366
- <div>
367
- Visit http://127.0.0.1/${name}
368
- </div>
369
- </template>
370
- `
371
- });
372
- }
373
- async function makeFunction(options) {
374
- try {
375
- const name = options.name;
376
- log6.info("Creating your function...");
377
- await createFunction(options);
378
- log6.success(`Created ${name} function`);
379
- } catch (error) {
380
- log6.error("There was an error creating your function", error);
381
- process3.exit();
382
- }
383
- }
384
- async function createFunction(options) {
385
- const name = options.name;
386
- await writeTextFile({
387
- path: `./functions/${name}.ts`,
388
- data: `// reactive state
389
- const ${name} = ref(0)
390
-
391
- // functions that mutate state and trigger updates
392
- function increment() {
393
- ${name}.value++
394
- }
395
-
396
- export {
397
- ${name},
398
- increment,
399
- }
400
- `
401
- });
402
- }
403
- async function makeLanguage(options) {
404
- try {
405
- const name = options.name;
406
- log6.info("Creating your translation file...");
407
- await createLanguage(options);
408
- log6.success(`Created ${name} translation file`);
409
- } catch (error) {
410
- log6.error("There was an error creating your language.", error);
411
- process3.exit();
412
- }
413
- }
414
- async function createLanguage(options) {
415
- const name = options.name;
416
- await writeTextFile({
417
- path: `./lang/${name}.yml`,
418
- data: `button:
419
- text: Copy
420
- `
421
- });
422
- }
423
- function makeStack(options) {
424
- try {
425
- const name = options.name;
426
- log6.info(`Creating your ${name} stack...`);
427
- const path3 = resolve(process3.cwd(), name);
428
- log6.success("Successfully scaffolded your project");
429
- log6.info(`cd ${path3} && bun install`);
430
- } catch (error) {
431
- log6.error("There was an error creating your stack", error);
432
- process3.exit();
433
- }
434
- }
435
- async function createNotification(options) {
436
- const name = options.name;
437
- try {
438
- let importOption = "EmailOptions";
439
- if (!doesFolderExist("notifications"))
440
- await createFolder("./notifications");
441
- if (options.chat)
442
- importOption = "ChatOptions";
443
- if (options.sms)
444
- importOption = "SMSOptions";
445
- await writeTextFile({
446
- path: `./notifications/${name}.ts`,
447
- data: `import type { ${importOption} } from \'@stacksjs/types\'
448
-
449
- function content(): string {
450
- return 'example'
451
- }
452
-
453
- function send(): ${importOption} {
454
- return {
455
- content: content(),
456
- }
457
- }`
458
- });
459
- return true;
460
- } catch (error) {
461
- return false;
462
- }
463
- }
464
- async function createMigration(options) {
465
- const optionName = options.name;
466
- const table = "dummy-name";
467
- const name = optionName[0].toUpperCase() + optionName.slice(1);
468
- const path3 = frameworkPath2(`database/migrations/${name}.ts`);
469
- try {
470
- await writeTextFile({
471
- path: `${path3}`,
472
- data: `import { Kysely } from 'kysely'
473
-
474
- export async function up(db: Kysely<any>): Promise<void> {
475
- await db.schema
476
- .createTable('${table}')
477
- .addColumn('id', 'integer', (col) => col.autoIncrement().primaryKey())
478
- .execute()
479
- }`
480
- });
481
- log6.success(`Successfully created your migration file at stacks/database/migrations/${name}.ts`);
482
- } catch (error) {
483
- log6.error(error);
484
- }
485
- }
486
- async function createModel(options) {
487
- const optionName = options.name;
488
- const name = optionName[0].toUpperCase() + optionName.slice(1);
489
- const path3 = projectPath3(`app/Models/${name}.ts`);
490
- try {
491
- await writeTextFile({
492
- path: `${path3}`,
493
- data: `import { faker } from '@stacksjs/faker'
494
- import { validate } from '@stacksjs/validation'
495
- import type { Model } from '@stacksjs/types'
496
-
497
- export default <Model> {
498
- name: '${name}',
499
-
500
- searchable: true, // boolean | IndexSettings,
501
- authenticatable: true, // boolean | AuthSettings,
502
-
503
- seeder: {
504
- count: 10,
505
- },
506
-
507
- fields: {
508
- name: {
509
- validation: validate.string().min(3).max(255),
510
- factory: () => faker.person,
511
- },
512
-
513
- // more fields here
514
- },
515
- }`
516
- });
517
- log6.success(`Successfully created your model at app/Models/${name}.ts`);
518
- } catch (error) {
519
- log6.error(error);
520
- }
521
- }
522
-
523
- // src/action.ts
524
- class Action3 {
525
- name;
526
- description;
527
- fields;
528
- rate;
529
- tries;
530
- backoff;
531
- enabled;
532
- handle;
533
- constructor({ name, description, fields, handle, rate, tries, backoff, enabled }) {
534
- this.name = name;
535
- this.description = description;
536
- this.fields = fields;
537
- this.rate = rate;
538
- this.tries = tries;
539
- this.backoff = backoff;
540
- this.enabled = enabled;
541
- this.handle = handle;
542
- }
543
- }
544
- export {
545
- runSystemTrayDevServer,
546
- make as runMake,
547
- runFrontendDevServer,
548
- examples as runExample,
549
- runDocsDevServer,
550
- runDevServer,
551
- runDesktopDevServer,
552
- runDashboardDevServer,
553
- runComponentsDevServer,
554
- commit as runCommit,
555
- runBackendDevServer,
556
- runApiDevServer,
557
- add as runAdd,
558
- runActions,
559
- runAction,
560
- makeStack,
561
- makePage,
562
- makeNotification,
563
- makeLanguage,
564
- makeFunction,
565
- makeDatabase,
566
- makeComponent,
567
- invoke,
568
- hasAction,
569
- generateWebTypes,
570
- generateVsCodeCustomData,
571
- generateTypes,
572
- generateSeeder,
573
- generatePkgxConfig,
574
- generateMigrations,
575
- generateLibEntries,
576
- generateIdeHelpers,
577
- generateCoreSymlink,
578
- generateComponentMeta,
579
- generate,
580
- createPage,
581
- createNotification,
582
- createModel,
583
- createMigration,
584
- createLanguage,
585
- createFunction,
586
- createFactory,
587
- createDatabase,
588
- createComponent,
589
- Action3 as Action
590
- };
@@ -1,10 +0,0 @@
1
- // @bun
2
- // src/key-generate.ts
3
- import {runCommand} from "@stacksjs/cli";
4
- import {isFile} from "@stacksjs/storage";
5
- import {setEnvValue} from "@stacksjs/utils";
6
- import {projectPath} from "@stacksjs/path";
7
- import {generateAppKey} from "@stacksjs/security";
8
- if (!isFile(".env"))
9
- await runCommand("cp .env.example .env", { cwd: projectPath() });
10
- await setEnvValue("APP_KEY", generateAppKey());
@@ -1,12 +0,0 @@
1
- // @bun
2
- // src/lint/fix.ts
3
- import {log, parseOptions, runCommand} from "@stacksjs/cli";
4
- import {projectPath} from "@stacksjs/path";
5
- import {NpmScript} from "@stacksjs/enums";
6
- log.info("Ensuring Code Style...");
7
- var options = parseOptions();
8
- await runCommand(NpmScript.LintFix, {
9
- cwd: projectPath(),
10
- ...options
11
- });
12
- log.success("Linted");
@@ -1,17 +0,0 @@
1
- // @bun
2
- // src/lint/index.ts
3
- import process from "process";
4
- import {ExitCode} from "@stacksjs/types";
5
- import {NpmScript} from "@stacksjs/enums";
6
- import {log, runCommands} from "@stacksjs/cli";
7
- import {projectPath} from "@stacksjs/path";
8
- log.info("Ensuring Code Style...");
9
- var result = await runCommands([
10
- NpmScript.Lint,
11
- NpmScript.LintPackageJson
12
- ], { cwd: projectPath() });
13
- if (Array.isArray(result)) {
14
- if (result.map((r) => r.isErr()).includes(true))
15
- process.exit(ExitCode.FatalError);
16
- }
17
- log.success("Linted");