@stacksjs/actions 0.52.8 → 0.52.10
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/dist/generate/index.mjs +3 -3
- package/dist/helpers/package-json.d.ts +3 -1
- package/dist/helpers/package-json.mjs +3 -3
- package/dist/make.mjs +16 -18
- package/dist/release.mjs +5 -3
- package/package.json +25 -25
package/dist/generate/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { seed } from "@stacksjs/database";
|
|
|
3
3
|
import { Action, NpmScript } from "@stacksjs/types";
|
|
4
4
|
import { runNpmScript } from "@stacksjs/utils";
|
|
5
5
|
import { runCommand } from "@stacksjs/cli";
|
|
6
|
-
import { frameworkPath } from "@stacksjs/path";
|
|
6
|
+
import { frameworkPath, projectPath } from "@stacksjs/path";
|
|
7
7
|
import { runAction } from "../helpers/index.mjs";
|
|
8
8
|
export async function invoke(options) {
|
|
9
9
|
if (options?.types)
|
|
@@ -25,12 +25,12 @@ export async function generate(options) {
|
|
|
25
25
|
return invoke(options);
|
|
26
26
|
}
|
|
27
27
|
export async function libEntries(options) {
|
|
28
|
-
const result = await
|
|
28
|
+
const result = await runAction(Action.GeneratePackageJsons, { ...options, verbose: true, cwd: projectPath() });
|
|
29
29
|
if (result.isErr()) {
|
|
30
30
|
log.error("There was an error generating your library entry points.", result.error);
|
|
31
31
|
process.exit();
|
|
32
32
|
}
|
|
33
|
-
log.success("Library entry points
|
|
33
|
+
log.success("Library entry points generated successfully");
|
|
34
34
|
}
|
|
35
35
|
export async function vueCompat(options) {
|
|
36
36
|
const result = await runNpmScript(NpmScript.GenerateVueCompat, options);
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
type PackageJsonType = 'vue-components' | 'web-components' | 'functions';
|
|
2
|
+
export declare function generatePackageJson(type: PackageJsonType): Promise<void>;
|
|
3
|
+
export {};
|
|
@@ -30,7 +30,7 @@ export async function generatePackageJson(type) {
|
|
|
30
30
|
"name": "${name}",
|
|
31
31
|
"type": "module",
|
|
32
32
|
"version": "",
|
|
33
|
-
"packageManager": "${packageManager}",
|
|
33
|
+
"packageManager": "${await packageManager()}",
|
|
34
34
|
"description": "${description}",
|
|
35
35
|
"author": "${library.author}",
|
|
36
36
|
"license": "MIT",
|
|
@@ -75,8 +75,8 @@ export async function generatePackageJson(type) {
|
|
|
75
75
|
prettyName = "Web Component library";
|
|
76
76
|
else if (type === "functions")
|
|
77
77
|
prettyName = "Function Library";
|
|
78
|
-
log.success(`Created the ${prettyName} package.json file
|
|
78
|
+
log.success(`Created the ${prettyName} package.json file`);
|
|
79
79
|
} catch (err) {
|
|
80
|
-
log.error(`There was an error creating the ${prettyName} package.json
|
|
80
|
+
log.error(`There was an error creating the ${prettyName} package.json`, err);
|
|
81
81
|
}
|
|
82
82
|
}
|
package/dist/make.mjs
CHANGED
|
@@ -12,8 +12,6 @@ export async function invoke(options) {
|
|
|
12
12
|
await fx(options);
|
|
13
13
|
if (options.language)
|
|
14
14
|
await language(options);
|
|
15
|
-
if (options.migration)
|
|
16
|
-
await migration(options);
|
|
17
15
|
if (options.notification)
|
|
18
16
|
await notification(options);
|
|
19
17
|
if (options.page)
|
|
@@ -29,9 +27,9 @@ export async function component(options) {
|
|
|
29
27
|
const name = options.name;
|
|
30
28
|
log.info("Creating your component...");
|
|
31
29
|
await createComponent(options);
|
|
32
|
-
log.success(`Created the ${italic(name)} component
|
|
30
|
+
log.success(`Created the ${italic(name)} component`);
|
|
33
31
|
} catch (error) {
|
|
34
|
-
log.error("There was an error creating your component
|
|
32
|
+
log.error("There was an error creating your component", error);
|
|
35
33
|
process.exit();
|
|
36
34
|
}
|
|
37
35
|
}
|
|
@@ -57,9 +55,9 @@ export async function database(options) {
|
|
|
57
55
|
const name = options.name;
|
|
58
56
|
log.info(`Creating your ${italic(name)} database...`);
|
|
59
57
|
await createDatabase(options);
|
|
60
|
-
log.success(`Created the ${italic(name)} database
|
|
58
|
+
log.success(`Created the ${italic(name)} database`);
|
|
61
59
|
} catch (error) {
|
|
62
|
-
log.error("There was an error creating your database
|
|
60
|
+
log.error("There was an error creating your database", error);
|
|
63
61
|
process.exit();
|
|
64
62
|
}
|
|
65
63
|
}
|
|
@@ -71,9 +69,9 @@ export async function factory(options) {
|
|
|
71
69
|
const name = options.name;
|
|
72
70
|
log.info(`Creating your ${italic(name)} factory...`);
|
|
73
71
|
await createDatabase(options);
|
|
74
|
-
log.success(`Created the ${italic(name)} factory
|
|
72
|
+
log.success(`Created the ${italic(name)} factory`);
|
|
75
73
|
} catch (error) {
|
|
76
|
-
log.error("There was an error creating your factory
|
|
74
|
+
log.error("There was an error creating your factory", error);
|
|
77
75
|
process.exit();
|
|
78
76
|
}
|
|
79
77
|
}
|
|
@@ -85,9 +83,9 @@ export async function notification(options) {
|
|
|
85
83
|
const name = options.name;
|
|
86
84
|
log.info(`Creating your ${italic(name)} notification...`);
|
|
87
85
|
await createNotification(options);
|
|
88
|
-
log.success(`Created the ${italic(name)} notification
|
|
86
|
+
log.success(`Created the ${italic(name)} notification`);
|
|
89
87
|
} catch (error) {
|
|
90
|
-
log.error("There was an error creating your notification
|
|
88
|
+
log.error("There was an error creating your notification", error);
|
|
91
89
|
process.exit();
|
|
92
90
|
}
|
|
93
91
|
}
|
|
@@ -96,9 +94,9 @@ export async function page(options) {
|
|
|
96
94
|
const name = options.name;
|
|
97
95
|
log.info("Creating your page...");
|
|
98
96
|
createPage(options);
|
|
99
|
-
log.success(`Created the ${name} page
|
|
97
|
+
log.success(`Created the ${name} page`);
|
|
100
98
|
} catch (error) {
|
|
101
|
-
log.error("There was an error creating your page
|
|
99
|
+
log.error("There was an error creating your page", error);
|
|
102
100
|
process.exit();
|
|
103
101
|
}
|
|
104
102
|
}
|
|
@@ -124,9 +122,9 @@ export async function fx(options) {
|
|
|
124
122
|
const name = options.name;
|
|
125
123
|
log.info("Creating your function...");
|
|
126
124
|
await createFunction(options);
|
|
127
|
-
log.success(`Created the ${name} function
|
|
125
|
+
log.success(`Created the ${name} function`);
|
|
128
126
|
} catch (error) {
|
|
129
|
-
log.error("There was an error creating your function
|
|
127
|
+
log.error("There was an error creating your function", error);
|
|
130
128
|
process.exit();
|
|
131
129
|
}
|
|
132
130
|
}
|
|
@@ -154,7 +152,7 @@ export async function language(options) {
|
|
|
154
152
|
const name = options.name;
|
|
155
153
|
log.info("Creating your translation file...");
|
|
156
154
|
createLanguage(options);
|
|
157
|
-
log.success(`Created the ${name} translation file
|
|
155
|
+
log.success(`Created the ${name} translation file`);
|
|
158
156
|
} catch (error) {
|
|
159
157
|
log.error("There was an error creating your language.", error);
|
|
160
158
|
process.exit();
|
|
@@ -178,7 +176,7 @@ export async function stack(options) {
|
|
|
178
176
|
log.success("Successfully scaffolded your project");
|
|
179
177
|
log.info(`cd ${path} && pnpm install`);
|
|
180
178
|
} catch (error) {
|
|
181
|
-
log.error("There was an error creating your stack
|
|
179
|
+
log.error("There was an error creating your stack", error);
|
|
182
180
|
process.exit();
|
|
183
181
|
}
|
|
184
182
|
}
|
|
@@ -213,7 +211,7 @@ function send(): ${importOption} {
|
|
|
213
211
|
}
|
|
214
212
|
export async function createMigration(options) {
|
|
215
213
|
const optionName = options.name;
|
|
216
|
-
const table =
|
|
214
|
+
const table = "dummy-name";
|
|
217
215
|
const name = optionName[0].toUpperCase() + optionName.slice(1);
|
|
218
216
|
const path = frameworkPath(`database/migrations/${name}.ts`);
|
|
219
217
|
try {
|
|
@@ -240,7 +238,7 @@ export async function createModel(options) {
|
|
|
240
238
|
try {
|
|
241
239
|
await writeTextFile({
|
|
242
240
|
path: `${path}`,
|
|
243
|
-
data: `import { faker } from '../../.stacks/core/faker/src' // stacks/faker or
|
|
241
|
+
data: `import { faker } from '../../.stacks/core/faker/src' // stacks/faker or
|
|
244
242
|
import { validate } from '../../.stacks/core/validation/src' // stacks/validate or @stacksjs/validate
|
|
245
243
|
import type { Model } from '../../.stacks/core/types/src' // stacks/types or @stacksjs/types
|
|
246
244
|
|
package/dist/release.mjs
CHANGED
|
@@ -3,9 +3,11 @@ import { frameworkPath } from "@stacksjs/path";
|
|
|
3
3
|
import { runActions } from "@stacksjs/actions";
|
|
4
4
|
import { Action } from "@stacksjs/types";
|
|
5
5
|
await runActions([
|
|
6
|
-
|
|
7
|
-
//
|
|
6
|
+
Action.GeneratePackageJsons,
|
|
7
|
+
// generate the package.json's for each package
|
|
8
|
+
Action.LintFix,
|
|
9
|
+
// ensure there are no lint errors
|
|
8
10
|
// Action.Test, // run the tests
|
|
9
11
|
Action.Bump
|
|
10
|
-
// bump the versions, create the git
|
|
12
|
+
// bump the versions, create the git tag, generate the changelog, commit & push the changes
|
|
11
13
|
], { verbose: true, cwd: frameworkPath(), shell: true });
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/actions",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.52.
|
|
4
|
+
"version": "0.52.10",
|
|
5
5
|
"packageManager": "pnpm@8.5.1",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
@@ -240,39 +240,39 @@
|
|
|
240
240
|
"peerDependencies": {
|
|
241
241
|
"markdown-it": "^13.0.1",
|
|
242
242
|
"vue-component-meta": "^1.6.5",
|
|
243
|
-
"@stacksjs/cli": "0.52.
|
|
244
|
-
"@stacksjs/config": "0.52.
|
|
245
|
-
"@stacksjs/database": "0.52.
|
|
246
|
-
"@stacksjs/error-handling": "0.52.
|
|
247
|
-
"@stacksjs/logging": "0.52.
|
|
248
|
-
"@stacksjs/pages": "0.52.
|
|
249
|
-
"@stacksjs/path": "0.52.
|
|
250
|
-
"@stacksjs/security": "0.52.
|
|
251
|
-
"@stacksjs/storage": "0.52.
|
|
252
|
-
"@stacksjs/types": "0.52.
|
|
253
|
-
"@stacksjs/utils": "0.52.
|
|
243
|
+
"@stacksjs/cli": "0.52.10",
|
|
244
|
+
"@stacksjs/config": "0.52.10",
|
|
245
|
+
"@stacksjs/database": "0.52.10",
|
|
246
|
+
"@stacksjs/error-handling": "0.52.10",
|
|
247
|
+
"@stacksjs/logging": "0.52.10",
|
|
248
|
+
"@stacksjs/pages": "0.52.10",
|
|
249
|
+
"@stacksjs/path": "0.52.10",
|
|
250
|
+
"@stacksjs/security": "0.52.10",
|
|
251
|
+
"@stacksjs/storage": "0.52.10",
|
|
252
|
+
"@stacksjs/types": "0.52.10",
|
|
253
|
+
"@stacksjs/utils": "0.52.10"
|
|
254
254
|
},
|
|
255
255
|
"dependencies": {
|
|
256
256
|
"fast-glob": "^3.2.12",
|
|
257
257
|
"fs-extra": "^11.1.1",
|
|
258
258
|
"markdown-it": "^13.0.1",
|
|
259
259
|
"vue-component-meta": "^1.6.5",
|
|
260
|
-
"@stacksjs/cli": "0.52.
|
|
261
|
-
"@stacksjs/config": "0.52.
|
|
262
|
-
"@stacksjs/database": "0.52.
|
|
263
|
-
"@stacksjs/error-handling": "0.52.
|
|
264
|
-
"@stacksjs/logging": "0.52.
|
|
265
|
-
"@stacksjs/pages": "0.52.
|
|
266
|
-
"@stacksjs/path": "0.52.
|
|
267
|
-
"@stacksjs/security": "0.52.
|
|
268
|
-
"@stacksjs/storage": "0.52.
|
|
269
|
-
"@stacksjs/strings": "0.52.
|
|
270
|
-
"@stacksjs/utils": "0.52.
|
|
260
|
+
"@stacksjs/cli": "0.52.10",
|
|
261
|
+
"@stacksjs/config": "0.52.10",
|
|
262
|
+
"@stacksjs/database": "0.52.10",
|
|
263
|
+
"@stacksjs/error-handling": "0.52.10",
|
|
264
|
+
"@stacksjs/logging": "0.52.10",
|
|
265
|
+
"@stacksjs/pages": "0.52.10",
|
|
266
|
+
"@stacksjs/path": "0.52.10",
|
|
267
|
+
"@stacksjs/security": "0.52.10",
|
|
268
|
+
"@stacksjs/storage": "0.52.10",
|
|
269
|
+
"@stacksjs/strings": "0.52.10",
|
|
270
|
+
"@stacksjs/utils": "0.52.10"
|
|
271
271
|
},
|
|
272
272
|
"devDependencies": {
|
|
273
273
|
"unbuild": "^1.2.1",
|
|
274
|
-
"@stacksjs/development": "0.52.
|
|
275
|
-
"@stacksjs/types": "0.52.
|
|
274
|
+
"@stacksjs/development": "0.52.10",
|
|
275
|
+
"@stacksjs/types": "0.52.10"
|
|
276
276
|
},
|
|
277
277
|
"scripts": {
|
|
278
278
|
"build": "unbuild",
|