@baseplate-dev/project-builder-cli 0.1.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.
- package/LICENSE +390 -0
- package/dist/commands/build.d.ts +6 -0
- package/dist/commands/build.js +27 -0
- package/dist/commands/config.d.ts +6 -0
- package/dist/commands/config.js +54 -0
- package/dist/commands/extract-templates.d.ts +7 -0
- package/dist/commands/extract-templates.js +19 -0
- package/dist/commands/server.d.ts +16 -0
- package/dist/commands/server.js +55 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +27 -0
- package/dist/services/feature-flags.d.ts +6 -0
- package/dist/services/feature-flags.js +14 -0
- package/dist/services/logger.d.ts +3 -0
- package/dist/services/logger.js +11 -0
- package/dist/services/schema-parser-context.d.ts +7 -0
- package/dist/services/schema-parser-context.js +12 -0
- package/dist/services/user-config.d.ts +13 -0
- package/dist/services/user-config.js +30 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/utils/path.d.ts +1 -0
- package/dist/utils/path.js +8 -0
- package/dist/utils/resolve.d.ts +1 -0
- package/dist/utils/resolve.js +8 -0
- package/dist/utils/version.d.ts +1 -0
- package/dist/utils/version.js +26 -0
- package/package.json +78 -0
- package/scripts/baseplate.js +3 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function expandPathWithTilde(directoryPath: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resolveModule(moduleName: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
export function resolveModule(moduleName) {
|
|
3
|
+
const moduleUrl = import.meta.resolve(moduleName);
|
|
4
|
+
if (!moduleUrl.startsWith('file://')) {
|
|
5
|
+
throw new Error(`Unable to resolve module ${moduleName} to a file`);
|
|
6
|
+
}
|
|
7
|
+
return fileURLToPath(moduleUrl);
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getPackageVersion(): Promise<string>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { findNearestPackageJson } from '@baseplate-dev/utils/node';
|
|
2
|
+
import { promises as fs } from 'node:fs';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
let cachedVersion;
|
|
5
|
+
export async function getPackageVersion() {
|
|
6
|
+
if (cachedVersion === undefined) {
|
|
7
|
+
// Construct the path to the package.json file.
|
|
8
|
+
const packageJsonPath = await findNearestPackageJson({
|
|
9
|
+
cwd: fileURLToPath(import.meta.url),
|
|
10
|
+
});
|
|
11
|
+
if (packageJsonPath) {
|
|
12
|
+
// Read the package.json file.
|
|
13
|
+
const fileContent = await fs.readFile(packageJsonPath, 'utf8');
|
|
14
|
+
const packageJson = JSON.parse(fileContent);
|
|
15
|
+
if (!packageJson.version) {
|
|
16
|
+
throw new Error('Unable to find version in package.json');
|
|
17
|
+
}
|
|
18
|
+
// Return the version.
|
|
19
|
+
cachedVersion = packageJson.version;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
throw new Error('Unable to find package.json');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return cachedVersion;
|
|
26
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@baseplate-dev/project-builder-cli",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Full-stack CLI builder using Baseplate generators",
|
|
5
|
+
"homepage": "https://www.halfdomelabs.com/",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/halfdomelabs/baseplate",
|
|
9
|
+
"directory": "packages/project-builder-cli"
|
|
10
|
+
},
|
|
11
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
12
|
+
"author": "Half Dome Labs LLC",
|
|
13
|
+
"type": "module",
|
|
14
|
+
"imports": {
|
|
15
|
+
"#src/*": {
|
|
16
|
+
"development": "./src/*",
|
|
17
|
+
"default": "./dist/*"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"main": "dist/index.js",
|
|
21
|
+
"bin": {
|
|
22
|
+
"baseplate": "./scripts/baseplate.js"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"LICENSE",
|
|
26
|
+
"CHANGELOG",
|
|
27
|
+
"dist/**/*",
|
|
28
|
+
"scripts/**/*"
|
|
29
|
+
],
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"commander": "^12.1.0",
|
|
32
|
+
"pino": "9.5.0",
|
|
33
|
+
"pino-pretty": "13.0.0",
|
|
34
|
+
"pkg-dir": "^8.0.0",
|
|
35
|
+
"zod": "3.24.1",
|
|
36
|
+
"@baseplate-dev/project-builder-common": "0.1.1",
|
|
37
|
+
"@baseplate-dev/project-builder-lib": "0.1.1",
|
|
38
|
+
"@baseplate-dev/project-builder-server": "0.1.1",
|
|
39
|
+
"@baseplate-dev/project-builder-web": "0.1.1",
|
|
40
|
+
"@baseplate-dev/utils": "0.1.1"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@playwright/test": "1.51.0",
|
|
44
|
+
"@types/node": "^22.0.0",
|
|
45
|
+
"dotenv": "^16.0.3",
|
|
46
|
+
"eslint": "9.26.0",
|
|
47
|
+
"fastify": "5.3.2",
|
|
48
|
+
"prettier": "3.5.3",
|
|
49
|
+
"tsx": "4.19.3",
|
|
50
|
+
"typescript": "5.7.3",
|
|
51
|
+
"vitest": "3.0.7",
|
|
52
|
+
"@baseplate-dev/tools": "0.1.1"
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": "^22.0.0"
|
|
56
|
+
},
|
|
57
|
+
"volta": {
|
|
58
|
+
"extends": "../../package.json"
|
|
59
|
+
},
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public",
|
|
62
|
+
"provenance": true
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"build": "tsc -p tsconfig.build.json",
|
|
66
|
+
"clean": "rm -rf ./dist",
|
|
67
|
+
"dev": "tsx watch --tsconfig ./tsconfig.app.json --exclude /**/node_modules/** -r dotenv/config -C development ./src",
|
|
68
|
+
"dev:serve": "pnpm dev serve",
|
|
69
|
+
"extract:templates": "pnpm start extract-templates",
|
|
70
|
+
"lint": "eslint .",
|
|
71
|
+
"prettier:check": "prettier --check .",
|
|
72
|
+
"prettier:write": "prettier -w .",
|
|
73
|
+
"start": "tsx --tsconfig ./tsconfig.app.json -r dotenv/config -C development ./src",
|
|
74
|
+
"test": "vitest",
|
|
75
|
+
"test:e2e": "playwright test",
|
|
76
|
+
"typecheck": "tsc -b --noEmit"
|
|
77
|
+
}
|
|
78
|
+
}
|