@skirtle/create-vue-lib 0.0.8 → 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 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.9",
5701
5701
  author: "skirtle",
5702
5702
  license: "MIT",
5703
5703
  description: "Create a library using Vue and Vite",
@@ -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
@@ -2,10 +2,7 @@
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!')
@@ -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>
@@ -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
+ }
@@ -1,3 +1,3 @@
1
1
  /// <reference types="vite/client" />
2
2
 
3
- import '../@projectName@/src/global.d.ts'
3
+ import '../@projectName@/env.d.ts'
@@ -1,3 +1,3 @@
1
1
  /// <reference types="vite/client" />
2
2
 
3
- import '../@projectName@/src/global.d.ts'
3
+ import '../@projectName@/env.d.ts'
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.9",
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>