@skirtle/create-vue-lib 0.0.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.
Files changed (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -0
  3. package/dist/index.cjs +5802 -0
  4. package/dist/template/base/config/.editorconfig +7 -0
  5. package/dist/template/base/config/README.md.ejs +5 -0
  6. package/dist/template/base/config/package.json.ejs +35 -0
  7. package/dist/template/base/config/packages/@projectName@/README.md.ejs +5 -0
  8. package/dist/template/base/config/packages/@projectName@/env.d.ts +1 -0
  9. package/dist/template/base/config/packages/@projectName@/package.json +73 -0
  10. package/dist/template/base/config/packages/@projectName@/src/global.d.ts +1 -0
  11. package/dist/template/base/config/packages/@projectName@/tsconfig.app.json +11 -0
  12. package/dist/template/base/config/packages/@projectName@/tsconfig.json +14 -0
  13. package/dist/template/base/config/packages/@projectName@/tsconfig.node.json +18 -0
  14. package/dist/template/base/config/packages/@projectName@/tsconfig.vitest.json +10 -0
  15. package/dist/template/base/config/packages/@projectName@/vite.config.mts +75 -0
  16. package/dist/template/base/config/pnpm-workspace.yaml +2 -0
  17. package/dist/template/base/config/scripts/preinstall.js +6 -0
  18. package/dist/template/base/config/tsconfig.json +4 -0
  19. package/dist/template/base/examples/packages/@projectName@/src/components/Example.vue +28 -0
  20. package/dist/template/base/examples/packages/@projectName@/src/components/MyPanel.vue +62 -0
  21. package/dist/template/base/examples/packages/@projectName@/src/components/MyPanelSection.vue +15 -0
  22. package/dist/template/base/examples/packages/@projectName@/src/components/__tests__/MyPanel.spec.ts +61 -0
  23. package/dist/template/base/examples/packages/@projectName@/src/index.ts +3 -0
  24. package/dist/template/gh-pages/config/.github/workflows/pages.yml +55 -0
  25. package/dist/template/playground/config/packages/playground/env.d.ts +2 -0
  26. package/dist/template/playground/config/packages/playground/package.json +25 -0
  27. package/dist/template/playground/config/packages/playground/tsconfig.app.json +11 -0
  28. package/dist/template/playground/config/packages/playground/tsconfig.json +11 -0
  29. package/dist/template/playground/config/packages/playground/tsconfig.node.json +18 -0
  30. package/dist/template/playground/config/packages/playground/vite.config.mts +22 -0
  31. package/dist/template/playground/examples/packages/playground/index.html +13 -0
  32. package/dist/template/playground/examples/packages/playground/public/favicon.ico +0 -0
  33. package/dist/template/playground/examples/packages/playground/src/App.vue +28 -0
  34. package/dist/template/playground/examples/packages/playground/src/main.ts +4 -0
  35. package/dist/template/vitepress/config/packages/docs/.vitepress/config.mts.ejs +70 -0
  36. package/dist/template/vitepress/config/packages/docs/.vitepress/theme/index.ts +8 -0
  37. package/dist/template/vitepress/config/packages/docs/env.d.ts +2 -0
  38. package/dist/template/vitepress/config/packages/docs/package.json +24 -0
  39. package/dist/template/vitepress/config/packages/docs/tsconfig.app.json +13 -0
  40. package/dist/template/vitepress/config/packages/docs/tsconfig.json +11 -0
  41. package/dist/template/vitepress/config/packages/docs/tsconfig.node.json +18 -0
  42. package/dist/template/vitepress/examples/packages/docs/src/index.md +32 -0
  43. package/dist/template/vitepress/examples/packages/docs/src/introduction.md +29 -0
  44. package/package.json +54 -0
@@ -0,0 +1,4 @@
1
+ import { createApp } from 'vue'
2
+ import App from './App.vue'
3
+
4
+ createApp(App).mount('#app')
@@ -0,0 +1,70 @@
1
+ import { resolve } from 'node:path'
2
+
3
+ import { defineConfigWithTheme } from 'vitepress'
4
+
5
+ export default ({ mode }: { mode: string }) => defineConfigWithTheme({
6
+ srcDir: './src',
7
+ outDir: './dist',
8
+ base: '<%- config.docsBase %>',
9
+ title: '<%- config.scopedPackageName %>',
10
+ lang: 'en-US',
11
+ description: 'Description',
12
+ cleanUrls: true,
13
+
14
+ <%_ if (config.githubPagesOrigin) { _%>
15
+ sitemap: {
16
+ hostname: '<%- config.githubPagesOrigin %><%- config.docsBase %>'
17
+ },
18
+
19
+ transformHead({ page }) {
20
+ if (page !== '404.md') {
21
+ // The final replacement assumes `cleanUrls: true` is set
22
+ const canonicalUrl = `<%- config.githubPagesOrigin %><%- config.docsBase %>${page}`
23
+ .replace(/index\.md$/, '')
24
+ .replace(/\.md$/, '')
25
+
26
+ return [['link', { rel: 'canonical', href: canonicalUrl }]]
27
+ }
28
+ },
29
+
30
+ <%_ } _%>
31
+ vite: {
32
+ resolve: {
33
+ alias: {
34
+ '<%- config.scopedPackageName %>': resolve(__dirname, '../../<%- config.mainPackageDirName %>/src/index.ts')
35
+ }
36
+ },
37
+
38
+ define: {
39
+ __DEV__: JSON.stringify(mode !== 'production')
40
+ }
41
+ },
42
+
43
+ themeConfig: {
44
+ search: {
45
+ provider: 'local'
46
+ },
47
+
48
+ nav: [
49
+ { text: 'Guide', link: '/introduction' }
50
+ ],
51
+
52
+ <%_ if (config.githubUrl) { _%>
53
+ socialLinks: [
54
+ { icon: 'github', link: '<%- config.githubUrl %>' }
55
+ ],
56
+
57
+ <%_ } _%>
58
+ sidebar: [
59
+ {
60
+ text: 'Getting started',
61
+ items: [
62
+ {
63
+ text: 'Introduction',
64
+ link: '/introduction'
65
+ }
66
+ ]
67
+ }
68
+ ]
69
+ }
70
+ })
@@ -0,0 +1,8 @@
1
+ import type { Theme } from 'vitepress'
2
+ import DefaultTheme from 'vitepress/theme'
3
+
4
+ const theme: Theme = {
5
+ extends: DefaultTheme
6
+ }
7
+
8
+ export default theme
@@ -0,0 +1,2 @@
1
+ /// <reference types="vite/client" />
2
+ /// <reference path="../@projectName@/src/global.d.ts" />
@@ -0,0 +1,24 @@
1
+ {
2
+ "private": true,
3
+ "scripts": {
4
+ "clean": "rimraf dist && rimraf .vitepress/cache",
5
+ "dev": "vitepress dev .",
6
+ "type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
7
+ "build-only": "vitepress build .",
8
+ "build": "pnpm run type-check && pnpm run build-only",
9
+ "preview": "vitepress preview .",
10
+ "preinstall": "node ../../scripts/preinstall.js"
11
+ },
12
+ "dependencies": {
13
+ "vue": "^3.5.13"
14
+ },
15
+ "devDependencies": {
16
+ "@tsconfig/node22": "^22.0.0",
17
+ "@types/node": "^22.13.0",
18
+ "@vue/tsconfig": "^0.7.0",
19
+ "rimraf": "^6.0.1",
20
+ "typescript": "~5.7.3",
21
+ "vitepress": "^1.6.3",
22
+ "vue-tsc": "^2.2.0"
23
+ }
24
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "@vue/tsconfig/tsconfig.dom.json",
3
+ "include": ["env.d.ts", "src/**/*", "src/**/*.vue", "src/**/*.md"],
4
+ "compilerOptions": {
5
+ "tsBuildInfoFile": "../../node_modules/.tmp/tsconfig.docs.app.tsbuildinfo",
6
+ "paths": {
7
+ "@scopedPackageName@": ["../@projectName@/src/index.ts"]
8
+ }
9
+ },
10
+ "vueCompilerOptions": {
11
+ "vitePressExtensions": [".md"],
12
+ }
13
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "./tsconfig.node.json"
6
+ },
7
+ {
8
+ "path": "./tsconfig.app.json"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": "@tsconfig/node22/tsconfig.json",
3
+ "include": [
4
+ "vite.config.*",
5
+ "vitest.config.*",
6
+ "cypress.config.*",
7
+ "nightwatch.conf.*",
8
+ "playwright.config.*",
9
+ "eslint.config.*"
10
+ ],
11
+ "compilerOptions": {
12
+ "noEmit": true,
13
+ "tsBuildInfoFile": "../../node_modules/.tmp/tsconfig.docs.node.tsbuildinfo",
14
+ "module": "ESNext",
15
+ "moduleResolution": "Bundler",
16
+ "types": ["node"]
17
+ }
18
+ }
@@ -0,0 +1,32 @@
1
+ ---
2
+ layout: home
3
+
4
+ title: @unscopedPackageName@
5
+ titleTemplate: Title template
6
+
7
+ hero:
8
+ name: @unscopedPackageName@
9
+ text: Description
10
+ tagline: Tag line!
11
+ actions:
12
+ - theme: brand
13
+ text: Get Started
14
+ link: /introduction
15
+ - theme: alt
16
+ text: View on GitHub
17
+ link: https://github.com/???/???
18
+ - theme: alt
19
+ text: See a demo
20
+ link: https://play.vuejs.org/
21
+
22
+ features:
23
+ - icon: 🧩
24
+ title: Pretty great
25
+ details: Do great things.
26
+ - icon: 📦
27
+ title: Small and tree-shakable
28
+ details: Presumably.
29
+ - icon: 🔑
30
+ title: Type safe
31
+ details: A fully typed API.
32
+ ---
@@ -0,0 +1,29 @@
1
+ <script setup lang="ts">
2
+ import { Example as ExampleComponent, MyPanel } from '@scopedPackageName@'
3
+ </script>
4
+
5
+ <style scoped>
6
+ .panel {
7
+ margin: 20px 0;
8
+ }
9
+ </style>
10
+
11
+ # Introduction
12
+
13
+ <ExampleComponent />
14
+
15
+ <MyPanel title="Panel title" footer="Panel footer">
16
+ Header and footer
17
+ </MyPanel>
18
+
19
+ <MyPanel title="Panel title">
20
+ Just a header
21
+ </MyPanel>
22
+
23
+ <MyPanel footer="Panel footer">
24
+ Just a footer
25
+ </MyPanel>
26
+
27
+ <MyPanel>
28
+ No header or footer
29
+ </MyPanel>
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@skirtle/create-vue-lib",
3
+ "version": "0.0.0",
4
+ "author": "skirtle",
5
+ "license": "MIT",
6
+ "description": "Create a library using Vue and Vite",
7
+ "keywords": [
8
+ "vue",
9
+ "library",
10
+ "scaffold",
11
+ "vite",
12
+ "build"
13
+ ],
14
+ "homepage": "https://github.com/skirtles-code/create-vue-lib#readme",
15
+ "bugs": "https://github.com/skirtles-code/create-vue-lib/issues",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/skirtles-code/create-vue-lib.git"
19
+ },
20
+ "funding": "https://github.com/sponsors/skirtles-code",
21
+ "type": "module",
22
+ "engines": {
23
+ "node": ">=v18.3.0"
24
+ },
25
+ "bin": {
26
+ "create-vue-lib": "dist/index.cjs"
27
+ },
28
+ "files": [
29
+ "dist"
30
+ ],
31
+ "devDependencies": {
32
+ "@tsconfig/node22": "^22.0.0",
33
+ "@types/ejs": "^3.1.5",
34
+ "@types/node": "^22.13.0",
35
+ "@types/prompts": "^2.4.9",
36
+ "copyfiles": "^2.4.1",
37
+ "ejs": "^3.1.10",
38
+ "lint-staged": "^15.4.3",
39
+ "prompts": "^2.4.2",
40
+ "rimraf": "^6.0.1",
41
+ "simple-git-hooks": "^2.11.1",
42
+ "tsup": "^8.3.6",
43
+ "typescript": "^5.7.3"
44
+ },
45
+ "scripts": {
46
+ "clean": "rimraf dist",
47
+ "build": "pnpm run clean && pnpm run build:copy && pnpm run build:ts",
48
+ "build:copy": "copyfiles -u 1 -a \"src/template/**\" dist",
49
+ "build:ts": "tsup src/index.ts --format cjs --target node18",
50
+ "build:dts": "tsup src/index.ts --dts --format cjs --target node18",
51
+ "start": "node ./dist/index.cjs",
52
+ "preinstall": "npx only-allow pnpm"
53
+ }
54
+ }