anhedral 0.1.3 → 0.1.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/README.md +126 -20
- package/dist/cli.d.ts +3 -5
- package/dist/cli.js +8 -27
- package/dist/commands.d.ts +3 -7
- package/dist/commands.js +12 -38
- package/dist/dependencies.d.ts +35 -0
- package/dist/dependencies.js +175 -0
- package/dist/scaffold.d.ts +6 -7
- package/dist/scaffold.js +223 -285
- package/dist/templates/backend.d.ts +1 -1
- package/dist/templates/backend.js +46 -10
- package/dist/templates/extension.d.ts +1 -1
- package/dist/templates/extension.js +74 -58
- package/dist/templates/frontend.d.ts +1 -1
- package/dist/templates/frontend.js +83 -171
- package/dist/toolchain.js +5 -7
- package/dist/util.d.ts +1 -0
- package/dist/util.js +25 -1
- package/package.json +5 -4
- package/dist/templates/default-web.d.ts +0 -2
- package/dist/templates/default-web.js +0 -1950
package/dist/toolchain.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TOOLCHAIN_DEPENDENCIES, VERIFIED_AT } from './dependencies.js';
|
|
1
2
|
export const TOOLCHAIN_CHANNELS = ['latest', 'stable'];
|
|
2
3
|
const TOOLCHAIN_SPECS = {
|
|
3
4
|
latest: {
|
|
@@ -7,13 +8,10 @@ const TOOLCHAIN_SPECS = {
|
|
|
7
8
|
wxt: 'latest',
|
|
8
9
|
},
|
|
9
10
|
stable: {
|
|
10
|
-
verifiedAt:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
reactNativeReusables: '0.5.0',
|
|
15
|
-
// renovate: datasource=npm depName=wxt
|
|
16
|
-
wxt: '0.20.20',
|
|
11
|
+
verifiedAt: VERIFIED_AT,
|
|
12
|
+
shadcn: TOOLCHAIN_DEPENDENCIES.shadcn,
|
|
13
|
+
reactNativeReusables: TOOLCHAIN_DEPENDENCIES.reactNativeReusables,
|
|
14
|
+
wxt: TOOLCHAIN_DEPENDENCIES.wxt,
|
|
17
15
|
},
|
|
18
16
|
};
|
|
19
17
|
export function resolveToolchainChannel(value) {
|
package/dist/util.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare function writeFile(filePath: string, content: string): void;
|
|
2
2
|
export declare function appendGitignore(root: string, lines: string[]): void;
|
|
3
3
|
export declare function exec(cmd: string, cwd: string): void;
|
|
4
|
+
export declare function execCommand(command: string, args: string[], cwd: string): void;
|
|
4
5
|
export declare function execWithInput(cmd: string, cwd: string, stdinInput: string): void;
|
|
5
6
|
export declare function liftNestedProject(root: string, nestedName: string): void;
|
|
6
7
|
export declare function execExpect(cmd: string, cwd: string, prompts: [waitFor: string, answer: string][], timeoutMs?: number): Promise<void>;
|
package/dist/util.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { execSync, spawn } from 'node:child_process';
|
|
2
|
+
import { execSync, spawn, spawnSync } from 'node:child_process';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
export function writeFile(filePath, content) {
|
|
5
5
|
mkdirSync(path.dirname(filePath), { recursive: true });
|
|
@@ -24,6 +24,9 @@ function dumpFailure(error, cmd) {
|
|
|
24
24
|
process.stderr.write(stderrText);
|
|
25
25
|
throw new Error(`Command failed (exit ${err.status ?? '?'}): ${cmd}`);
|
|
26
26
|
}
|
|
27
|
+
function commandLabel(command, args) {
|
|
28
|
+
return [command, ...args].join(' ');
|
|
29
|
+
}
|
|
27
30
|
export function exec(cmd, cwd) {
|
|
28
31
|
if (VERBOSE) {
|
|
29
32
|
console.log(` $ ${cmd}`);
|
|
@@ -37,6 +40,27 @@ export function exec(cmd, cwd) {
|
|
|
37
40
|
dumpFailure(error, cmd);
|
|
38
41
|
}
|
|
39
42
|
}
|
|
43
|
+
export function execCommand(command, args, cwd) {
|
|
44
|
+
const label = commandLabel(command, args);
|
|
45
|
+
if (VERBOSE) {
|
|
46
|
+
console.log(` $ ${label}`);
|
|
47
|
+
}
|
|
48
|
+
const result = spawnSync(command, args, {
|
|
49
|
+
cwd,
|
|
50
|
+
encoding: 'utf8',
|
|
51
|
+
stdio: VERBOSE ? 'inherit' : ['ignore', 'pipe', 'pipe'],
|
|
52
|
+
});
|
|
53
|
+
if (result.status === 0) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (!VERBOSE) {
|
|
57
|
+
if (result.stdout)
|
|
58
|
+
process.stderr.write(result.stdout);
|
|
59
|
+
if (result.stderr)
|
|
60
|
+
process.stderr.write(result.stderr);
|
|
61
|
+
}
|
|
62
|
+
throw new Error(`Command failed (exit ${result.status ?? '?'}): ${label}`);
|
|
63
|
+
}
|
|
40
64
|
export function execWithInput(cmd, cwd, stdinInput) {
|
|
41
65
|
if (VERBOSE) {
|
|
42
66
|
console.log(` $ ${cmd}`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anhedral",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Opinionated init CLI for Expo
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "Opinionated init CLI for Expo, Fastify, WXT, shared packages, Neon, Drizzle, Clerk, RevenueCat, Stripe, R2, and Vercel.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"anhedral": "bin/anhedral.js"
|
|
@@ -38,9 +38,10 @@
|
|
|
38
38
|
"prepublishOnly": "pnpm test:all",
|
|
39
39
|
"test:cli": "node tests/test-cli.js",
|
|
40
40
|
"test:cli:validation": "node tests/test-cli-validation.js",
|
|
41
|
+
"test:deps": "pnpm build && node tests/test-dependency-manifest.js",
|
|
41
42
|
"test:e2e": "node tests/test-e2e-public-stacks.js",
|
|
42
43
|
"test:e2e:latest": "node tests/test-e2e-public-stacks.js --toolchain latest",
|
|
43
|
-
"test:all": "pnpm test && pnpm test:e2e",
|
|
44
|
+
"test:all": "pnpm test && pnpm test:deps && pnpm test:e2e",
|
|
44
45
|
"release:check": "pnpm test:all && npm pack --dry-run",
|
|
45
46
|
"demo:refresh": "pnpm build && node tests/refresh-demo.js"
|
|
46
47
|
},
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
"neondb",
|
|
55
56
|
"revenuecat",
|
|
56
57
|
"wxt",
|
|
57
|
-
"
|
|
58
|
+
"vercel"
|
|
58
59
|
],
|
|
59
60
|
"license": "MIT",
|
|
60
61
|
"packageManager": "pnpm@10.15.1",
|