@skirtle/create-vue-lib 0.0.7 → 0.0.9
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/dist/index.cjs +6 -1
- package/dist/template/base/config/packages/@projectName@/{src/global.d.ts.ejs → env.d.ts.ejs} +2 -0
- package/dist/template/base/examples/packages/@projectName@/src/components/ExampleComponent.vue.ejs +1 -4
- package/dist/template/base/examples/packages/@projectName@/src/components/MyPanel.vue +5 -0
- package/dist/template/base/examples/packages/@projectName@/src/components/MyPanelSection.vue.ejs +25 -0
- package/dist/template/base/examples/packages/@projectName@/src/{index.ts → index.ts.ejs} +7 -0
- package/dist/template/ci/config/.github/workflows/ci.yml.ejs +38 -0
- package/dist/template/playground/config/packages/playground/env.d.ts +1 -1
- package/dist/template/vitepress/config/packages/docs/env.d.ts +1 -1
- package/package.json +1 -1
- package/dist/template/base/config/packages/@projectName@/env.d.ts +0 -1
- package/dist/template/base/examples/packages/@projectName@/src/components/MyPanelSection.vue +0 -15
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.
|
|
5700
|
+
version: "0.0.9",
|
|
5701
5701
|
author: "skirtle",
|
|
5702
5702
|
license: "MIT",
|
|
5703
5703
|
description: "Create a library using Vue and Vite",
|
|
@@ -5918,6 +5918,7 @@ async function init() {
|
|
|
5918
5918
|
const includeDocs = await togglePrompt("Include VitePress for documentation?", true);
|
|
5919
5919
|
const includeGithubPages = includeDocs && await togglePrompt("Include GitHub Pages config for documentation?");
|
|
5920
5920
|
const includePlayground = await togglePrompt("Include playground application for development?", true);
|
|
5921
|
+
const includeGithubCi = await togglePrompt("Include GitHub CI configuration?", !!githubPath);
|
|
5921
5922
|
const includeExamples = await togglePromptIf(extended, "Include example code?", true, "Yes", "No, just configs");
|
|
5922
5923
|
const includeAtAliases = await togglePromptIf(extended, "Configure @ as an alias for src?");
|
|
5923
5924
|
const includeTestVariable = await togglePromptIf(extended, "Configure global __TEST__ variable?");
|
|
@@ -5977,6 +5978,7 @@ async function init() {
|
|
|
5977
5978
|
includeEsLint,
|
|
5978
5979
|
includeEsLintStylistic,
|
|
5979
5980
|
includeVitest,
|
|
5981
|
+
includeGithubCi,
|
|
5980
5982
|
includeAtAliases,
|
|
5981
5983
|
includeTestVariable
|
|
5982
5984
|
};
|
|
@@ -5996,6 +5998,9 @@ async function init() {
|
|
|
5996
5998
|
if (config.includeVitest) {
|
|
5997
5999
|
copyTemplate("vitest", config);
|
|
5998
6000
|
}
|
|
6001
|
+
if (config.includeGithubCi) {
|
|
6002
|
+
copyTemplate("ci", config);
|
|
6003
|
+
}
|
|
5999
6004
|
console.log();
|
|
6000
6005
|
console.log(`${(0, import_picocolors.bgGreen)((0, import_picocolors.bold)((0, import_picocolors.black)("DONE")))} Project created`);
|
|
6001
6006
|
console.log();
|
package/dist/template/base/examples/packages/@projectName@/src/components/ExampleComponent.vue.ejs
CHANGED
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
import { ref } from 'vue'
|
|
3
3
|
|
|
4
4
|
if (__DEV__) {
|
|
5
|
-
console.log('
|
|
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!')
|
|
@@ -1,10 +1,15 @@
|
|
|
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>
|
package/dist/template/base/examples/packages/@projectName@/src/components/MyPanelSection.vue.ejs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
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">
|
|
17
|
+
<slot />
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<style scoped>
|
|
22
|
+
.panel-section {
|
|
23
|
+
padding: 10px;
|
|
24
|
+
}
|
|
25
|
+
</style>
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
export { default as ExampleComponent } from './components/ExampleComponent.vue'
|
|
2
2
|
export { default as MyPanel } from './components/MyPanel.vue'
|
|
3
3
|
export { default as MyPanelSection } from './components/MyPanelSection.vue'
|
|
4
|
+
|
|
5
|
+
if (__DEV__) {
|
|
6
|
+
console.log('[<%- config.scopedPackageName %>] dev mode')
|
|
7
|
+
<%_ if (config.includeTestVariable) { _%>
|
|
8
|
+
console.log(`[<%- config.scopedPackageName %>] __TEST__: ${__TEST__}`)
|
|
9
|
+
<%_ } _%>
|
|
10
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ['main']
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: ['main']
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
ci:
|
|
11
|
+
<%_ if (config.githubPath) { _%>
|
|
12
|
+
if: github.repository == '<%- config.githubPath %>'
|
|
13
|
+
<%_ } _%>
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
- name: Install pnpm
|
|
19
|
+
uses: pnpm/action-setup@v4
|
|
20
|
+
- name: Set up Node
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: 20
|
|
24
|
+
cache: 'pnpm'
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: pnpm install
|
|
27
|
+
<%_ if (config.includeEsLint) { _%>
|
|
28
|
+
- name: Lint
|
|
29
|
+
run: pnpm run lint
|
|
30
|
+
<%_ } _%>
|
|
31
|
+
- name: Type check
|
|
32
|
+
run: pnpm run type-check
|
|
33
|
+
- name: Build
|
|
34
|
+
run: pnpm run build
|
|
35
|
+
<%_ if (config.includeVitest) { _%>
|
|
36
|
+
- name: Test
|
|
37
|
+
run: pnpm run test:unit
|
|
38
|
+
<%_ } _%>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|