@springmicro/cli 0.1.8 → 0.2.0-alpha.0

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 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.1.8 win32-x64 node-v18.17.1
29
+ @springmicro/cli/0.2.0-alpha.0 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.1.8/src/commands/add/auth.ts)_
84
+ _See code: [src/commands/add/auth.ts](https://github.com/SpringMicro1/springmicrohost-js/blob/v0.2.0-alpha.0/src/commands/add/auth.ts)_
85
85
 
86
86
  ## `springmicro help [COMMAND]`
87
87
 
@@ -101,7 +101,7 @@ DESCRIPTION
101
101
  Display help for springmicro.
102
102
  ```
103
103
 
104
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.0/src/commands/help.ts)_
104
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.5/src/commands/help.ts)_
105
105
 
106
106
  ## `springmicro init PROJECTTYPE`
107
107
 
@@ -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.1.8/src/commands/init/index.ts)_
127
+ _See code: [src/commands/init/index.ts](https://github.com/SpringMicro1/springmicrohost-js/blob/v0.2.0-alpha.0/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.1.8/src/commands/init/astro.ts)_
147
+ _See code: [src/commands/init/astro.ts](https://github.com/SpringMicro1/springmicrohost-js/blob/v0.2.0-alpha.0/src/commands/init/astro.ts)_
148
148
 
149
149
  ## `springmicro plugins`
150
150
 
@@ -167,7 +167,7 @@ EXAMPLES
167
167
  $ springmicro plugins
168
168
  ```
169
169
 
170
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.2.3/src/commands/plugins/index.ts)_
170
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.4/src/commands/plugins/index.ts)_
171
171
 
172
172
  ## `springmicro plugins add PLUGIN`
173
173
 
@@ -241,7 +241,7 @@ EXAMPLES
241
241
  $ springmicro plugins inspect myplugin
242
242
  ```
243
243
 
244
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.2.3/src/commands/plugins/inspect.ts)_
244
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.4/src/commands/plugins/inspect.ts)_
245
245
 
246
246
  ## `springmicro plugins install PLUGIN`
247
247
 
@@ -290,7 +290,7 @@ EXAMPLES
290
290
  $ springmicro plugins install someuser/someplugin
291
291
  ```
292
292
 
293
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.2.3/src/commands/plugins/install.ts)_
293
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.4/src/commands/plugins/install.ts)_
294
294
 
295
295
  ## `springmicro plugins link PATH`
296
296
 
@@ -320,7 +320,7 @@ EXAMPLES
320
320
  $ springmicro plugins link myplugin
321
321
  ```
322
322
 
323
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.2.3/src/commands/plugins/link.ts)_
323
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.4/src/commands/plugins/link.ts)_
324
324
 
325
325
  ## `springmicro plugins remove [PLUGIN]`
326
326
 
@@ -361,7 +361,7 @@ FLAGS
361
361
  --reinstall Reinstall all plugins after uninstalling.
362
362
  ```
363
363
 
364
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.2.3/src/commands/plugins/reset.ts)_
364
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.4/src/commands/plugins/reset.ts)_
365
365
 
366
366
  ## `springmicro plugins uninstall [PLUGIN]`
367
367
 
@@ -389,7 +389,7 @@ EXAMPLES
389
389
  $ springmicro plugins uninstall myplugin
390
390
  ```
391
391
 
392
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.2.3/src/commands/plugins/uninstall.ts)_
392
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.4/src/commands/plugins/uninstall.ts)_
393
393
 
394
394
  ## `springmicro plugins unlink [PLUGIN]`
395
395
 
@@ -433,7 +433,7 @@ DESCRIPTION
433
433
  Update installed plugins.
434
434
  ```
435
435
 
436
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.2.3/src/commands/plugins/update.ts)_
436
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.4/src/commands/plugins/update.ts)_
437
437
  <!-- commandsstop -->
438
438
 
