@skirtle/create-vue-lib 0.0.8 → 0.0.10

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.
Files changed (27) hide show
  1. package/dist/index.cjs +15 -7
  2. package/dist/template/base/config/.vscode/settings.json.ejs +1 -1
  3. package/dist/template/base/config/package.json.ejs +7 -7
  4. package/dist/template/base/config/packages/@projectName@/{src/global.d.ts.ejs → env.d.ts.ejs} +2 -0
  5. package/dist/template/base/config/packages/@projectName@/package.json.ejs +13 -7
  6. package/dist/template/base/config/packages/@projectName@/vite.config.mts.ejs +6 -0
  7. package/dist/template/base/examples/packages/@projectName@/src/components/ExampleComponent.vue.ejs +5 -6
  8. package/dist/template/base/examples/packages/@projectName@/src/components/{MyPanel.vue → MyPanel.vue.ejs} +11 -4
  9. package/dist/template/base/examples/packages/@projectName@/src/components/MyPanelSection.vue.ejs +27 -0
  10. package/dist/template/base/examples/packages/@projectName@/src/index.ts.ejs +14 -0
  11. package/dist/template/playground/config/packages/playground/env.d.ts.ejs +3 -0
  12. package/dist/template/playground/config/packages/playground/{package.json → package.json.ejs} +10 -4
  13. package/dist/template/playground/config/packages/playground/vite.config.mts.ejs +10 -2
  14. package/dist/template/playground/examples/packages/playground/src/{App.vue → App.vue.ejs} +4 -2
  15. package/dist/template/tailwind/examples/packages/@projectName@/src/index.css +3 -0
  16. package/dist/template/vitepress/config/packages/docs/.vitepress/config.mts.ejs +15 -4
  17. package/dist/template/vitepress/config/packages/docs/env.d.ts.ejs +3 -0
  18. package/dist/template/vitepress/config/packages/docs/{package.json → package.json.ejs} +12 -3
  19. package/dist/template/vitepress/examples/packages/docs/src/{index.md → index.md.ejs} +3 -3
  20. package/dist/template/vitepress/examples/packages/docs/src/{introduction.md → introduction.md.ejs} +7 -1
  21. package/dist/template/vp-raw/config/packages/docs/postcss.config.mjs +10 -0
  22. package/package.json +1 -1
  23. package/dist/template/base/config/packages/@projectName@/env.d.ts +0 -1
  24. package/dist/template/base/examples/packages/@projectName@/src/components/MyPanelSection.vue +0 -15
  25. package/dist/template/base/examples/packages/@projectName@/src/index.ts +0 -3
  26. package/dist/template/playground/config/packages/playground/env.d.ts +0 -3
  27. package/dist/template/vitepress/config/packages/docs/env.d.ts +0 -3
package/dist/index.cjs CHANGED
@@ -5697,7 +5697,7 @@ var import_picocolors = __toESM(require_picocolors(), 1);
5697
5697
  // package.json
