@baseplate-dev/create-project 0.3.3 → 0.6.3
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/CHANGELOG.md +338 -0
- package/LICENSE +114 -123
- package/dist/create-baseplate-project.js +4 -4
- package/dist/project-creator.js +23 -55
- package/dist/project-generator.d.ts +35 -0
- package/dist/project-generator.js +78 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +10 -21
- package/package.json +23 -20
- package/dist/exec.d.ts +0 -1
- package/dist/exec.js +0 -16
- package/dist/npm.service.d.ts +0 -1
- package/dist/npm.service.js +0 -20
- package/templates/.gitignore +0 -141
- package/templates/.pnpmfile.cjs +0 -2
- package/templates/.template.npmrc +0 -8
- package/templates/README.md +0 -35
- package/templates/scripts/setup-npmrc.cjs +0 -74
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baseplate-dev/create-project",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "CLI starter kit for creating a new Baseplate project",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"baseplate",
|
|
6
7
|
"cli",
|
|
7
|
-
"
|
|
8
|
-
"project-starter",
|
|
9
|
-
"typescript",
|
|
8
|
+
"code-generation",
|
|
10
9
|
"development-tools",
|
|
11
|
-
"baseplate",
|
|
12
10
|
"full-stack",
|
|
13
|
-
"
|
|
11
|
+
"project-starter",
|
|
12
|
+
"scaffolding",
|
|
13
|
+
"typescript"
|
|
14
14
|
],
|
|
15
15
|
"homepage": "https://www.baseplate.dev",
|
|
16
16
|
"repository": "https://github.com/halfdomelabs/baseplate",
|
|
@@ -27,30 +27,33 @@
|
|
|
27
27
|
"files": [
|
|
28
28
|
"README.md",
|
|
29
29
|
"LICENSE",
|
|
30
|
-
"CHANGELOG",
|
|
30
|
+
"CHANGELOG.md",
|
|
31
31
|
"dist/**/*",
|
|
32
|
-
"!dist/**/*.
|
|
32
|
+
"!dist/**/*.map",
|
|
33
33
|
"!dist/**/*.tsbuildinfo",
|
|
34
34
|
"templates/**/*",
|
|
35
35
|
"bin/**/*"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"axios": "^1.8.3",
|
|
39
38
|
"chalk": "5.3.0",
|
|
40
39
|
"commander": "^12.1.0",
|
|
41
|
-
"execa": "9.3.0",
|
|
42
40
|
"ora": "^8.0.1",
|
|
43
|
-
"@baseplate-dev/
|
|
41
|
+
"@baseplate-dev/project-builder-cli": "0.6.3",
|
|
42
|
+
"@baseplate-dev/project-builder-lib": "0.6.3",
|
|
43
|
+
"@baseplate-dev/project-builder-server": "0.6.3",
|
|
44
|
+
"@baseplate-dev/sync": "0.6.3",
|
|
45
|
+
"@baseplate-dev/utils": "0.6.3"
|
|
44
46
|
},
|
|
45
47
|
"devDependencies": {
|
|
46
|
-
"@types/node": "^22.
|
|
47
|
-
"eslint": "9.
|
|
48
|
+
"@types/node": "^22.17.2",
|
|
49
|
+
"eslint": "9.39.2",
|
|
48
50
|
"memfs": "4.15.1",
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
51
|
+
"oxlint": "1.55.0",
|
|
52
|
+
"prettier": "3.8.1",
|
|
53
|
+
"tsx": "4.20.6",
|
|
54
|
+
"typescript": "5.9.3",
|
|
55
|
+
"vitest": "4.0.16",
|
|
56
|
+
"@baseplate-dev/tools": "0.6.3"
|
|
54
57
|
},
|
|
55
58
|
"engines": {
|
|
56
59
|
"node": "^22.0.0"
|
|
@@ -66,9 +69,9 @@
|
|
|
66
69
|
"build": "tsc -p tsconfig.build.json",
|
|
67
70
|
"clean": "rm -rf ./dist",
|
|
68
71
|
"dev:start": "tsx -C development ./src/create-baseplate-project.ts",
|
|
69
|
-
"lint": "eslint .",
|
|
72
|
+
"lint": "oxlint && eslint .",
|
|
70
73
|
"prettier:check": "prettier --check .",
|
|
71
|
-
"prettier:write": "prettier -w .",
|
|
74
|
+
"prettier:write": "prettier -w -l .",
|
|
72
75
|
"start": "node ./dist/create-baseplate-project.js",
|
|
73
76
|
"test": "vitest",
|
|
74
77
|
"typecheck": "tsc --noEmit"
|
package/dist/exec.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function exec(command: string, cwd?: string): Promise<void>;
|
package/dist/exec.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { execa } from 'execa';
|
|
2
|
-
import ora from 'ora';
|
|
3
|
-
export async function exec(command, cwd) {
|
|
4
|
-
const spinner = ora({
|
|
5
|
-
text: `Running ${command}...`,
|
|
6
|
-
}).start();
|
|
7
|
-
try {
|
|
8
|
-
const [cmd, ...args] = command.split(' ');
|
|
9
|
-
await execa(cmd, args, { cwd });
|
|
10
|
-
spinner.succeed();
|
|
11
|
-
}
|
|
12
|
-
catch (error) {
|
|
13
|
-
spinner.fail();
|
|
14
|
-
throw error;
|
|
15
|
-
}
|
|
16
|
-
}
|
package/dist/npm.service.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getLatestCliVersion(): Promise<string>;
|
package/dist/npm.service.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
import ora from 'ora';
|
|
3
|
-
export async function getLatestCliVersion() {
|
|
4
|
-
const spinner = ora({
|
|
5
|
-
text: 'Checking for the latest version of Baseplate CLI...',
|
|
6
|
-
}).start();
|
|
7
|
-
try {
|
|
8
|
-
const url = `https://registry.npmjs.org/@baseplate-dev/project-builder-cli`;
|
|
9
|
-
const response = await axios.get(url);
|
|
10
|
-
if (!response.data.name) {
|
|
11
|
-
throw new Error('Invalid response from NPM registry');
|
|
12
|
-
}
|
|
13
|
-
spinner.succeed();
|
|
14
|
-
return response.data['dist-tags'].latest;
|
|
15
|
-
}
|
|
16
|
-
catch {
|
|
17
|
-
spinner.fail('Failed to fetch the latest CLI version');
|
|
18
|
-
throw new Error('Could not determine the latest version of Baseplate CLI');
|
|
19
|
-
}
|
|
20
|
-
}
|
package/templates/.gitignore
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
# Logs
|
|
2
|
-
logs
|
|
3
|
-
*.log
|
|
4
|
-
npm-debug.log*
|
|
5
|
-
yarn-debug.log*
|
|
6
|
-
yarn-error.log*
|
|
7
|
-
lerna-debug.log*
|
|
8
|
-
.pnpm-debug.log*
|
|
9
|
-
|
|
10
|
-
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
11
|
-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
12
|
-
|
|
13
|
-
# Runtime data
|
|
14
|
-
pids
|
|
15
|
-
*.pid
|
|
16
|
-
*.seed
|
|
17
|
-
*.pid.lock
|
|
18
|
-
|
|
19
|
-
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
20
|
-
lib-cov
|
|
21
|
-
|
|
22
|
-
# Coverage directory used by tools like istanbul
|
|
23
|
-
coverage
|
|
24
|
-
*.lcov
|
|
25
|
-
|
|
26
|
-
# nyc test coverage
|
|
27
|
-
.nyc_output
|
|
28
|
-
|
|
29
|
-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
30
|
-
.grunt
|
|
31
|
-
|
|
32
|
-
# Bower dependency directory (https://bower.io/)
|
|
33
|
-
bower_components
|
|
34
|
-
|
|
35
|
-
# node-waf configuration
|
|
36
|
-
.lock-wscript
|
|
37
|
-
|
|
38
|
-
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
39
|
-
build/Release
|
|
40
|
-
|
|
41
|
-
# Dependency directories
|
|
42
|
-
node_modules/
|
|
43
|
-
jspm_packages/
|
|
44
|
-
|
|
45
|
-
# Snowpack dependency directory (https://snowpack.dev/)
|
|
46
|
-
web_modules/
|
|
47
|
-
|
|
48
|
-
# TypeScript cache
|
|
49
|
-
*.tsbuildinfo
|
|
50
|
-
|
|
51
|
-
# Optional npm cache directory
|
|
52
|
-
.npm
|
|
53
|
-
|
|
54
|
-
# Optional eslint cache
|
|
55
|
-
.eslintcache
|
|
56
|
-
|
|
57
|
-
# Optional stylelint cache
|
|
58
|
-
.stylelintcache
|
|
59
|
-
|
|
60
|
-
# Microbundle cache
|
|
61
|
-
.rpt2_cache/
|
|
62
|
-
.rts2_cache_cjs/
|
|
63
|
-
.rts2_cache_es/
|
|
64
|
-
.rts2_cache_umd/
|
|
65
|
-
|
|
66
|
-
# Optional REPL history
|
|
67
|
-
.node_repl_history
|
|
68
|
-
|
|
69
|
-
# Output of 'npm pack'
|
|
70
|
-
*.tgz
|
|
71
|
-
|
|
72
|
-
# Yarn Integrity file
|
|
73
|
-
.yarn-integrity
|
|
74
|
-
|
|
75
|
-
# environment variable files
|
|
76
|
-
.env
|
|
77
|
-
.env.development.local
|
|
78
|
-
.env.test.local
|
|
79
|
-
.env.production.local
|
|
80
|
-
.env.local
|
|
81
|
-
|
|
82
|
-
# parcel-bundler cache (https://parceljs.org/)
|
|
83
|
-
.cache
|
|
84
|
-
.parcel-cache
|
|
85
|
-
|
|
86
|
-
# Next.js build output
|
|
87
|
-
.next
|
|
88
|
-
out
|
|
89
|
-
|
|
90
|
-
# Nuxt.js build / generate output
|
|
91
|
-
.nuxt
|
|
92
|
-
dist
|
|
93
|
-
|
|
94
|
-
# Gatsby files
|
|
95
|
-
.cache/
|
|
96
|
-
# Comment in the public line in if your project uses Gatsby and not Next.js
|
|
97
|
-
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
98
|
-
# public
|
|
99
|
-
|
|
100
|
-
# vuepress build output
|
|
101
|
-
.vuepress/dist
|
|
102
|
-
|
|
103
|
-
# vuepress v2.x temp and cache directory
|
|
104
|
-
.temp
|
|
105
|
-
.cache
|
|
106
|
-
|
|
107
|
-
# Docusaurus cache and generated files
|
|
108
|
-
.docusaurus
|
|
109
|
-
|
|
110
|
-
# Serverless directories
|
|
111
|
-
.serverless/
|
|
112
|
-
|
|
113
|
-
# FuseBox cache
|
|
114
|
-
.fusebox/
|
|
115
|
-
|
|
116
|
-
# DynamoDB Local files
|
|
117
|
-
.dynamodb/
|
|
118
|
-
|
|
119
|
-
# TernJS port file
|
|
120
|
-
.tern-port
|
|
121
|
-
|
|
122
|
-
# Stores VSCode versions used for testing VSCode extensions
|
|
123
|
-
.vscode-test
|
|
124
|
-
|
|
125
|
-
# yarn v2
|
|
126
|
-
.yarn/cache
|
|
127
|
-
.yarn/unplugged
|
|
128
|
-
.yarn/build-state.yml
|
|
129
|
-
.yarn/install-state.gz
|
|
130
|
-
.pnp.*
|
|
131
|
-
|
|
132
|
-
playground
|
|
133
|
-
|
|
134
|
-
.DS_Store
|
|
135
|
-
.vercel
|
|
136
|
-
|
|
137
|
-
.npmrc
|
|
138
|
-
.turbo
|
|
139
|
-
|
|
140
|
-
# Baseplate build artifacts
|
|
141
|
-
baseplate/.build
|
package/templates/.pnpmfile.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# Prevents publish from any branch other than main
|
|
2
|
-
publish-branch=main
|
|
3
|
-
# Saves exact versions of dependencies by default
|
|
4
|
-
save-prefix=""
|
|
5
|
-
# Ensures we use locally linked packages when available
|
|
6
|
-
link-workspace-packages=true
|
|
7
|
-
# Defaults to saving as workspace:*
|
|
8
|
-
save-workspace-protocol=rolling
|
package/templates/README.md
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Baseplate Project
|
|
2
|
-
|
|
3
|
-
Welcome to your new Baseplate project! This README provides essential information on how to get started with your project, including setting up the generator UI and beginning your development process.
|
|
4
|
-
|
|
5
|
-
## Getting Started
|
|
6
|
-
|
|
7
|
-
To begin using the project, you will need to set up your local environment. Follow these instructions to get everything up and running.
|
|
8
|
-
|
|
9
|
-
### Prerequisites
|
|
10
|
-
|
|
11
|
-
Before you start, ensure you have `pnpm` installed on your system. If you do not have `pnpm` installed, you can learn how to install it by visiting [pnpm installation guide](https://pnpm.io/installation).
|
|
12
|
-
|
|
13
|
-
### Installation
|
|
14
|
-
|
|
15
|
-
To install the necessary dependencies for your project, run the following command in the root directory of your project:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
pnpm install
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
### Launching the Generator UI
|
|
22
|
-
|
|
23
|
-
To start the generator UI, which allows you to configure and initiate the code generation process, execute the following command:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
pnpm baseplate serve
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
This command will start the server and open the corresponding web interface where you can customize your project’s specifications and features and generate the code.
|
|
30
|
-
|
|
31
|
-
## Configuration
|
|
32
|
-
|
|
33
|
-
To configure your project settings, use the web interface launched by the above command. Here you can specify data models, authentication mechanisms, and other project-specific settings.
|
|
34
|
-
|
|
35
|
-
Thank you for choosing Baseplate for your project’s foundation!
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Generates .npmrc from a .npmrc.template file using a .env file if present
|
|
3
|
-
*
|
|
4
|
-
* This allows us to use .env files to store secrets and use them in .npmrc
|
|
5
|
-
* since it is not natively supported by pnpm.
|
|
6
|
-
*/
|
|
7
|
-
const fs = require('node:fs');
|
|
8
|
-
const path = require('node:path');
|
|
9
|
-
|
|
10
|
-
module.exports = function generateNpmRc(dirname) {
|
|
11
|
-
const templatePath = path.join(dirname, '.template.npmrc');
|
|
12
|
-
const npmrcPath = path.join(dirname, '.npmrc');
|
|
13
|
-
const envPath = path.join(dirname, '.env');
|
|
14
|
-
|
|
15
|
-
if (!fs.existsSync(templatePath)) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// read .env file if present
|
|
20
|
-
const envVars = { ...process.env };
|
|
21
|
-
if (fs.existsSync(envPath)) {
|
|
22
|
-
const env = fs.readFileSync(envPath, 'utf8');
|
|
23
|
-
const lines = env
|
|
24
|
-
.split('\n')
|
|
25
|
-
.filter((line) => line && !line.startsWith('#'));
|
|
26
|
-
for (const line of lines) {
|
|
27
|
-
const [key, ...values] = line.split('=');
|
|
28
|
-
if (values.length > 0) {
|
|
29
|
-
envVars[key] = values.join('=');
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const template = fs.readFileSync(templatePath, 'utf8');
|
|
35
|
-
|
|
36
|
-
// replace all ${VARIABLE} with process.env.VARIABLE
|
|
37
|
-
const npmrc = template
|
|
38
|
-
.replaceAll(/\${([A-Z_]+)}/g, (_, key) => {
|
|
39
|
-
if (!envVars[key]) {
|
|
40
|
-
throw new Error(`Missing environment variable ${key}`);
|
|
41
|
-
}
|
|
42
|
-
return envVars[key];
|
|
43
|
-
})
|
|
44
|
-
.replaceAll(/\${([A-Z_:a-z\-]+)}/g, (_, key) =>
|
|
45
|
-
envVars[key] ? envVars[key] : key,
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
const npmrcContents = `
|
|
49
|
-
# This file has been auto-generated from .npmrc.template
|
|
50
|
-
# Do not edit this file directly
|
|
51
|
-
# Edit .npmrc.template instead and run \`pnpm install\` to regenerate this file
|
|
52
|
-
|
|
53
|
-
${npmrc}`.trimStart();
|
|
54
|
-
|
|
55
|
-
if (fs.existsSync(npmrcPath)) {
|
|
56
|
-
const existingNpmrc = fs.readFileSync(npmrcPath, 'utf8');
|
|
57
|
-
|
|
58
|
-
if (existingNpmrc === npmrcContents) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
fs.writeFileSync(npmrcPath, npmrcContents);
|
|
64
|
-
|
|
65
|
-
if (!process.argv.includes('--silent')) {
|
|
66
|
-
console.log(`
|
|
67
|
-
Generated .npmrc file from .template.npmrc!
|
|
68
|
-
|
|
69
|
-
Please run your command again so it can use the latest .npmrc.
|
|
70
|
-
`);
|
|
71
|
-
|
|
72
|
-
process.exit(1);
|
|
73
|
-
}
|
|
74
|
-
};
|