@stacksjs/actions 0.57.4 → 0.58.19

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 (158) hide show
  1. package/README.md +4 -4
  2. package/dist/src/add.js +29 -0
  3. package/dist/src/build/component-libs.js +6 -0
  4. package/dist/src/build/core.js +25 -0
  5. package/dist/src/build/stacks.js +8 -0
  6. package/dist/src/build.js +226 -0
  7. package/dist/src/bump.js +8 -0
  8. package/dist/src/changelog.js +9 -0
  9. package/dist/src/clean.js +6 -0
  10. package/dist/src/commit.js +17 -0
  11. package/dist/{copy-types.mjs → src/copy-types.js} +7 -4
  12. package/dist/src/database/seed.js +4 -0
  13. package/dist/src/deploy/index.js +31 -0
  14. package/dist/src/dev/components.js +11 -0
  15. package/dist/src/dev/docs.js +7 -0
  16. package/dist/src/dev/index.js +90 -0
  17. package/dist/{examples.mjs → src/examples.js} +18 -8
  18. package/dist/src/fresh.js +18 -0
  19. package/dist/src/generate/component-meta.js +57 -0
  20. package/dist/src/generate/ide-helpers.js +83 -0
  21. package/dist/src/generate/index.js +161 -0
  22. package/dist/src/generate/lib-entries.js +168 -0
  23. package/dist/src/generate/vscode-custom-data.js +82 -0
  24. package/dist/src/generate/vue-compat.js +18 -0
  25. package/dist/{helpers/component-meta.mjs → src/helpers/component-meta.js} +13 -13
  26. package/dist/src/helpers/index.js +56 -0
  27. package/dist/src/helpers/lib-entries.js +160 -0
  28. package/dist/src/helpers/package-json.js +135 -0
  29. package/dist/src/helpers/utils.js +56 -0
  30. package/dist/src/helpers/vscode-custom-data.js +75 -0
  31. package/dist/src/helpers/vue-compat.js +16 -0
  32. package/dist/src/index.js +577 -0
  33. package/dist/src/key-generate.js +10 -0
  34. package/dist/src/lint/fix.js +8 -0
  35. package/dist/src/lint/index.js +21 -0
  36. package/dist/{make.mjs → src/make.js} +71 -49
  37. package/dist/src/prepublish.js +14 -0
  38. package/dist/src/release.js +545 -0
  39. package/dist/src/test/coverage.js +6 -0
  40. package/dist/src/test/feature.js +6 -0
  41. package/dist/src/test/ui.js +6 -0
  42. package/dist/src/test/unit.js +6 -0
  43. package/dist/src/test.js +6 -0
  44. package/dist/src/tinker.js +5 -0
  45. package/dist/src/typecheck.js +6 -0
  46. package/dist/src/types.js +21 -0
  47. package/dist/src/upgrade/dependencies.js +6 -0
  48. package/dist/src/upgrade/framework.js +1 -0
  49. package/dist/src/upgrade/index.js +1 -0
  50. package/dist/src/upgrade.js +39 -0
  51. package/package.json +53 -239
  52. package/LICENSE.md +0 -21
  53. package/dist/add.d.ts +0 -11
  54. package/dist/add.mjs +0 -20
  55. package/dist/build/component-libs.d.ts +0 -1
  56. package/dist/build/component-libs.mjs +0 -4
  57. package/dist/build/core.d.ts +0 -1
  58. package/dist/build/core.mjs +0 -6
  59. package/dist/build/stacks.d.ts +0 -1
  60. package/dist/build/stacks.mjs +0 -12
  61. package/dist/build.d.ts +0 -14
  62. package/dist/build.mjs +0 -68
  63. package/dist/bump.d.ts +0 -1
  64. package/dist/bump.mjs +0 -6
  65. package/dist/changelog.d.ts +0 -1
  66. package/dist/changelog.mjs +0 -6
  67. package/dist/clean.d.ts +0 -1
  68. package/dist/clean.mjs +0 -10
  69. package/dist/commit.d.ts +0 -8
  70. package/dist/commit.mjs +0 -11
  71. package/dist/copy-types.d.ts +0 -5
  72. package/dist/deploy/domains.d.ts +0 -1
  73. package/dist/deploy/domains.mjs +0 -7
  74. package/dist/deploy/index.d.ts +0 -1
  75. package/dist/deploy/index.mjs +0 -3
  76. package/dist/dev/components.d.ts +0 -1
  77. package/dist/dev/components.mjs +0 -4
  78. package/dist/dev/docs.d.ts +0 -1
  79. package/dist/dev/docs.mjs +0 -4
  80. package/dist/dev/index.d.ts +0 -5
  81. package/dist/dev/index.mjs +0 -20
  82. package/dist/examples.d.ts +0 -10
  83. package/dist/fresh.d.ts +0 -1
  84. package/dist/fresh.mjs +0 -6
  85. package/dist/generate/component-meta.d.ts +0 -5
  86. package/dist/generate/component-meta.mjs +0 -8
  87. package/dist/generate/ide-helpers.d.ts +0 -6
  88. package/dist/generate/ide-helpers.mjs +0 -9
  89. package/dist/generate/index.d.ts +0 -17
  90. package/dist/generate/index.mjs +0 -93
  91. package/dist/generate/lib-entries.d.ts +0 -2
  92. package/dist/generate/lib-entries.mjs +0 -14
  93. package/dist/generate/settings.d.ts +0 -1
  94. package/dist/generate/settings.mjs +0 -1
  95. package/dist/generate/vscode-custom-data.d.ts +0 -6
  96. package/dist/generate/vscode-custom-data.mjs +0 -8
  97. package/dist/generate/vue-compat.d.ts +0 -6
  98. package/dist/generate/vue-compat.mjs +0 -3
  99. package/dist/helpers/component-meta.d.ts +0 -22
  100. package/dist/helpers/index.d.ts +0 -6
  101. package/dist/helpers/index.mjs +0 -6
  102. package/dist/helpers/lib-entries.d.ts +0 -13
  103. package/dist/helpers/lib-entries.mjs +0 -101
  104. package/dist/helpers/package-json.d.ts +0 -3
  105. package/dist/helpers/package-json.mjs +0 -82
  106. package/dist/helpers/utils.d.ts +0 -19
  107. package/dist/helpers/utils.mjs +0 -40
  108. package/dist/helpers/vscode-custom-data.d.ts +0 -1
  109. package/dist/helpers/vscode-custom-data.mjs +0 -22
  110. package/dist/helpers/vue-compat.d.ts +0 -1
  111. package/dist/helpers/vue-compat.mjs +0 -12
  112. package/dist/index.d.ts +0 -1
  113. package/dist/index.mjs +0 -1
  114. package/dist/key-generate.d.ts +0 -1
  115. package/dist/key-generate.mjs +0 -8
  116. package/dist/lint/fix.d.ts +0 -1
  117. package/dist/lint/fix.mjs +0 -4
  118. package/dist/lint/index.d.ts +0 -1
  119. package/dist/lint/index.mjs +0 -14
  120. package/dist/make.d.ts +0 -25
  121. package/dist/migrate.d.ts +0 -1
  122. package/dist/migrate.mjs +0 -2
  123. package/dist/preinstall.d.ts +0 -8
  124. package/dist/preinstall.mjs +0 -17
  125. package/dist/prepublish.d.ts +0 -1
  126. package/dist/prepublish.mjs +0 -11
  127. package/dist/release.d.ts +0 -2
  128. package/dist/release.mjs +0 -16
  129. package/dist/seed.d.ts +0 -1
  130. package/dist/seed.mjs +0 -2
  131. package/dist/test/coverage.d.ts +0 -1
  132. package/dist/test/coverage.mjs +0 -4
  133. package/dist/test/feature.d.ts +0 -1
  134. package/dist/test/feature.mjs +0 -4
  135. package/dist/test/ui.d.ts +0 -1
  136. package/dist/test/ui.mjs +0 -4
  137. package/dist/test/unit.d.ts +0 -1
  138. package/dist/test/unit.mjs +0 -4
  139. package/dist/test.d.ts +0 -1
  140. package/dist/test.mjs +0 -4
  141. package/dist/tinker.d.ts +0 -1
  142. package/dist/tinker.mjs +0 -3
  143. package/dist/typecheck.d.ts +0 -1
  144. package/dist/typecheck.mjs +0 -4
  145. package/dist/types.d.ts +0 -8
  146. package/dist/types.mjs +0 -14
  147. package/dist/upgrade/dependencies.d.ts +0 -0
  148. package/dist/upgrade/dependencies.mjs +0 -0
  149. package/dist/upgrade/framework.d.ts +0 -0
  150. package/dist/upgrade/framework.mjs +0 -0
  151. package/dist/upgrade/index.d.ts +0 -0
  152. package/dist/upgrade/index.mjs +0 -0
  153. package/dist/upgrade/node.d.ts +0 -0
  154. package/dist/upgrade/node.mjs +0 -0
  155. package/dist/upgrade/package-manager.d.ts +0 -0
  156. package/dist/upgrade/package-manager.mjs +0 -0
  157. package/dist/upgrade.d.ts +0 -5
  158. package/dist/upgrade.mjs +0 -55
