@stacksjs/actions 0.46.3 → 0.47.4
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/helpers/package-json.mjs +1 -1
- package/dist/key-generate.d.ts +1 -0
- package/dist/key-generate.mjs +8 -0
- package/dist/lint-fix.mjs +2 -2
- package/package.json +14 -13
- package/dist/key.d.ts +0 -10
- package/dist/key.mjs +0 -31
|
@@ -2,7 +2,7 @@ import { log } from "@stacksjs/logging";
|
|
|
2
2
|
import { writeTextFile } from "@stacksjs/storage";
|
|
3
3
|
import { packageJsonPath } from "@stacksjs/path";
|
|
4
4
|
import { library } from "@stacksjs/config";
|
|
5
|
-
import { packageManager } from "../../package.json"
|
|
5
|
+
import { packageManager } from "../../package.json";
|
|
6
6
|
export async function generatePackageJson(type) {
|
|
7
7
|
let name, description, directory, keywords, config, prettyName;
|
|
8
8
|
if (type === "vue-components") {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { runCommand } from "@stacksjs/cli";
|
|
2
|
+
import { isFile } from "@stacksjs/storage";
|
|
3
|
+
import { setEnvValue } from "@stacksjs/utils";
|
|
4
|
+
import { options } from "kolorist";
|
|
5
|
+
import { generateAppKey } from "@stacksjs/security";
|
|
6
|
+
if (!isFile(".env"))
|
|
7
|
+
await runCommand("cp .env.example .env", { ...options, cwd: projectPath() });
|
|
8
|
+
await setEnvValue("APP_KEY", await generateAppKey());
|
package/dist/lint-fix.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { runCommands } from "@stacksjs/cli";
|
|
2
2
|
import { projectPath } from "@stacksjs/path";
|
|
3
3
|
import { NpmScript } from "@stacksjs/types";
|
|
4
|
-
await
|
|
4
|
+
await runCommands([NpmScript.LintFix], { cwd: projectPath(), shouldShowSpinner: true, spinnerText: "Linting..." });
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/actions",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "0.47.4",
|
|
5
|
+
"packageManager": "pnpm@7.21.0",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"license": "MIT",
|
|
@@ -37,27 +37,28 @@
|
|
|
37
37
|
],
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=v18.12.1",
|
|
40
|
-
"pnpm": ">=7.
|
|
40
|
+
"pnpm": ">=7.21.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"markdown-it": "^13.0.1",
|
|
44
|
-
"vue-component-meta": "^1.0.
|
|
45
|
-
"@stacksjs/cli": "0.
|
|
46
|
-
"@stacksjs/config": "0.
|
|
47
|
-
"@stacksjs/logging": "0.
|
|
48
|
-
"@stacksjs/path": "0.
|
|
49
|
-
"@stacksjs/
|
|
50
|
-
"@stacksjs/
|
|
51
|
-
"@stacksjs/
|
|
44
|
+
"vue-component-meta": "^1.0.18",
|
|
45
|
+
"@stacksjs/cli": "0.47.4",
|
|
46
|
+
"@stacksjs/config": "0.47.4",
|
|
47
|
+
"@stacksjs/logging": "0.47.4",
|
|
48
|
+
"@stacksjs/path": "0.47.4",
|
|
49
|
+
"@stacksjs/security": "0.47.4",
|
|
50
|
+
"@stacksjs/storage": "0.47.4",
|
|
51
|
+
"@stacksjs/types": "0.47.4",
|
|
52
|
+
"@stacksjs/utils": "0.47.4"
|
|
52
53
|
},
|
|
53
54
|
"dependencies": {
|
|
54
55
|
"esno": "^0.16.3",
|
|
55
|
-
"@stacksjs/strings": "0.
|
|
56
|
+
"@stacksjs/strings": "0.47.4"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
59
|
"mkdist": "^1.0.0",
|
|
59
60
|
"typescript": "^4.9.4",
|
|
60
|
-
"@stacksjs/testing": "0.
|
|
61
|
+
"@stacksjs/testing": "0.47.4"
|
|
61
62
|
},
|
|
62
63
|
"scripts": {
|
|
63
64
|
"build": "mkdist -d",
|
package/dist/key.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { CliOptions as KeyOptions } from '@stacksjs/types';
|
|
2
|
-
export declare function invoke(options: KeyOptions): Promise<void>;
|
|
3
|
-
/**
|
|
4
|
-
* An alias of the invoke method.
|
|
5
|
-
* @param options
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare function key(options: KeyOptions): Promise<void>;
|
|
9
|
-
export declare function generate(options: KeyOptions): Promise<boolean>;
|
|
10
|
-
export declare function generateAppKey(): Promise<string>;
|
package/dist/key.mjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { getRandomValues } from "node:crypto";
|
|
2
|
-
import { log, runCommand } from "@stacksjs/cli";
|
|
3
|
-
import { setEnvValue } from "@stacksjs/utils";
|
|
4
|
-
import { isFile } from "@stacksjs/storage";
|
|
5
|
-
import utf8 from "crypto-js/enc-utf8";
|
|
6
|
-
import base64 from "crypto-js/enc-base64";
|
|
7
|
-
export async function invoke(options) {
|
|
8
|
-
await generate(options);
|
|
9
|
-
}
|
|
10
|
-
export async function key(options) {
|
|
11
|
-
return invoke(options);
|
|
12
|
-
}
|
|
13
|
-
export async function generate(options) {
|
|
14
|
-
try {
|
|
15
|
-
log.info("Setting random application key.");
|
|
16
|
-
if (!isFile(".env"))
|
|
17
|
-
await runCommand("cp .env.example .env", options);
|
|
18
|
-
await setEnvValue("APP_KEY", await generateAppKey());
|
|
19
|
-
log.success("Application key set");
|
|
20
|
-
return true;
|
|
21
|
-
} catch (error) {
|
|
22
|
-
log.error("There was an error generating your key.", error);
|
|
23
|
-
process.exit();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export async function generateAppKey() {
|
|
27
|
-
const random = getRandomValues(new Uint8Array(32));
|
|
28
|
-
const encodedWord = utf8.parse(random.toString());
|
|
29
|
-
const key2 = base64.stringify(encodedWord);
|
|
30
|
-
return `base64:${key2}`;
|
|
31
|
-
}
|