create-rezor 0.3.0 → 0.3.2
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/package.json +3 -3
- package/template/base/package.json.ejs +4 -4
- package/template/javascript/build.js +1 -1
- package/template/javascript/src/app.js +2 -2
- package/template/javascript/src/contexts/theme.js +2 -2
- package/template/javascript/src/pages/home/index.js +2 -2
- package/template/javascript/src/pages/mine/index.js +2 -2
- package/template/skyline-javascript/src/pages/home/index.js +2 -2
- package/template/skyline-javascript/src/pages/mine/index.js +2 -2
- package/template/skyline-typescript/src/pages/home/index.ts +2 -2
- package/template/skyline-typescript/src/pages/mine/index.ts +2 -2
- package/template/typescript/build.js +1 -1
- package/template/typescript/src/app.ts +2 -2
- package/template/typescript/src/contexts/theme.ts +2 -2
- package/template/typescript/src/pages/home/index.ts +2 -2
- package/template/typescript/src/pages/mine/index.ts +2 -2
- package/template/vitest/_gitignore +1 -2
- package/template/vitest-typescript/_gitignore +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-rezor",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Rezor 脚手架",
|
|
6
6
|
"bin": {
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@eslint/js": "^10.0.1",
|
|
29
29
|
"@types/ejs": "^3.1.5",
|
|
30
|
-
"@types/node": "^26.4.
|
|
30
|
+
"@types/node": "^26.4.1",
|
|
31
31
|
"@types/prompts": "^2.4.9",
|
|
32
32
|
"eslint": "^10.9.1",
|
|
33
33
|
"prettier": "^3.9.6",
|
|
34
34
|
"typescript": "^6.0.3",
|
|
35
|
-
"typescript-eslint": "^8.
|
|
35
|
+
"typescript-eslint": "^8.69.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"format": "prettier --check \"**/*.{js,ts,json,md}\"",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^8.0.0",
|
|
30
|
-
"rezor": "^0.6.
|
|
30
|
+
"rezor": "^0.6.1",
|
|
31
31
|
trailing-comma
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@rollup/plugin-replace": "^6.0.3",
|
|
48
48
|
"@rollup/plugin-terser": "^1.0.0",
|
|
49
49
|
<%_ if (needsTypeScript && needsVitest) { _%>
|
|
50
|
-
"@types/node": "^26.4.
|
|
50
|
+
"@types/node": "^26.4.1",
|
|
51
51
|
<%_ } _%>
|
|
52
52
|
<%_ if (needsVitest) { _%>
|
|
53
53
|
"@vitest/coverage-v8": "^4.1.11",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<%_ } _%>
|
|
67
67
|
"fs-extra": "^11.4.0",
|
|
68
68
|
<%_ if (needsEslint) { _%>
|
|
69
|
-
"globals": "^17.
|
|
69
|
+
"globals": "^17.12.0",
|
|
70
70
|
<%_ } _%>
|
|
71
71
|
"kolorist": "^1.8.0",
|
|
72
72
|
"local-pkg": "^1.2.1",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"typescript": "^6.0.3",
|
|
87
87
|
<%_ } _%>
|
|
88
88
|
<%_ if (needsTypeScript && needsEslint) { _%>
|
|
89
|
-
"typescript-eslint": "^8.
|
|
89
|
+
"typescript-eslint": "^8.69.0",
|
|
90
90
|
<%_ } _%>
|
|
91
91
|
<%_ if (needsVitest) { _%>
|
|
92
92
|
"vitest": "^4.1.11",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createApp, useState,
|
|
1
|
+
import { createApp, useState, useGlobalContext, useThemeChange } from 'rezor';
|
|
2
2
|
import { ThemeContext } from './contexts/theme';
|
|
3
3
|
|
|
4
4
|
createApp(() => {
|
|
5
5
|
const [theme, setTheme] = useState(wx.getAppBaseInfo().theme);
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
useGlobalContext(ThemeContext, theme);
|
|
8
8
|
|
|
9
9
|
useThemeChange((result) => {
|
|
10
10
|
setTheme(result.theme);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createGlobalContext } from 'rezor';
|
|
2
2
|
|
|
3
|
-
export const ThemeContext =
|
|
3
|
+
export const ThemeContext = createGlobalContext('light');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, useGlobalContext, useState } from 'rezor';
|
|
2
2
|
import { ThemeContext } from '@/contexts/theme';
|
|
3
3
|
|
|
4
4
|
defineComponent(() => {
|
|
5
|
-
const theme =
|
|
5
|
+
const theme = useGlobalContext(ThemeContext);
|
|
6
6
|
const [count, setCount] = useState(0);
|
|
7
7
|
|
|
8
8
|
const themeText = theme === 'light' ? '浅色' : '深色';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, useGlobalContext, useState } from 'rezor';
|
|
2
2
|
import { ThemeContext } from '@/contexts/theme';
|
|
3
3
|
|
|
4
4
|
defineComponent(() => {
|
|
5
|
-
const theme =
|
|
5
|
+
const theme = useGlobalContext(ThemeContext);
|
|
6
6
|
const [count, setCount] = useState(0);
|
|
7
7
|
|
|
8
8
|
const themeText = theme === 'light' ? '浅色' : '深色';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, useGlobalContext, useState } from 'rezor';
|
|
2
2
|
import { ThemeContext } from '@/contexts/theme';
|
|
3
3
|
|
|
4
4
|
defineComponent((_, context) => {
|
|
5
|
-
const theme =
|
|
5
|
+
const theme = useGlobalContext(ThemeContext);
|
|
6
6
|
const [count, setCount] = useState(0);
|
|
7
7
|
|
|
8
8
|
const themeText = theme === 'light' ? '浅色' : '深色';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, useGlobalContext, useState } from 'rezor';
|
|
2
2
|
import { ThemeContext } from '@/contexts/theme';
|
|
3
3
|
|
|
4
4
|
defineComponent((_, context) => {
|
|
5
|
-
const theme =
|
|
5
|
+
const theme = useGlobalContext(ThemeContext);
|
|
6
6
|
const [count, setCount] = useState(0);
|
|
7
7
|
|
|
8
8
|
const themeText = theme === 'light' ? '浅色' : '深色';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, useGlobalContext, useState } from 'rezor';
|
|
2
2
|
import { ThemeContext } from '@/contexts/theme';
|
|
3
3
|
|
|
4
4
|
defineComponent((_, context) => {
|
|
5
|
-
const theme =
|
|
5
|
+
const theme = useGlobalContext(ThemeContext);
|
|
6
6
|
const [count, setCount] = useState(0);
|
|
7
7
|
|
|
8
8
|
const themeText = theme === 'light' ? '浅色' : '深色';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, useGlobalContext, useState } from 'rezor';
|
|
2
2
|
import { ThemeContext } from '@/contexts/theme';
|
|
3
3
|
|
|
4
4
|
defineComponent((_, context) => {
|
|
5
|
-
const theme =
|
|
5
|
+
const theme = useGlobalContext(ThemeContext);
|
|
6
6
|
const [count, setCount] = useState(0);
|
|
7
7
|
|
|
8
8
|
const themeText = theme === 'light' ? '浅色' : '深色';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createApp, useState,
|
|
1
|
+
import { createApp, useState, useGlobalContext, useThemeChange } from 'rezor';
|
|
2
2
|
import { ThemeContext } from './contexts/theme';
|
|
3
3
|
|
|
4
4
|
createApp(() => {
|
|
5
5
|
const [theme, setTheme] = useState(wx.getAppBaseInfo().theme!);
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
useGlobalContext(ThemeContext, theme);
|
|
8
8
|
|
|
9
9
|
useThemeChange((result) => {
|
|
10
10
|
setTheme(result.theme);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createGlobalContext } from 'rezor';
|
|
2
2
|
|
|
3
|
-
export const ThemeContext =
|
|
3
|
+
export const ThemeContext = createGlobalContext<'light' | 'dark'>('light');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, useGlobalContext, useState } from 'rezor';
|
|
2
2
|
import { ThemeContext } from '@/contexts/theme';
|
|
3
3
|
|
|
4
4
|
defineComponent(() => {
|
|
5
|
-
const theme =
|
|
5
|
+
const theme = useGlobalContext(ThemeContext);
|
|
6
6
|
const [count, setCount] = useState(0);
|
|
7
7
|
|
|
8
8
|
const themeText = theme === 'light' ? '浅色' : '深色';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, useGlobalContext, useState } from 'rezor';
|
|
2
2
|
import { ThemeContext } from '@/contexts/theme';
|
|
3
3
|
|
|
4
4
|
defineComponent(() => {
|
|
5
|
-
const theme =
|
|
5
|
+
const theme = useGlobalContext(ThemeContext);
|
|
6
6
|
const [count, setCount] = useState(0);
|
|
7
7
|
|
|
8
8
|
const themeText = theme === 'light' ? '浅色' : '深色';
|