439
439
  - [`springmicro help [COMMAND]`](#springmicro-help-command)
@@ -5,6 +5,7 @@ import { tailwindConfigMjs, globalsCSS, libUtils, componentsJSON } from '../../d
5
5
  import chalk from 'chalk';
6
6
  import { logStep } from '../../log/index.js';
7
7
  import { checkUnixShellAndSpawn } from '../../utils/shell.js';
8
+ import { replaceHeadContents } from '../../data/astro/replace.js';
8
9
  export default class Astro extends Command {
9
10
  static step = 1;
10
11
  static totalSteps = 2;
@@ -38,6 +39,7 @@ export default class Astro extends Command {
38
39
  const libUtilsPath = path.join(name, 'src', 'lib');
39
40
  const libUtilsFilePath = path.join(libUtilsPath, 'utils.ts');
40
41
  const publicFontsDirPath = path.join(name, 'public', 'fonts');
42
+ const baseHeadPath = path.join(name, 'src', 'components', 'BaseHead.astro');
41
43
  const tsConfig = JSON.parse(fs.readFileSync(tsConfigFilePath).toString());
42
44
  // see https://ui.shadcn.com/docs/installation/manual
43
45
  // extracted 6/6/2024
@@ -45,7 +47,7 @@ export default class Astro extends Command {
45
47
  ...tsConfig['compilerOptions'],
46
48
  baseUrl: '.',
47
49
  paths: {
48
- '@/*': ['./*'],
50
+ '@/*': ['./src/*'],
49
51
  },
50
52
  };
51
53
  this.log('write to ' + chalk.cyan(tsConfigFilePath));
@@ -61,6 +63,9 @@ export default class Astro extends Command {
61
63
  fs.mkdirSync(libUtilsPath, { recursive: true });
62
64
  }
63
65
  fs.writeFileSync(libUtilsFilePath, libUtils);
66
+ // file manip
67
+ this.log('replace contents of ' + chalk.greenBright(libUtilsFilePath));
68
+ replaceHeadContents(baseHeadPath);
64
69
  // remove any extra files
65
70
  this.log('remove unused ' + chalk.red(publicFontsDirPath));
66
71
  fs.rmSync(publicFontsDirPath, {
@@ -1,5 +1,5 @@
1
- export declare const tailwindConfigMjs = "const { fontFamily } = require(\"tailwindcss/defaultTheme\")\n\n/** @type {import('tailwindcss').Config} */\nmodule.exports = {\n darkMode: [\"class\"],\n content: [\"./src/**/*.{ts,tsx,astro}\"],\n theme: {\n container: {\n center: true,\n padding: \"2rem\",\n screens: {\n \"2xl\": \"1400px\",\n },\n },\n extend: {\n colors: {\n border: \"hsl(var(--border))\",\n input: \"hsl(var(--input))\",\n ring: \"hsl(var(--ring))\",\n background: \"hsl(var(--background))\",\n foreground: \"hsl(var(--foreground))\",\n primary: {\n DEFAULT: \"hsl(var(--primary))\",\n foreground: \"hsl(var(--primary-foreground))\",\n },\n secondary: {\n DEFAULT: \"hsl(var(--secondary))\",\n foreground: \"hsl(var(--secondary-foreground))\",\n },\n destructive: {\n DEFAULT: \"hsl(var(--destructive))\",\n foreground: \"hsl(var(--destructive-foreground))\",\n },\n muted: {\n DEFAULT: \"hsl(var(--muted))\",\n foreground: \"hsl(var(--muted-foreground))\",\n },\n accent: {\n DEFAULT: \"hsl(var(--accent))\",\n foreground: \"hsl(var(--accent-foreground))\",\n },\n popover: {\n DEFAULT: \"hsl(var(--popover))\",\n foreground: \"hsl(var(--popover-foreground))\",\n },\n card: {\n DEFAULT: \"hsl(var(--card))\",\n foreground: \"hsl(var(--card-foreground))\",\n },\n },\n borderRadius: {\n lg: `var(--radius)`,\n md: `calc(var(--radius) - 2px)`,\n sm: \"calc(var(--radius) - 4px)\",\n },\n fontFamily: {\n sans: [\"var(--font-sans)\", ...fontFamily.sans],\n },\n keyframes: {\n \"accordion-down\": {\n from: { height: \"0\" },\n to: { height: \"var(--radix-accordion-content-height)\" },\n },\n \"accordion-up\": {\n from: { height: \"var(--radix-accordion-content-height)\" },\n to: { height: \"0\" },\n },\n },\n animation: {\n \"accordion-down\": \"accordion-down 0.2s ease-out\",\n \"accordion-up\": \"accordion-up 0.2s ease-out\",\n },\n },\n },\n plugins: [require(\"tailwindcss-animate\")],\n}";
2
- export declare const globalsCSS = "@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\n@layer base {\n :root {\n /* default font added */\n --font-sans: ui-sans-serif;\n\n --background: 0 0% 100%;\n --foreground: 222.2 47.4% 11.2%;\n\n --muted: 210 40% 96.1%;\n --muted-foreground: 215.4 16.3% 46.9%;\n\n --popover: 0 0% 100%;\n --popover-foreground: 222.2 47.4% 11.2%;\n\n --border: 214.3 31.8% 91.4%;\n --input: 214.3 31.8% 91.4%;\n\n --card: 0 0% 100%;\n --card-foreground: 222.2 47.4% 11.2%;\n\n --primary: 222.2 47.4% 11.2%;\n --primary-foreground: 210 40% 98%;\n\n --secondary: 210 40% 96.1%;\n --secondary-foreground: 222.2 47.4% 11.2%;\n\n --accent: 210 40% 96.1%;\n --accent-foreground: 222.2 47.4% 11.2%;\n\n --destructive: 0 100% 50%;\n --destructive-foreground: 210 40% 98%;\n\n --ring: 215 20.2% 65.1%;\n\n --radius: 0.5rem;\n }\n\n .dark {\n --background: 224 71% 4%;\n --foreground: 213 31% 91%;\n\n --muted: 223 47% 11%;\n --muted-foreground: 215.4 16.3% 56.9%;\n\n --accent: 216 34% 17%;\n --accent-foreground: 210 40% 98%;\n\n --popover: 224 71% 4%;\n --popover-foreground: 215 20.2% 65.1%;\n\n --border: 216 34% 17%;\n --input: 216 34% 17%;\n\n --card: 224 71% 4%;\n --card-foreground: 213 31% 91%;\n\n --primary: 210 40% 98%;\n --primary-foreground: 222.2 47.4% 1.2%;\n\n --secondary: 222.2 47.4% 11.2%;\n --secondary-foreground: 210 40% 98%;\n\n --destructive: 0 63% 31%;\n --destructive-foreground: 210 40% 98%;\n\n --ring: 216 34% 17%;\n\n --radius: 0.5rem;\n }\n}\n\n@layer base {\n * {\n @apply border-border;\n }\n body {\n @apply bg-background text-foreground;\n font-feature-settings: \"rlig\" 1, \"calt\" 1;\n }\n /* custom from blog astro template */\n main {\n width: 720px;\n max-width: calc(100% - 2em);\n margin: auto;\n padding: 3em 1em;\n }\n .prose p {\n\t margin-bottom: 2em;\n }\n}\n";
1
+ export declare const tailwindConfigMjs = "const { fontFamily } = require(\"tailwindcss/defaultTheme\")\n\n/** @type {import('tailwindcss').Config} */\nmodule.exports = {\n darkMode: [\"class\"],\n content: [\"./src/**/*.{ts,tsx,astro}\"],\n theme: {\n container: {\n center: true,\n padding: \"2rem\",\n screens: {\n \"2xl\": \"1400px\",\n },\n },\n extend: {\n colors: {\n border: \"hsl(var(--border))\",\n input: \"hsl(var(--input))\",\n ring: \"hsl(var(--ring))\",\n background: \"hsl(var(--background))\",\n foreground: \"hsl(var(--foreground))\",\n primary: {\n DEFAULT: \"hsl(var(--primary))\",\n foreground: \"hsl(var(--primary-foreground))\",\n },\n secondary: {\n DEFAULT: \"hsl(var(--secondary))\",\n foreground: \"hsl(var(--secondary-foreground))\",\n },\n destructive: {\n DEFAULT: \"hsl(var(--destructive))\",\n foreground: \"hsl(var(--destructive-foreground))\",\n },\n muted: {\n DEFAULT: \"hsl(var(--muted))\",\n foreground: \"hsl(var(--muted-foreground))\",\n },\n accent: {\n DEFAULT: \"hsl(var(--accent))\",\n foreground: \"hsl(var(--accent-foreground))\",\n },\n popover: {\n DEFAULT: \"hsl(var(--popover))\",\n foreground: \"hsl(var(--popover-foreground))\",\n },\n card: {\n DEFAULT: \"hsl(var(--card))\",\n foreground: \"hsl(var(--card-foreground))\",\n },\n },\n borderRadius: {\n lg: `var(--radius)`,\n md: `calc(var(--radius) - 2px)`,\n sm: \"calc(var(--radius) - 4px)\",\n },\n fontFamily: {\n sans: [\"var(--font-sans)\", ...fontFamily.sans],\n },\n keyframes: {\n \"accordion-down\": {\n from: { height: \"0\" },\n to: { height: \"var(--radix-accordion-content-height)\" },\n },\n \"accordion-up\": {\n from: { height: \"var(--radix-accordion-content-height)\" },\n to: { height: \"0\" },\n },\n },\n animation: {\n \"accordion-down\": \"accordion-down 0.2s ease-out\",\n \"accordion-up\": \"accordion-up 0.2s ease-out\",\n },\n },\n },\n plugins: [require(\"@tailwindcss/typography\"), require(\"tailwindcss-animate\")],\n}";
2
+ export declare const globalsCSS = "@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\n@layer base {\n :root {\n /* default font added */\n --font-sans: ui-sans-serif;\n\n --background: 0 0% 100%;\n --foreground: 222.2 47.4% 11.2%;\n\n --muted: 210 40% 96.1%;\n --muted-foreground: 215.4 16.3% 46.9%;\n\n --popover: 0 0% 100%;\n --popover-foreground: 222.2 47.4% 11.2%;\n\n --border: 214.3 31.8% 91.4%;\n --input: 214.3 31.8% 91.4%;\n\n --card: 0 0% 100%;\n --card-foreground: 222.2 47.4% 11.2%;\n\n --primary: 222.2 47.4% 11.2%;\n --primary-foreground: 210 40% 98%;\n\n --secondary: 210 40% 96.1%;\n --secondary-foreground: 222.2 47.4% 11.2%;\n\n --accent: 210 40% 96.1%;\n --accent-foreground: 222.2 47.4% 11.2%;\n\n --destructive: 0 100% 50%;\n --destructive-foreground: 210 40% 98%;\n\n --ring: 215 20.2% 65.1%;\n\n --radius: 0.5rem;\n }\n\n .dark {\n --background: 224 71% 4%;\n --foreground: 213 31% 91%;\n\n --muted: 223 47% 11%;\n --muted-foreground: 215.4 16.3% 56.9%;\n\n --accent: 216 34% 17%;\n --accent-foreground: 210 40% 98%;\n\n --popover: 224 71% 4%;\n --popover-foreground: 215 20.2% 65.1%;\n\n --border: 216 34% 17%;\n --input: 216 34% 17%;\n\n --card: 224 71% 4%;\n --card-foreground: 213 31% 91%;\n\n --primary: 210 40% 98%;\n --primary-foreground: 222.2 47.4% 1.2%;\n\n --secondary: 222.2 47.4% 11.2%;\n --secondary-foreground: 210 40% 98%;\n\n --destructive: 0 63% 31%;\n --destructive-foreground: 210 40% 98%;\n\n --ring: 216 34% 17%;\n\n --radius: 0.5rem;\n }\n}\n\n@layer base {\n * {\n @apply border-border;\n }\n body {\n @apply bg-background text-foreground;\n font-feature-settings: \"rlig\" 1, \"calt\" 1;\n }\n /* custom from blog astro template */\n main {\n width: 720px;\n max-width: calc(100% - 2em);\n margin: auto;\n padding: 3em 1em;\n }\n}\n";
3
3
  export declare const libUtils = "import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n";
4
4
  /**
5
5
  * from https://ui.shadcn.com/docs/components-json
@@ -75,7 +75,7 @@ module.exports = {
75
75
  },
76
76
  },
77
77
  },
78
- plugins: [require("tailwindcss-animate")],
78
+ plugins: [require("@tailwindcss/typography"), require("tailwindcss-animate")],
79
79
  }`;
80
80
  export const globalsCSS = `@tailwind base;
81
81
  @tailwind components;
@@ -167,9 +167,6 @@ export const globalsCSS = `@tailwind base;
167
167
  margin: auto;
168
168
  padding: 3em 1em;
169
169
  }
170
- .prose p {
171
- margin-bottom: 2em;
172
- }
173
170
  }
174
171
  `;
175
172
  export const libUtils = `import { clsx, type ClassValue } from "clsx"
@@ -0,0 +1,2 @@
1
+ /** Replace any head contents that we don't need like font preloads */
2
+ export declare function replaceHeadContents(filePath: string): void;
@@ -0,0 +1,8 @@
1
+ import fs from 'node:fs';
2
+ /** Replace any head contents that we don't need like font preloads */
3
+ export function replaceHeadContents(filePath) {
4
+ const data = fs.readFileSync(filePath).toString();
5
+ const regex = /<link rel="preload" href="\/fonts\/atkinson-.*?\.woff" as="font" type="font\/woff" crossorigin \/>/g;
6
+ const result = data.replace(regex, '');
7
+ fs.writeFileSync(filePath, result);
8
+ }
@@ -23,8 +23,12 @@ if errorlevel 1 exit /b %errorlevel%
23
23
  pnpx astro add tailwind -y
24
24
  if errorlevel 1 exit /b %errorlevel%
25
25
 
26
- :: Install additional packages for shadcn-ui
27
- pnpm install tailwindcss-animate class-variance-authority clsx tailwind-merge lucide-react
26
+ :: Install additional packages for shadcn-ui + icon libraries
27
+ pnpm install tailwindcss-animate class-variance-authority clsx tailwind-merge lucide-react react-icons
28
+ if errorlevel 1 exit /b %errorlevel%
29
+
30
+ :: Install dev packages
31
+ pnpm install -D @tailwindcss/typography
28
32
  if errorlevel 1 exit /b %errorlevel%
29
33
 
30
34
  endlocal
@@ -5,4 +5,5 @@ pnpx astro add react -y
5
5
  pnpx astro add tailwind -y
6
6
  # shadcn-ui
7
7
  # https://ui.shadcn.com/docs/installation/manual
8
- pnpm install tailwindcss-animate class-variance-authority clsx tailwind-merge lucide-react
8
+ pnpm install tailwindcss-animate class-variance-authority clsx tailwind-merge lucide-react react-icons
9
+ pnpm install -D @tailwindcss/typography
@@ -101,5 +101,5 @@
101
101
  ]
102
102
  }
103
103
  },
104
- "version": "0.1.8"
104
+ "version": "0.2.0-alpha.0"
105
105
  }
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.1.8",
4
+ "version": "0.2.0-alpha.0",
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": "7f7d9ece4d987ffceb47b504a95b973544862086"
79
+ "gitHead": "99d420d7d0ad1b78e03e986fa190e89e793d43b3"
80
80
  }