@@ -1,28 +1,30 @@
1
- import { italic, log, spawn } from "@stacksjs/cli";
2
- import { createFolder, doesFolderExist, writeTextFile } from "@stacksjs/storage";
3
- import { frameworkPath, projectPath, resolve } from "@stacksjs/path";
4
- export async function invoke(options) {
1
+ // @bun
2
+ // src/make.ts
3
+ import process from "process";
4
+ import {italic} from "@stacksjs/cli";
5
+ import {log} from "@stacksjs/logging";
6
+ import {createFolder, doesFolderExist, writeTextFile} from "@stacksjs/storage";
7
+ import {frameworkPath, projectPath, resolve} from "@stacksjs/path";
8
+ async function invoke(options) {
5
9
  if (options.component)
6
- await component(options);
10
+ await makeComponent(options);
7
11
  if (options.database)
8
- await database(options);
9
- if (options.factory)
10
- await factory(options);
12
+ makeDatabase(options);
11
13
  if (options.function)
12
- await fx(options);
14
+ await makeFunction(options);
13
15
  if (options.language)
14
- await language(options);
16
+ await makeLanguage(options);
15
17
  if (options.notification)
16
- await notification(options);
18
+ await makeNotification(options);
17
19
  if (options.page)
18
- await page(options);
20
+ await makePage(options);
19
21
  if (options.stack)
20
- await stack(options);
22
+ makeStack(options);
21
23
  }
22
- export async function make(options) {
24
+ async function make(options) {
23
25
  return invoke(options);
24
26
  }
25
- export async function component(options) {
27
+ async function makeComponent(options) {
26
28
  try {
27
29
  const name = options.name;
28
30
  log.info("Creating your component...");
@@ -33,14 +35,14 @@ export async function component(options) {
33
35
  process.exit();
34
36
  }
35
37
  }
36
- export async function createComponent(options) {
38
+ async function createComponent(options) {
37
39
  const name = options.name;
38
40
  await writeTextFile({
39
- path: `./components/${name}.vue`,
41
+ path: `./components/${name}.stx`,
40
42
  data: `<script setup lang="ts">
41
43
  // eslint-disable-next-line no-console
42
44
  console.log('Hello World component created')
43
- <\/script>
45
+ </script>
44
46
 
45
47
  <template>
46
48
  <div>
@@ -50,35 +52,35 @@ console.log('Hello World component created')
50
52
  `
51
53
  });
52
54
  }
53
- export async function database(options) {
55
+ function makeDatabase(options) {
54
56
  try {
55
57
  const name = options.name;
56
58
  log.info(`Creating your ${italic(name)} database...`);
57
- await createDatabase(options);
59
+ createDatabase(options);
58
60
  log.success(`Created the ${italic(name)} database`);
59
61
  } catch (error) {
60
62
  log.error("There was an error creating your database", error);
61
63
  process.exit();
62
64
  }
63
65
  }
64
- export async function createDatabase(options) {
66
+ function createDatabase(options) {
65
67
  console.log("options", options);
66
68
  }
67
- export async function factory(options) {
69
+ function factory(options) {
68
70
  try {
69
71
  const name = options.name;
70
72
  log.info(`Creating your ${italic(name)} factory...`);
71
- await createDatabase(options);
73
+ createDatabase(options);
72
74
  log.success(`Created the ${italic(name)} factory`);
73
75
  } catch (error) {
74
76
  log.error("There was an error creating your factory", error);
75
77
  process.exit();
76
78
  }
77
79
  }
78
- export async function createFactory(options) {
80
+ function createFactory(options) {
79
81
  console.log("options", options);
80
82
  }
81
- export async function notification(options) {
83
+ async function makeNotification(options) {
82
84
  try {
83
85
  const name = options.name;
84
86
  log.info(`Creating your ${italic(name)} notification...`);
@@ -89,25 +91,25 @@ export async function notification(options) {
89
91
  process.exit();
90
92
  }
91
93
  }
92
- export async function page(options) {
94
+ async function makePage(options) {
93
95
  try {
94
96
  const name = options.name;
95
97
  log.info("Creating your page...");
96
- createPage(options);
98
+ await createPage(options);
97
99
  log.success(`Created the ${name} page`);
98
100
  } catch (error) {
99
101
  log.error("There was an error creating your page", error);
100
102
  process.exit();
101
103
  }
102
104
  }
103
- export async function createPage(options) {
105
+ async function createPage(options) {
104
106
  const name = options.name;
105
107
  await writeTextFile({
106
- path: `./pages/${name}.vue`,
108
+ path: `./pages/${name}.stx`,
107
109
  data: `<script setup lang="ts">
108
110
  // eslint-disable-next-line no-console
109
111
  console.log('Hello World page created')
110
- <\/script>
112
+ </script>
111
113
 
112
114
  <template>
113
115
  <div>
@@ -117,7 +119,7 @@ console.log('Hello World page created')
117
119
  `
118
120
  });
119
121
  }
120
- export async function fx(options) {
122
+ async function makeFunction(options) {
121
123
  try {
122
124
  const name = options.name;
123
125
  log.info("Creating your function...");
@@ -128,7 +130,7 @@ export async function fx(options) {
128
130
  process.exit();
129
131
  }
130
132
  }
131
- export async function createFunction(options) {
133
+ async function createFunction(options) {
132
134
  const name = options.name;
133
135
  await writeTextFile({
134
136
  path: `./functions/${name}.ts`,
@@ -147,18 +149,18 @@ export {
147
149
  `
148
150
  });
149
151
  }
150
- export async function language(options) {
152
+ async function makeLanguage(options) {
151
153
  try {
152
154
  const name = options.name;
153
155
  log.info("Creating your translation file...");
154
- createLanguage(options);
156
+ await createLanguage(options);
155
157
  log.success(`Created the ${name} translation file`);
156
158
  } catch (error) {
157
159
  log.error("There was an error creating your language.", error);
158
160
  process.exit();
159
161
  }
160
162
  }
161
- export async function createLanguage(options) {
163
+ async function createLanguage(options) {
162
164
  const name = options.name;
163
165
  await writeTextFile({
164
166
  path: `./lang/${name}.yml`,
@@ -167,20 +169,19 @@ export async function createLanguage(options) {
167
169
  `
168
170
  });
169
171
  }
170
- export async function stack(options) {
172
+ function makeStack(options) {
171
173
  try {
172
174
  const name = options.name;
173
175
  log.info(`Creating your ${name} stack...`);
174
- const path = resolve(process.cwd(), name);
175
- await spawn(`giget stacks ${path}`);
176
+ const path2 = resolve(process.cwd(), name);
176
177
  log.success("Successfully scaffolded your project");
177
- log.info(`cd ${path} && pnpm install`);
178
+ log.info(`cd ${path2} && bun install`);
178
179
  } catch (error) {
179
180
  log.error("There was an error creating your stack", error);
180
181
  process.exit();
181
182
  }
182
183
  }
183
- export async function createNotification(options) {
184
+ async function createNotification(options) {
184
185
  const name = options.name;
185
186
  try {
186
187
  let importOption = "EmailOptions";
@@ -192,7 +193,7 @@ export async function createNotification(options) {
192
193
  importOption = "SMSOptions";
193
194
  await writeTextFile({
194
195
  path: `./notifications/${name}.ts`,
195
- data: `import type { ${importOption} } from '@stacksjs/types'
196
+ data: `import type { ${importOption} } from \'@stacksjs/types\'
196
197
 
197
198
  function content(): string {
198
199
  return 'example'
@@ -209,14 +210,14 @@ function send(): ${importOption} {
209
210
  return false;
210
211
  }
211
212
  }
212
- export async function createMigration(options) {
213
+ async function createMigration(options) {
213
214
  const optionName = options.name;
214
215
  const table = "dummy-name";
215
216
  const name = optionName[0].toUpperCase() + optionName.slice(1);
216
- const path = frameworkPath(`database/migrations/${name}.ts`);
217
+ const path2 = frameworkPath(`database/migrations/${name}.ts`);
217
218
  try {
218
219
  await writeTextFile({
219
- path: `${path}`,
220
+ path: `${path2}`,
220
221
  data: `import { Kysely } from 'kysely'
221
222
 
222
223
  export async function up(db: Kysely<any>): Promise<void> {
@@ -226,18 +227,18 @@ export async function up(db: Kysely<any>): Promise<void> {
226
227
  .execute()
227
228
  }`
228
229
  });
229
- log.success(`Successfully created your migration file at .stacks/database/migrations/${name}.ts`);
230
+ log.success(`Successfully created your migration file at stacks/database/migrations/${name}.ts`);
230
231
  } catch (error) {
231
232
  log.error(error);
232
233
  }
233
234
  }
234
- export async function createModel(options) {
235
+ async function createModel(options) {
235
236
  const optionName = options.name;
236
237
  const name = optionName[0].toUpperCase() + optionName.slice(1);
237
- const path = projectPath(`app/models/${name}.ts`);
238
+ const path2 = projectPath(`app/Models/${name}.ts`);
238
239
  try {
239
240
  await writeTextFile({
240
- path: `${path}`,
241
+ path: `${path2}`,
241
242
  data: `import { faker } from '@stacksjs/faker'
242
243
  import { validate } from '@stacksjs/validation'
243
244
  import type { Model } from '@stacksjs/types'
@@ -262,8 +263,29 @@ export default <Model> {
262
263
  },
263
264
  }`
264
265
  });
265
- log.success(`Successfully created your model at app/models/${name}.ts`);
266
+ log.success(`Successfully created your model at app/Models/${name}.ts`);
266
267
  } catch (error) {
267
268
  log.error(error);
268
269
  }
269
270
  }
271
+ export {
272
+ makeStack,
273
+ makePage,
274
+ makeNotification,
275
+ makeLanguage,
276
+ makeFunction,
277
+ makeDatabase,
278
+ makeComponent,
279
+ make,
280
+ invoke,
281
+ factory,
282
+ createPage,
283
+ createNotification,
284
+ createModel,
285
+ createMigration,
286
+ createLanguage,
287
+ createFunction,
288
+ createFactory,
289
+ createDatabase,
290
+ createComponent
291
+ };
@@ -0,0 +1,14 @@
1
+ // @bun
2
+ // src/prepublish.ts
3
+ import process from "process";
4
+ import {log} from "@stacksjs/logging";
5
+ import {runtimePath} from "@stacksjs/path";
6
+ import {runNpmScript} from "@stacksjs/utils";
7
+ import {NpmScript} from "@stacksjs/enums";
8
+ log.info("Running prepublish command...");
9
+ var result = await runNpmScript(NpmScript.BuildStacks, { verbose: true, cwd: runtimePath() });
10
+ if (result.isErr()) {
11
+ log.error(new Error("There was an error while prepublishing your stack"), result.error);
12
+ process.exit();
13
+ }
14
+ log.success("Prepublishing completed");