create-rspeedy 0.7.0 → 0.8.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/CHANGELOG.md +9 -0
- package/README.md +34 -0
- package/package.json +5 -5
- package/template-common/src/App.css +76 -0
- package/template-common/src/assets/lynx-logo.png +0 -0
- package/template-common/src/assets/react-logo.png +0 -0
- package/template-react-js/src/App.jsx +37 -4
- package/template-react-ts/src/App.tsx +37 -4
package/CHANGELOG.md
CHANGED
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://lynxjs.org/rspeedy" target="blank"><img src="https://lynxjs.org/assets/rspeedy-banner.png" alt="Rspeedy Logo" /></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# create-rspeedy
|
|
6
|
+
|
|
7
|
+
Create a new Rspeedy x ReactLynx project.
|
|
8
|
+
|
|
9
|
+
Using `npm create`:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm create rspeedy@latest
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Using CLI flags:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx create-rspeedy --dir my-project
|
|
19
|
+
|
|
20
|
+
# Using abbreviations
|
|
21
|
+
npx create-rspeedy -d my-project
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Documentation
|
|
25
|
+
|
|
26
|
+
https://lynxjs.org/rspeedy
|
|
27
|
+
|
|
28
|
+
## Contributing
|
|
29
|
+
|
|
30
|
+
Please read the [Contributing Guide](https://github.com/tiktok/lynx-stack/blob/main/CONTRIBUTING.md).
|
|
31
|
+
|
|
32
|
+
## License
|
|
33
|
+
|
|
34
|
+
Rsbuild is [MIT licensed](https://github.com/tiktok/lynx-stack/blob/main/LICENSE).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-rspeedy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Create Rspeedy-powered ReactLynx apps with one command",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"create-rstack": "1.2.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@lynx-dev/qrcode-rsbuild-plugin": "^0.3.
|
|
33
|
-
"@lynx-dev/react": "^0.
|
|
34
|
-
"@lynx-dev/react-rsbuild-plugin": "^0.
|
|
35
|
-
"@lynx-dev/rspeedy": "^0.
|
|
32
|
+
"@lynx-dev/qrcode-rsbuild-plugin": "^0.3.1",
|
|
33
|
+
"@lynx-dev/react": "^0.104.0",
|
|
34
|
+
"@lynx-dev/react-rsbuild-plugin": "^0.8.0",
|
|
35
|
+
"@lynx-dev/rspeedy": "^0.8.0"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=18"
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
.theme-dark {
|
|
2
|
+
--color-background: #282c34;
|
|
3
|
+
--color-text: #e0e0e0;
|
|
4
|
+
}
|
|
5
|
+
.theme-light {
|
|
6
|
+
--color-background: #e0e0e0;
|
|
7
|
+
--color-text: #282c34;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.App {
|
|
11
|
+
background-color: var(--color-background);
|
|
12
|
+
min-height: 100vh;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
color: red;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
text {
|
|
21
|
+
color: var(--color-text);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.Logo {
|
|
25
|
+
width: 160px;
|
|
26
|
+
height: 160px;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
margin-bottom: 8px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.Logo--react {
|
|
34
|
+
width: 160px;
|
|
35
|
+
height: 160px;
|
|
36
|
+
animation: Logo--spin infinite 20s linear;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.Logo--lynx {
|
|
40
|
+
width: 120px;
|
|
41
|
+
height: 144px;
|
|
42
|
+
animation: Logo--shake infinite 0.5s ease;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.Title {
|
|
46
|
+
font-size: 36px;
|
|
47
|
+
font-weight: 700;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.Subtitle {
|
|
51
|
+
font-style: italic;
|
|
52
|
+
font-size: 22px;
|
|
53
|
+
font-weight: 600;
|
|
54
|
+
margin-bottom: 8px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@keyframes Logo--spin {
|
|
58
|
+
from {
|
|
59
|
+
transform: rotate(0deg);
|
|
60
|
+
}
|
|
61
|
+
to {
|
|
62
|
+
transform: rotate(360deg);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@keyframes Logo--shake {
|
|
67
|
+
0% {
|
|
68
|
+
transform: scale(1);
|
|
69
|
+
}
|
|
70
|
+
50% {
|
|
71
|
+
transform: scale(0.9);
|
|
72
|
+
}
|
|
73
|
+
100% {
|
|
74
|
+
transform: scale(1);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -1,13 +1,46 @@
|
|
|
1
|
-
import { useEffect } from '@lynx-dev/react'
|
|
1
|
+
import { useCallback, useEffect, useState } from '@lynx-dev/react'
|
|
2
|
+
|
|
3
|
+
import './App.css'
|
|
4
|
+
import lynxLogo from './assets/lynx-logo.png'
|
|
5
|
+
import reactLynxLogo from './assets/react-logo.png'
|
|
2
6
|
|
|
3
7
|
export function App() {
|
|
8
|
+
const [alterLogo, setAlterLogo] = useState(false)
|
|
9
|
+
const [theme, setTheme] = useState('dark')
|
|
10
|
+
|
|
4
11
|
useEffect(() => {
|
|
5
12
|
console.info('Hello, ReactLynx')
|
|
6
13
|
}, [])
|
|
7
14
|
|
|
15
|
+
const onTap = useCallback(() => {
|
|
16
|
+
'background-only'
|
|
17
|
+
setAlterLogo(!alterLogo)
|
|
18
|
+
setTheme(theme === 'light' ? 'dark' : 'light')
|
|
19
|
+
}, [theme, alterLogo])
|
|
20
|
+
|
|
8
21
|
return (
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
|
|
22
|
+
<page className={`theme-${theme}`}>
|
|
23
|
+
<view className='App'>
|
|
24
|
+
<view className='Logo' bindtap={onTap}>
|
|
25
|
+
{alterLogo
|
|
26
|
+
? <image src={lynxLogo} className='Logo--lynx' />
|
|
27
|
+
: <image src={reactLynxLogo} className='Logo--react' />}
|
|
28
|
+
</view>
|
|
29
|
+
<text className='Title'>React</text>
|
|
30
|
+
<text className='Subtitle'>on Lynx</text>
|
|
31
|
+
<text style={{ fontSize: '20px' }}>
|
|
32
|
+
Tap the logo and have fun!
|
|
33
|
+
</text>
|
|
34
|
+
<text
|
|
35
|
+
style={{
|
|
36
|
+
fontSize: '16px',
|
|
37
|
+
margin: '5px',
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
Edit <text style={{ fontStyle: 'italic' }}>src/App.tsx</text>{' '}
|
|
41
|
+
to see updates!
|
|
42
|
+
</text>
|
|
43
|
+
</view>
|
|
44
|
+
</page>
|
|
12
45
|
)
|
|
13
46
|
}
|
|
@@ -1,13 +1,46 @@
|
|
|
1
|
-
import { useEffect } from '@lynx-dev/react'
|
|
1
|
+
import { useCallback, useEffect, useState } from '@lynx-dev/react'
|
|
2
|
+
|
|
3
|
+
import './App.css'
|
|
4
|
+
import lynxLogo from './assets/lynx-logo.png'
|
|
5
|
+
import reactLynxLogo from './assets/react-logo.png'
|
|
2
6
|
|
|
3
7
|
export function App() {
|
|
8
|
+
const [alterLogo, setAlterLogo] = useState(false)
|
|
9
|
+
const [theme, setTheme] = useState('dark')
|
|
10
|
+
|
|
4
11
|
useEffect(() => {
|
|
5
12
|
console.info('Hello, ReactLynx')
|
|
6
13
|
}, [])
|
|
7
14
|
|
|
15
|
+
const onTap = useCallback(() => {
|
|
16
|
+
'background-only'
|
|
17
|
+
setAlterLogo(!alterLogo)
|
|
18
|
+
setTheme(theme === 'light' ? 'dark' : 'light')
|
|
19
|
+
}, [theme, alterLogo])
|
|
20
|
+
|
|
8
21
|
return (
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
|
|
22
|
+
<page className={`theme-${theme}`}>
|
|
23
|
+
<view className='App'>
|
|
24
|
+
<view className='Logo' bindtap={onTap}>
|
|
25
|
+
{alterLogo
|
|
26
|
+
? <image src={lynxLogo} className='Logo--lynx' />
|
|
27
|
+
: <image src={reactLynxLogo} className='Logo--react' />}
|
|
28
|
+
</view>
|
|
29
|
+
<text className='Title'>React</text>
|
|
30
|
+
<text className='Subtitle'>on Lynx</text>
|
|
31
|
+
<text style={{ fontSize: '20px' }}>
|
|
32
|
+
Tap the logo and have fun!
|
|
33
|
+
</text>
|
|
34
|
+
<text
|
|
35
|
+
style={{
|
|
36
|
+
fontSize: '16px',
|
|
37
|
+
margin: '5px',
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
Edit <text style={{ fontStyle: 'italic' }}>src/App.tsx</text>{' '}
|
|
41
|
+
to see updates!
|
|
42
|
+
</text>
|
|
43
|
+
</view>
|
|
44
|
+
</page>
|
|
12
45
|
)
|
|
13
46
|
}
|