create-slidev-theme 52.14.1 → 52.15.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/index.mjs CHANGED
@@ -17,6 +17,10 @@ const require = createRequire(import.meta.url)
17
17
  const __dirname = fileURLToPath(new URL('.', import.meta.url))
18
18
  const { version } = require('./package.json')
19
19
 
20
+ const RE_PNPM = /pnpm/
21
+ const RE_YARN = /yarn/
22
+ const RE_SLIDEV_THEME_PREFIX = /^slidev-theme-/
23
+
20
24
  const renameFiles = {
21
25
  _gitignore: '.gitignore',
22
26
  _npmrc: '.npmrc',
@@ -72,9 +76,9 @@ async function init() {
72
76
 
73
77
  prepareTemplate(root, path.join(__dirname, 'template'), packageName)
74
78
 
75
- const pkgManager = (/pnpm/.test(process.env.npm_execpath) || /pnpm/.test(process.env.npm_config_user_agent))
79
+ const pkgManager = (RE_PNPM.test(process.env.npm_execpath) || RE_PNPM.test(process.env.npm_config_user_agent))
76
80
  ? 'pnpm'
77
- : /yarn/.test(process.env.npm_execpath) ? 'yarn' : 'npm'
81
+ : RE_YARN.test(process.env.npm_execpath) ? 'yarn' : 'npm'
78
82
 
79
83
  const related = path.relative(cwd, root)
80
84
 
@@ -142,7 +146,7 @@ function getValidPackageName(projectName) {
142
146
  }
143
147
 
144
148
  function getThemeName(pkgName) {
145
- return pkgName.replace(/^slidev-theme-/, '')
149
+ return pkgName.replace(RE_SLIDEV_THEME_PREFIX, '')
146
150
  }
147
151
 
148
152
  function copyDir(srcDir, destDir) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-slidev-theme",
3
3
  "type": "module",
4
- "version": "52.14.1",
4
+ "version": "52.15.0",
5
5
  "description": "Create starter theme template for Slidev",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -17,7 +17,7 @@
17
17
  "create-slidev-theme": "index.mjs"
18
18
  },
19
19
  "engines": {
20
- "node": ">=18.0.0"
20
+ "node": ">=20.12.0"
21
21
  },
22
22
  "dependencies": {
23
23
  "ansis": "^4.2.0",
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  theme: ./
3
+ background: https://cover.sli.dev
3
4
  ---
4
5
 
5
6
  # Slidev Theme Starter
@@ -1,5 +1,19 @@
1
+ <script setup lang="ts">
2
+ import { handleBackground } from '@slidev/client/layoutHelper'
3
+ import { computed } from 'vue'
4
+
5
+ const props = defineProps({
6
+ background: {
7
+ type: String,
8
+ default: undefined,
9
+ },
10
+ })
11
+
12
+ const style = computed(() => handleBackground(props.background))
13
+ </script>
14
+
1
15
  <template>
2
- <div class="slidev-layout cover">
16
+ <div class="slidev-layout cover" :style="style">
3
17
  <div class="my-auto w-full">
4
18
  <slot />
5
19
  </div>
@@ -1,5 +1,19 @@
1
+ <script setup lang="ts">
2
+ import { handleBackground } from '@slidev/client/layoutHelper'
3
+ import { computed } from 'vue'
4
+
5
+ const props = defineProps({
6
+ background: {
7
+ type: String,
8
+ default: undefined,
9
+ },
10
+ })
11
+
12
+ const style = computed(() => handleBackground(props.background))
13
+ </script>
14
+
1
15
  <template>
2
- <div class="slidev-layout intro">
16
+ <div class="slidev-layout intro" :style="style">
3
17
  <div class="my-auto">
4
18
  <slot />
5
19
  </div>
@@ -5,7 +5,7 @@
5
5
  "slidev"
6
6
  ],
7
7
  "engines": {
8
- "node": ">=18.0.0"
8
+ "node": ">=20.12.0"
9
9
  },
10
10
  "scripts": {
11
11
  "build": "slidev build example.md",
@@ -14,10 +14,10 @@
14
14
  "screenshot": "slidev export example.md --format png"
15
15
  },
16
16
  "dependencies": {
17
- "@slidev/types": "^52.14.1"
17
+ "@slidev/types": "^52.15.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@slidev/cli": "^52.14.1"
20
+ "@slidev/cli": "^52.15.0"
21
21
  },
22
22
  "//": "Learn more: https://sli.dev/guide/write-theme.html",
23
23
  "slidev": {