5698
5698
  var package_default = {
5699
5699
  name: "@skirtle/create-vue-lib",
5700
- version: "0.0.8",
5700
+ version: "0.0.10",
5701
5701
  author: "skirtle",
5702
5702
  license: "MIT",
5703
5703
  description: "Create a library using Vue and Vite",
@@ -5912,10 +5912,12 @@ async function init() {
5912
5912
  console.log((0, import_picocolors.red)("Invalid GitHub path: " + rawGithubPath));
5913
5913
  process.exit(1);
5914
5914
  }
5915
+ const includeTailwind = await togglePrompt("Include Tailwind CSS?");
5915
5916
  const includeEsLint = await togglePrompt("Include ESLint?", true);
5916
5917
  const includeEsLintStylistic = await togglePromptIf(includeEsLint, "Include ESLint Stylistic for formatting?", includeEsLint);
5917
5918
  const includeVitest = await togglePromptIf(extended, "Include Vitest for testing?", true);
5918
5919
  const includeDocs = await togglePrompt("Include VitePress for documentation?", true);
5920
+ const includeVpRaw = includeDocs && await togglePromptIf(extended, "Include support for vp-raw in VitePress?", includeTailwind);
5919
5921
  const includeGithubPages = includeDocs && await togglePrompt("Include GitHub Pages config for documentation?");
5920
5922
  const includePlayground = await togglePrompt("Include playground application for development?", true);
5921
5923
  const includeGithubCi = await togglePrompt("Include GitHub CI configuration?", !!githubPath);
@@ -5980,7 +5982,9 @@ async function init() {
5980
5982
  includeVitest,
5981
5983
  includeGithubCi,
5982
5984
  includeAtAliases,
5983
- includeTestVariable
5985
+ includeTestVariable,
5986
+ includeTailwind,
5987
+ includeVpRaw
5984
5988
  };
5985
5989
  copyTemplate("base", config);
5986
5990
  if (config.includeDocs) {
@@ -6001,6 +6005,12 @@ async function init() {
6001
6005
  if (config.includeGithubCi) {
6002
6006
  copyTemplate("ci", config);
6003
6007
  }
6008
+ if (config.includeTailwind) {
6009
+ copyTemplate("tailwind", config);
6010
+ }
6011
+ if (config.includeVpRaw) {
6012
+ copyTemplate("vp-raw", config);
6013
+ }
6004
6014
  console.log();
6005
6015
  console.log(`${(0, import_picocolors.bgGreen)((0, import_picocolors.bold)((0, import_picocolors.black)("DONE")))} Project created`);
6006
6016
  console.log();
@@ -6057,16 +6067,14 @@ function copyFiles(templateFile, config) {
6057
6067
  const template = fs.readFileSync(templatePath, "utf-8");
6058
6068
  const target = targetPath.replace(/\.ejs$/, "");
6059
6069
  let content = import_ejs.default.render(template, { config });
6060
- if (/\.(json|m?[jt]s)$/.test(target)) {
6070
+ if (/\.(json|m?[jt]s|vue)$/.test(target)) {
6071
+ content = content.trim() + "\n";
6061
6072
  content = content.replace(/ +\n/g, "\n");
6062
6073
  content = content.replace(/\n\n+/g, "\n\n");
6063
6074
  content = content.replace(/, *(?:\n+(\n\s*)|(\s*))([}\])])/g, "$1$2$3");
6075
+ content = content.replace(/([{[(]\n)\n+/g, "$1");
6064
6076
  }
6065
6077
  fs.writeFileSync(target, content);
6066
- } else if (["package.json", "vite.config.mts", "config.mts", "index.md", "introduction.md", "App.vue", "tsconfig.app.json", "env.d.ts"].includes(filename)) {
6067
- const template = fs.readFileSync(templatePath, "utf-8");
6068
- const content = template.replace(/@projectName@/g, config.mainPackageDirName).replace(new RegExp(`@(${Object.keys(config).join("|")})@`, "g"), (all, setting) => `${config[setting] ?? all}`);
6069
- fs.writeFileSync(targetPath, content);
6070
6078
  } else {
6071
6079
  fs.copyFileSync(templatePath, targetPath);
6072
6080
  }
@@ -3,7 +3,7 @@
3
3
  "explorer.fileNesting.patterns": {
4
4
  "tsconfig.json": "tsconfig.*.json, env.d.ts",
5
5
  "vite.config.*": "jsconfig*, vitest.config.*, cypress.config.*, playwright.config.*",
6
- "package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .prettier*, prettier*, .editorconfig"
6
+ "package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .oxlint*, oxlint*, .prettier*, prettier*, .editorconfig"
7
7
  },
8
8
  <%_ if (config.includeEsLint) { _%>
9
9
  "editor.codeActionsOnSave": {
@@ -7,23 +7,23 @@
7
7
  },
8
8
  "devDependencies": {
9
9
  <%_ if (config.includeEsLint) { _%>
10
- "@eslint/compat": "^1.2.7",
10
+ "@eslint/compat": "^1.2.8",
11
11
  <%_ if (config.includeEsLintStylistic) { _%>
12
12
  "@stylistic/eslint-plugin": "^4.2.0",
13
13
  <%_ } _%>
14
- "@tsconfig/node22": "^22.0.0",
15
- "@types/node": "^22.13.9",
14
+ "@tsconfig/node22": "^22.0.1",
15
+ "@types/node": "^22.13.14",
16
16
  <%_ if (config.includeVitest) { _%>
17
- "@vitest/eslint-plugin": "^1.1.36",
17
+ "@vitest/eslint-plugin": "^1.1.38",
18
18
  <%_ } _%>
19
19
  "@vue/eslint-config-typescript": "^14.5.0",
20
- "eslint": "^9.21.0",
20
+ "eslint": "^9.22.0",
21
21
  "eslint-plugin-vue": "~10.0.0",
22
22
  "jiti": "^2.4.2",
23
- "lint-staged": "^15.4.3",
23
+ "lint-staged": "^15.5.0",
24
24
  "npm-run-all2": "^7.0.2",
25
25
  <%_ } _%>
26
- "simple-git-hooks": "^2.11.1",
26
+ "simple-git-hooks": "^2.12.1",
27
27
  <%_ if (config.includeEsLint) { _%>
28
28
  "typescript": "~5.8.0"
29
29
  <%_ } _%>
@@ -1,3 +1,5 @@
1
+ /// <reference types="vite/client" />
2
+
1
3
  declare const __DEV__: boolean
2
4
  <%_ if (config.includeTestVariable) { _%>
3
5
  declare const __TEST__: boolean
@@ -39,25 +39,31 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@rollup/plugin-replace": "^6.0.2",
42
- "@tsconfig/node22": "^22.0.0",
42
+ <%_ if (config.includeTailwind) { _%>
43
+ "@tailwindcss/vite": "^4.1.5",
44
+ <%_ } _%>
45
+ "@tsconfig/node22": "^22.0.1",
43
46
  "@types/jsdom": "^21.1.7",
44
- "@types/node": "^22.13.9",
45
- "@vitejs/plugin-vue": "^5.2.1",
47
+ "@types/node": "^22.13.14",
48
+ "@vitejs/plugin-vue": "^5.2.3",
46
49
  <%_ if (config.includeVitest) { _%>
47
- "@vitest/coverage-v8": "^3.0.8",
50
+ "@vitest/coverage-v8": "^3.1.1",
48
51
  "@vue/test-utils": "^2.4.6",
49
52
  <%_ } _%>
50
53
  "@vue/tsconfig": "^0.7.0",
51
54
  "copyfiles": "^2.4.1",
52
55
  "jsdom": "^26.0.0",
53
56
  "npm-run-all2": "^7.0.2",
54
- "publint": "^0.3.8",
57
+ "publint": "^0.3.9",
55
58
  "rimraf": "^5.0.1",
59
+ <%_ if (config.includeTailwind) { _%>
60
+ "tailwindcss": "^4.1.5",
61
+ <%_ } _%>
56
62
  "typescript": "~5.8.0",
57
- "vite": "^6.2.1",
63
+ "vite": "^6.2.4",
58
64
  "vite-plugin-dts": "^4.5.3",
59
65
  <%_ if (config.includeVitest) { _%>
60
- "vitest": "^3.0.8",
66
+ "vitest": "^3.1.1",
61
67
  <%_ } _%>
62
68
  "vue": "^3.5.13",
63
69
  "vue-tsc": "^2.2.8"
@@ -4,6 +4,9 @@ import { defineConfig, type UserConfig } from 'vite'
4
4
  import replace from '@rollup/plugin-replace'
5
5
  import vue from '@vitejs/plugin-vue'
6
6
  import dts from 'vite-plugin-dts'
7
+ <%_ if (config.includeTailwind) { _%>
8
+ import tailwindcss from '@tailwindcss/vite'
9
+ <%_ } _%>
7
10
 
8
11
  export default defineConfig(({ mode }): UserConfig => {
9
12
  if (mode !== 'production' && mode !== 'development' && mode !== 'neutral' && mode !== 'test') {
@@ -38,6 +41,9 @@ export default defineConfig(({ mode }): UserConfig => {
38
41
  prodDevtools: mode === 'development'
39
42
  }
40
43
  }),
44
+ <%_ if (config.includeTailwind) { _%>
45
+ tailwindcss(),
46
+ <%_ } _%>
41
47
  dtsPlugin
42
48
  ],
43
49
 
@@ -2,22 +2,20 @@
2
2
  import { ref } from 'vue'
3
3
 
4
4
  if (__DEV__) {
5
- console.log('dev: creating ExampleComponent')
6
- <%_ if (config.includeTestVariable) { _%>
7
- console.log(`__TEST__: ${__TEST__}`)
8
- <%_ } _%>
5
+ console.log('[<%- config.scopedPackageName %>] creating ExampleComponent')
9
6
  }
10
7
 
11
8
  const msg = ref('Hello world!')
12
9
  </script>
13
10
 
14
11
  <template>
15
- <div class="outer">
16
- <input v-model="msg">
12
+ <div class="outer<%- config.includeTailwind ? ' border-1 border-solid border-green-700 p-5' : '' %>">
13
+ <input v-model="msg"<%- config.includeTailwind ? ' class="border-1 border-solid border-neutral-500 px-1 py-0.5"' : '' %>>
17
14
  <p>{{ msg }}</p>
18
15
  </div>
19
16
  </template>
20
17
 
18
+ <%_ if (!config.includeTailwind) { _%>
21
19
  <style scoped>
22
20
  .outer {
23
21
  border: 1px solid green;
@@ -29,3 +27,4 @@ const msg = ref('Hello world!')
29
27
  padding: 2px 4px;
30
28
  }
31
29
  </style>
30
+ <%_ } _%>
@@ -1,28 +1,34 @@
1
1
  <script setup lang="ts">
2
+ import { provide } from 'vue'
2
3
  import MyPanelSection from './MyPanelSection.vue'
3
4
 
4
5
  defineProps<{
5
6
  title?: string
6
7
  footer?: string
7
8
  }>()
9
+
10
+ if (__DEV__) {
11
+ provide('MyPanel', true)
12
+ }
8
13
  </script>
9
14
 
10
15
  <template>
11
- <div class="panel">
16
+ <div class="panel<%- config.includeTailwind ? ' border-1 border-solid border-[#34495e] rounded-[5px] flex flex-col font-sans overflow-hidden [&>*+*]:border-t-1 [&>*+*]:border-t-solid [&>*+*]:border-t-[#34495e] [&>.panel-section:first-child]:rounded-t-[5px] [&>.panel-section:last-child]:rounded-b-[5px]' : '' %>">
12
17
  <slot name="header">
13
- <MyPanelSection v-if="title" class="panel-header">{{ title }}</MyPanelSection>
18
+ <MyPanelSection v-if="title" class="panel-header<%- config.includeTailwind ? ' bg-[#34495e] inset-ring inset-ring-white text-white tracking-wide text-shadow-sm' : '' %>">{{ title }}</MyPanelSection>
14
19
  </slot>
15
20
  <slot name="body">
16
- <MyPanelSection class="panel-body">
21
+ <MyPanelSection class="panel-body<%- config.includeTailwind ? ' flex-auto overflow-auto' : '' %>">
17
22
  <slot />
18
23
  </MyPanelSection>
19
24
  </slot>
20
25
  <slot name="footer">
21
- <MyPanelSection v-if="footer" class="panel-footer">{{ footer }}</MyPanelSection>
26
+ <MyPanelSection v-if="footer" class="panel-footer<%- config.includeTailwind ? ' bg-[#34495e] inset-ring inset-ring-white text-white tracking-wide text-shadow-sm' : '' %>">{{ footer }}</MyPanelSection>
22
27
  </slot>
23
28
  </div>
24
29
  </template>
25
30
 
31
+ <%_ if (!config.includeTailwind) { _%>
26
32
  <style scoped>
27
33
  .panel {
28
34
  border: 1px solid #34495e;
@@ -60,3 +66,4 @@ defineProps<{
60
66
  overflow: auto;
61
67
  }
62
68
  </style>
69
+ <%_ } _%>
@@ -0,0 +1,27 @@
1
+ <script setup lang="ts">
2
+ import { inject, provide } from 'vue'
3
+
4
+ if (__DEV__) {
5
+ const insideMyPanel = inject('MyPanel', false)
6
+
7
+ if (!insideMyPanel) {
8
+ console.warn('[<%- config.scopedPackageName %>] MyPanelSection can only be used inside MyPanel')
9
+ }
10
+
11
+ provide('MyPanel', false)
12
+ }
13
+ </script>
14
+
15
+ <template>
16
+ <div class="panel-section<%- config.includeTailwind ? ' p-2' : '' %>">
17
+ <slot />
18
+ </div>
19
+ </template>
20
+
21
+ <%_ if (!config.includeTailwind) { _%>
22
+ <style scoped>
23
+ .panel-section {
24
+ padding: 10px;
25
+ }
26
+ </style>
27
+ <%_ } _%>
@@ -0,0 +1,14 @@
1
+ <%_ if (config.includeTailwind) { _%>
2
+ import './index.css'
3
+
4
+ <%_ } _%>
5
+ export { default as ExampleComponent } from './components/ExampleComponent.vue'
6
+ export { default as MyPanel } from './components/MyPanel.vue'
7
+ export { default as MyPanelSection } from './components/MyPanelSection.vue'
8
+
9
+ if (__DEV__) {
10
+ console.log('[<%- config.scopedPackageName %>] dev mode')
11
+ <%_ if (config.includeTestVariable) { _%>
12
+ console.log(`[<%- config.scopedPackageName %>] __TEST__: ${__TEST__}`)
13
+ <%_ } _%>
14
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ import '../<%- config.mainPackageDirName %>/env.d.ts'
@@ -5,14 +5,20 @@
5
5
  "vue": "^3.5.13"
6
6
  },
7
7
  "devDependencies": {
8
- "@tsconfig/node22": "^22.0.0",
9
- "@types/node": "^22.13.9",
10
- "@vitejs/plugin-vue": "^5.2.1",
8
+ <%_ if (config.includeTailwind) { _%>
9
+ "@tailwindcss/vite": "^4.1.5",
10
+ <%_ } _%>
11
+ "@tsconfig/node22": "^22.0.1",
12
+ "@types/node": "^22.13.14",
13
+ "@vitejs/plugin-vue": "^5.2.3",
11
14
  "@vue/tsconfig": "^0.7.0",
12
15
  "npm-run-all2": "^7.0.2",
13
16
  "rimraf": "^5.0.1",
17
+ <%_ if (config.includeTailwind) { _%>
18
+ "tailwindcss": "^4.1.5",
19
+ <%_ } _%>
14
20
  "typescript": "~5.8.0",
15
- "vite": "^6.2.1",
21
+ "vite": "^6.2.4",
16
22
  "vite-plugin-vue-devtools": "^7.7.2",
17
23
  "vue-tsc": "^2.2.8"
18
24
  },
@@ -3,6 +3,9 @@ import { fileURLToPath, URL } from 'node:url'
3
3
  import { defineConfig, type UserConfig } from 'vite'
4
4
  import vue from '@vitejs/plugin-vue'
5
5
  import vueDevTools from 'vite-plugin-vue-devtools'
6
+ <%_ if (config.includeTailwind) { _%>
7
+ import tailwindcss from '@tailwindcss/vite'
8
+ <%_ } _%>
6
9
 
7
10
  <%_ if (config.includeAtAliases) { _%>
8
11
  const librarySrc = fileURLToPath(new URL('../<%- config.mainPackageDirName %>/src/', import.meta.url))
@@ -12,6 +15,9 @@ const playgroundSrc = fileURLToPath(new URL('./src/', import.meta.url))
12
15
  export default defineConfig(({ mode }): UserConfig => ({
13
16
  plugins: [
14
17
  vue(),
18
+ <%_ if (config.includeTailwind) { _%>
19
+ tailwindcss(),
20
+ <%_ } _%>
15
21
  vueDevTools()
16
22
  ],
17
23
 
@@ -21,11 +27,13 @@ export default defineConfig(({ mode }): UserConfig => ({
21
27
  {
22
28
  find: '@',
23
29
  replacement: '@',
24
- customResolver(source, importer) {
25
- return source.replace(
30
+ customResolver(source, importer, options) {
31
+ const filePath = source.replace(
26
32
  /^@\//,
27
33
  importer?.startsWith(librarySrc) ? librarySrc : playgroundSrc
28
34
  )
35
+
36
+ return this.resolve(filePath, importer, options)
29
37
  }
30
38
  }, {
31
39
  find: '<%- config.scopedPackageName %>',
@@ -1,9 +1,9 @@
1
1
  <script setup lang="ts">
2
- import { ExampleComponent, MyPanel } from '@scopedPackageName@'
2
+ import { ExampleComponent, MyPanel } from '<%- config.scopedPackageName %>'
3
3
  </script>
4
4
 
5
5
  <template>
6
- <div class="main">
6
+ <div class="main<%- config.includeTailwind ? ' flex flex-col max-w-75 gap-2.5 m-2.5' : '' %>">
7
7
  <ExampleComponent />
8
8
  <MyPanel title="Panel title" footer="Panel footer">
9
9
  Header and footer
@@ -20,6 +20,7 @@ import { ExampleComponent, MyPanel } from '@scopedPackageName@'
20
20
  </div>
21
21
  </template>
22
22
 
23
+ <%_ if (!config.includeTailwind) { _%>
23
24
  <style scoped>
24
25
  .main {
25
26
  max-width: 300px;
@@ -29,3 +30,4 @@ import { ExampleComponent, MyPanel } from '@scopedPackageName@'
29
30
  margin-top: 10px;
30
31
  }
31
32
  </style>
33
+ <%_ } _%>
@@ -0,0 +1,3 @@
1
+ @import "tailwindcss";
2
+
3
+ @source ".";
@@ -1,10 +1,13 @@
1
1
  import { fileURLToPath, URL } from 'node:url'
2
2
 
3
3
  import { defineConfigWithTheme } from 'vitepress'
4
+ <%_ if (config.includeTailwind) { _%>
5
+ import tailwindcss from '@tailwindcss/vite'
6
+ <%_ } _%>
4
7
 
5
8
  <%_ if (config.includeAtAliases) { _%>
6
9
  const librarySrc = fileURLToPath(new URL('../../<%- config.mainPackageDirName %>/src/', import.meta.url))
7
- const playgroundSrc = fileURLToPath(new URL('../src/', import.meta.url))
10
+ const docsSrc = fileURLToPath(new URL('../src/', import.meta.url))
8
11
  <%_ } _%>
9
12
 
10
13
  export default ({ mode }: { mode: string }) => defineConfigWithTheme({
@@ -34,17 +37,25 @@ export default ({ mode }: { mode: string }) => defineConfigWithTheme({
34
37
  <%_ } _%>
35
38
 
36
39
  vite: {
40
+ <%_ if (config.includeTailwind) { _%>
41
+ plugins: [
42
+ tailwindcss()
43
+ ],
44
+ <%_ } _%>
45
+
37
46
  resolve: {
38
47
  <%_ if (config.includeAtAliases) { _%>
39
48
  alias: [
40
49
  {
41
50
  find: '@',
42
51
  replacement: '@',
43
- customResolver(source, importer) {
44
- return source.replace(
52
+ customResolver(source, importer, options) {
53
+ const filePath = source.replace(
45
54
  /^@\//,
46
- importer?.startsWith(librarySrc) ? librarySrc : playgroundSrc
55
+ importer?.startsWith(librarySrc) ? librarySrc : docsSrc
47
56
  )
57
+
58
+ return this.resolve(filePath, importer, options)
48
59
  }
49
60
  }, {
50
61
  find: '<%- config.scopedPackageName %>',
@@ -0,0 +1,3 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ import '../<%- config.mainPackageDirName %>/env.d.ts'
@@ -5,11 +5,20 @@
5
5
  "vue": "^3.5.13"
6
6
  },
7
7
  "devDependencies": {
8
- "@tsconfig/node22": "^22.0.0",
9
- "@types/node": "^22.13.9",
8
+ <%_ if (config.includeTailwind) { _%>
9
+ "@tailwindcss/vite": "^4.1.5",
10
+ <%_ } _%>
11
+ "@tsconfig/node22": "^22.0.1",
12
+ "@types/node": "^22.13.14",
10
13
  "@vue/tsconfig": "^0.7.0",
11
14
  "npm-run-all2": "^7.0.2",
12
- "rimraf": "^6.0.1",
15
+ <%_ if (config.includeVpRaw) { _%>
16
+ "postcss": "^8.5.3",
17
+ <%_ } _%>
18
+ "rimraf": "^5.0.1",
19
+ <%_ if (config.includeTailwind) { _%>
20
+ "tailwindcss": "^4.1.5",
21
+ <%_ } _%>
13
22
  "typescript": "~5.8.0",
14
23
  "vitepress": "^1.6.3",
15
24
  "vue-tsc": "^2.2.8"
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  layout: home
3
3
 
4
- title: @unscopedPackageName@
4
+ title: <%- config.unscopedPackageName %>
5
5
  titleTemplate: Title template
6
6
 
7
7
  hero:
8
- name: @unscopedPackageName@
8
+ name: <%- config.unscopedPackageName %>
9
9
  text: Description
10
10
  tagline: Tag line!
11
11
  actions:
@@ -14,7 +14,7 @@ hero:
14
14
  link: /introduction
15
15
  - theme: alt
16
16
  text: View on GitHub
17
- link: https://github.com/@githubPath@
17
+ link: https://github.com/<%- config.githubPath %>
18
18
  - theme: alt
19
19
  text: See a demo
20
20
  link: https://play.vuejs.org/
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { ExampleComponent, MyPanel } from '@scopedPackageName@'
2
+ import { ExampleComponent, MyPanel } from '<%- config.scopedPackageName %>'
3
3
  </script>
4
4
 
5
5
  <style scoped>
@@ -10,6 +10,9 @@ import { ExampleComponent, MyPanel } from '@scopedPackageName@'
10
10
 
11
11
  # Introduction
12
12
 
13
+ <%_ if (config.includeVpRaw) { _%>
14
+ ::: raw
15
+ <%_ } _%>
13
16
  <ExampleComponent />
14
17
 
15
18
  <MyPanel title="Panel title" footer="Panel footer">
@@ -27,3 +30,6 @@ import { ExampleComponent, MyPanel } from '@scopedPackageName@'
27
30
  <MyPanel>
28
31
  No header or footer
29
32
  </MyPanel>
33
+ <%_ if (config.includeVpRaw) { _%>
34
+ :::
35
+ <%_ } _%>
@@ -0,0 +1,10 @@
1
+ import { postcssIsolateStyles } from 'vitepress'
2
+
3
+ export default {
4
+ plugins: [
5
+ // See https://vitepress.dev/guide/markdown#raw
6
+ postcssIsolateStyles({
7
+ includeFiles: [/base\.css/, /vp-doc\.css/]
8
+ })
9
+ ]
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skirtle/create-vue-lib",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "author": "skirtle",
5
5
  "license": "MIT",
6
6
  "description": "Create a library using Vue and Vite",
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
@@ -1,15 +0,0 @@
1
- <script setup lang="ts">
2
-
3
- </script>
4
-
5
- <template>
6
- <div class="panel-section">
7
- <slot />
8
- </div>
9
- </template>
10
-
11
- <style scoped>
12
- .panel-section {
13
- padding: 10px;
14
- }
15
- </style>
@@ -1,3 +0,0 @@
1
- export { default as ExampleComponent } from './components/ExampleComponent.vue'
2
- export { default as MyPanel } from './components/MyPanel.vue'
3
- export { default as MyPanelSection } from './components/MyPanelSection.vue'
@@ -1,3 +0,0 @@
1
- /// <reference types="vite/client" />
2
-
3
- import '../@projectName@/src/global.d.ts'
@@ -1,3 +0,0 @@
1
- /// <reference types="vite/client" />
2
-
3
- import '../@projectName@/src/global.d.ts'