@springmicro/cli 0.2.0-alpha.1 → 0.2.0-alpha.2
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 +4 -4
- package/dist/commands/init/astro.js +4 -1
- package/dist/data/astro/index.d.ts +7 -0
- package/dist/data/astro/index.js +49 -1
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ $ npm install -g @springmicro/cli
|
|
|
26
26
|
$ springmicro COMMAND
|
|
27
27
|
running command...
|
|
28
28
|
$ springmicro (--version)
|
|
29
|
-
@springmicro/cli/0.2.0-alpha.
|
|
29
|
+
@springmicro/cli/0.2.0-alpha.2 win32-x64 node-v20.15.0
|
|
30
30
|
$ springmicro --help [COMMAND]
|
|
31
31
|
USAGE
|
|
32
32
|
$ springmicro COMMAND
|
|
@@ -81,7 +81,7 @@ EXAMPLES
|
|
|
81
81
|
$ springmicro add auth
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
_See code: [src/commands/add/auth.ts](https://github.com/SpringMicro1/springmicrohost-js/blob/v0.2.0-alpha.
|
|
84
|
+
_See code: [src/commands/add/auth.ts](https://github.com/SpringMicro1/springmicrohost-js/blob/v0.2.0-alpha.2/src/commands/add/auth.ts)_
|
|
85
85
|
|
|
86
86
|
## `springmicro help [COMMAND]`
|
|
87
87
|
|
|
@@ -124,7 +124,7 @@ EXAMPLES
|
|
|
124
124
|
$ springmicro init astro -n example
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
-
_See code: [src/commands/init/index.ts](https://github.com/SpringMicro1/springmicrohost-js/blob/v0.2.0-alpha.
|
|
127
|
+
_See code: [src/commands/init/index.ts](https://github.com/SpringMicro1/springmicrohost-js/blob/v0.2.0-alpha.2/src/commands/init/index.ts)_
|
|
128
128
|
|
|
129
129
|
## `springmicro init astro`
|
|
130
130
|
|
|
@@ -144,7 +144,7 @@ EXAMPLES
|
|
|
144
144
|
$ springmicro init astro -n <project-name>
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
_See code: [src/commands/init/astro.ts](https://github.com/SpringMicro1/springmicrohost-js/blob/v0.2.0-alpha.
|
|
147
|
+
_See code: [src/commands/init/astro.ts](https://github.com/SpringMicro1/springmicrohost-js/blob/v0.2.0-alpha.2/src/commands/init/astro.ts)_
|
|
148
148
|
|
|
149
149
|
## `springmicro plugins`
|
|
150
150
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import { tailwindConfigMjs, globalsCSS, libUtils, componentsJSON } from '../../data/astro/index.js';
|
|
4
|
+
import { tailwindConfigMjs, globalsCSS, libUtils, componentsJSON, readme } from '../../data/astro/index.js';
|
|
5
5
|
import chalk from 'chalk';
|
|
6
6
|
import { logStep } from '../../log/index.js';
|
|
7
7
|
import { checkUnixShellAndSpawn } from '../../utils/shell.js';
|
|
@@ -34,6 +34,7 @@ export default class Astro extends Command {
|
|
|
34
34
|
Astro.step = logStep('Manipulating project files.', Astro.step, Astro.totalSteps);
|
|
35
35
|
const componentsJSONFilePath = path.join(name, 'components.json');
|
|
36
36
|
const tsConfigFilePath = path.join(name, 'tsconfig.json');
|
|
37
|
+
const readmeFilePath = path.join(name, 'README.md');
|
|
37
38
|
const tailwindConfigFilePath = path.join(name, 'tailwind.config.mjs');
|
|
38
39
|
const globalsCSSFilePath = path.join(name, 'src', 'styles', 'global.css');
|
|
39
40
|
const libUtilsPath = path.join(name, 'src', 'lib');
|
|
@@ -52,6 +53,8 @@ export default class Astro extends Command {
|
|
|
52
53
|
};
|
|
53
54
|
this.log('write to ' + chalk.cyan(tsConfigFilePath));
|
|
54
55
|
fs.writeFileSync(tsConfigFilePath, JSON.stringify(tsConfig, null, 2));
|
|
56
|
+
this.log('write to ' + chalk.cyan(readmeFilePath));
|
|
57
|
+
fs.writeFileSync(readmeFilePath, readme(name));
|
|
55
58
|
this.log('write to ' + chalk.cyan(tailwindConfigFilePath));
|
|
56
59
|
fs.writeFileSync(tailwindConfigFilePath, tailwindConfigMjs);
|
|
57
60
|
this.log('write to ' + chalk.cyan(componentsJSONFilePath));
|
|
@@ -6,4 +6,11 @@ export declare const libUtils = "import { clsx, type ClassValue } from \"clsx\"\
|
|
|
6
6
|
* only change is globals.css => global.css
|
|
7
7
|
*/
|
|
8
8
|
export declare const componentsJSON = "{\n \"$schema\": \"https://ui.shadcn.com/schema.json\",\n \"style\": \"default\",\n \"rsc\": false,\n \"tsx\": true,\n \"tailwind\": {\n \"config\": \"tailwind.config.mjs\",\n \"css\": \"./src/styles/global.css\",\n \"baseColor\": \"slate\",\n \"cssVariables\": true,\n \"prefix\": \"\"\n },\n \"aliases\": {\n \"components\": \"@/components\",\n \"utils\": \"@/lib/utils\"\n }\n}";
|
|
9
|
+
/**
|
|
10
|
+
* custom auth config
|
|
11
|
+
*/
|
|
9
12
|
export declare const authConfigTs = "import { getAuthConfig } from \"@springmicro/auth\";\n\nexport default getAuthConfig({\n casdoorEndpoint: import.meta.env.PUBLIC_CASDOOR_ENDPOINT,\n clientId: import.meta.env.PUBLIC_CASDOOR_CLIENT_ID,\n clientSecret: import.meta.env.CASDOOR_CLIENT_SECRET,\n});";
|
|
13
|
+
/**
|
|
14
|
+
* custom README
|
|
15
|
+
*/
|
|
16
|
+
export declare const readme: (projectName: string) => string;
|
package/dist/data/astro/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// file content from https://ui.shadcn.com/docs/installation/manual
|
|
1
|
+
// some file content from https://ui.shadcn.com/docs/installation/manual
|
|
2
2
|
// unless otherwise specified
|
|
3
3
|
// site last accessed 6/6/2024
|
|
4
4
|
export const tailwindConfigMjs = `const { fontFamily } = require("tailwindcss/defaultTheme")
|
|
@@ -197,6 +197,9 @@ export const componentsJSON = `{
|
|
|
197
197
|
"utils": "@/lib/utils"
|
|
198
198
|
}
|
|
199
199
|
}`;
|
|
200
|
+
/**
|
|
201
|
+
* custom auth config
|
|
202
|
+
*/
|
|
200
203
|
export const authConfigTs = `import { getAuthConfig } from "@springmicro/auth";
|
|
201
204
|
|
|
202
205
|
export default getAuthConfig({
|
|
@@ -204,3 +207,48 @@ export default getAuthConfig({
|
|
|
204
207
|
clientId: import.meta.env.PUBLIC_CASDOOR_CLIENT_ID,
|
|
205
208
|
clientSecret: import.meta.env.CASDOOR_CLIENT_SECRET,
|
|
206
209
|
});`;
|
|
210
|
+
/**
|
|
211
|
+
* custom README
|
|
212
|
+
*/
|
|
213
|
+
export const readme = (projectName) => `# ${projectName}
|
|
214
|
+
|
|
215
|
+
[](https://springmicrohost.com)
|
|
216
|
+
|
|
217
|
+
This [Astro](https://astro.build/) project was generated with \`@springmicro/cli\` using the [Astro Starter Kit: Blog](https://github.com/withastro/astro/tree/main/examples/blog) template with some modifications.
|
|
218
|
+
|
|
219
|
+
\`\`\`bash
|
|
220
|
+
npm i -g @springmicro/cli
|
|
221
|
+
springmicro init astro -n ${projectName}
|
|
222
|
+
\`\`\`
|
|
223
|
+
|
|
224
|
+
## Features
|
|
225
|
+
|
|
226
|
+
- [tailwindcss](https://tailwindcss.com/) for CSS classes and theming.
|
|
227
|
+
- [shadcn/ui](https://ui.shadcn.com/) for plug-and-play React components.
|
|
228
|
+
- [Content Collections](https://docs.astro.build/en/guides/content-collections/) for blogs, newsletters, whatever you'd like.
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
## Development
|
|
232
|
+
|
|
233
|
+
Install [pnpm](https://pnpm.io/) if you haven't already.
|
|
234
|
+
|
|
235
|
+
<details>
|
|
236
|
+
<summary>Why pnpm?</summary>
|
|
237
|
+
It's a preference of SpringMicroHost. It mostly boils down to faster install times and better dependency management. \`@springmicro/cli\` commands only support pnpm so far.
|
|
238
|
+
</details>
|
|
239
|
+
|
|
240
|
+
\`\`\`bash
|
|
241
|
+
pnpm install
|
|
242
|
+
pnpm run dev
|
|
243
|
+
\`\`\`
|
|
244
|
+
|
|
245
|
+
## Adding SpringMicro packages
|
|
246
|
+
|
|
247
|
+
\`\`\`bash
|
|
248
|
+
springmicro add auth
|
|
249
|
+
\`\`\`
|
|
250
|
+
|
|
251
|
+
## Learn more
|
|
252
|
+
|
|
253
|
+
Check out [our documentation](https://docs.springmicrohost.com).
|
|
254
|
+
`;
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@springmicro/cli",
|
|
3
3
|
"description": "A new CLI generated with oclif",
|
|
4
|
-
"version": "0.2.0-alpha.
|
|
4
|
+
"version": "0.2.0-alpha.2",
|
|
5
5
|
"author": "David Buckley",
|
|
6
6
|
"private": false,
|
|
7
7
|
"publishConfig": {
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"version": "oclif readme && git add README.md"
|
|
77
77
|
},
|
|
78
78
|
"types": "dist/index.d.ts",
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "dbf0b4a9ec2e4023416638d4dcc6ac87e0d33d42"
|
|
80
80
|
}
|