@modern-js/create 2.69.5 → 3.0.0-alpha.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/bin/run.js +55 -8
- package/dist/index.js +5057 -47094
- package/dist/index.js.LICENSE.txt +8 -0
- package/package.json +19 -27
- package/template/.browserslistrc +5 -0
- package/template/.gitignore.handlebars +30 -0
- package/template/.nvmrc +2 -0
- package/template/README.md +32 -0
- package/template/biome.json +37 -0
- package/template/modern.config.ts +6 -0
- package/template/package.json.handlebars +40 -0
- package/template/src/modern-app-env.d.ts +1 -0
- package/template/src/modern.runtime.ts +3 -0
- package/template/src/routes/index.css +116 -0
- package/template/src/routes/layout.tsx +9 -0
- package/template/src/routes/page.tsx +96 -0
- package/template/tsconfig.json +14 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Lodash <https://lodash.com/>
|
|
4
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
5
|
+
* Released under MIT license <https://lodash.com/license>
|
|
6
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
7
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
8
|
+
*/
|
package/package.json
CHANGED
|
@@ -15,48 +15,40 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"
|
|
18
|
+
"type": "module",
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=20"
|
|
21
|
+
},
|
|
22
|
+
"version": "3.0.0-alpha.0",
|
|
19
23
|
"jsnext:source": "./src/index.ts",
|
|
20
24
|
"types": "./dist/types/index.d.ts",
|
|
21
25
|
"main": "./dist/index.js",
|
|
22
26
|
"bin": {
|
|
23
27
|
"create": "./bin/run.js"
|
|
24
28
|
},
|
|
25
|
-
"files": [
|
|
26
|
-
"/bin",
|
|
27
|
-
"/dist/index.js"
|
|
28
|
-
],
|
|
29
29
|
"exports": {
|
|
30
|
-
".":
|
|
31
|
-
"node": {
|
|
32
|
-
"jsnext:source": "./src/index.ts",
|
|
33
|
-
"import": "./dist/index.js",
|
|
34
|
-
"require": "./dist/index.js"
|
|
35
|
-
},
|
|
36
|
-
"default": "./dist/index.js"
|
|
37
|
-
}
|
|
30
|
+
".": "./dist/index.js"
|
|
38
31
|
},
|
|
32
|
+
"files": [
|
|
33
|
+
"template",
|
|
34
|
+
"dist",
|
|
35
|
+
"bin.js"
|
|
36
|
+
],
|
|
39
37
|
"devDependencies": {
|
|
40
|
-
"
|
|
41
|
-
"@
|
|
42
|
-
"@types/
|
|
43
|
-
"@types/node": "^18",
|
|
44
|
-
"commander": "10.0.1",
|
|
45
|
-
"jest": "^29",
|
|
46
|
-
"ts-node": "^10.9.1",
|
|
38
|
+
"tsx": "^4.21.0",
|
|
39
|
+
"@rslib/core": "0.18.5",
|
|
40
|
+
"@types/node": "^20",
|
|
47
41
|
"typescript": "^5",
|
|
48
|
-
"@modern-js/
|
|
49
|
-
"@modern-js/
|
|
50
|
-
"@scripts/build": "2.66.0",
|
|
51
|
-
"@scripts/jest-config": "2.66.0"
|
|
42
|
+
"@modern-js/i18n-utils": "3.0.0-alpha.0",
|
|
43
|
+
"@modern-js/rslib": "2.68.10"
|
|
52
44
|
},
|
|
53
45
|
"publishConfig": {
|
|
54
46
|
"registry": "https://registry.npmjs.org/",
|
|
55
47
|
"access": "public"
|
|
56
48
|
},
|
|
57
49
|
"scripts": {
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
50
|
+
"build": "rslib build",
|
|
51
|
+
"dev": "rslib build -w",
|
|
52
|
+
"start": "node ./dist/index.js"
|
|
61
53
|
}
|
|
62
54
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.DS_Store
|
|
2
|
+
|
|
3
|
+
.pnp
|
|
4
|
+
.pnp.js
|
|
5
|
+
.env.local
|
|
6
|
+
.env.*.local
|
|
7
|
+
.history
|
|
8
|
+
*.log*
|
|
9
|
+
|
|
10
|
+
node_modules/
|
|
11
|
+
.yarn-integrity
|
|
12
|
+
.pnpm-store/
|
|
13
|
+
*.tsbuildinfo
|
|
14
|
+
.changeset/pre.json
|
|
15
|
+
|
|
16
|
+
dist/
|
|
17
|
+
coverage/
|
|
18
|
+
release/
|
|
19
|
+
output/
|
|
20
|
+
output_resource/
|
|
21
|
+
log/
|
|
22
|
+
|
|
23
|
+
.vscode/**/*
|
|
24
|
+
!.vscode/settings.json
|
|
25
|
+
!.vscode/extensions.json
|
|
26
|
+
.idea/
|
|
27
|
+
|
|
28
|
+
**/*/typings/auto-generated
|
|
29
|
+
|
|
30
|
+
modern.config.local.*
|
package/template/.nvmrc
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Modern.js App
|
|
2
|
+
|
|
3
|
+
## Setup
|
|
4
|
+
|
|
5
|
+
Install the dependencies:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm install
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Get Started
|
|
12
|
+
|
|
13
|
+
Start the start server:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm start
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Build the app for production:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm build
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Preview the production build locally:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm serve
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
For more information, see the [Modern.js documentation](https://modernjs.dev/en).
|
|
32
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"defaultBranch": "main",
|
|
6
|
+
"clientKind": "git",
|
|
7
|
+
"useIgnoreFile": true
|
|
8
|
+
},
|
|
9
|
+
"formatter": {
|
|
10
|
+
"enabled": true,
|
|
11
|
+
"indentStyle": "space"
|
|
12
|
+
},
|
|
13
|
+
"javascript": {
|
|
14
|
+
"formatter": {
|
|
15
|
+
"quoteStyle": "single",
|
|
16
|
+
"arrowParentheses": "asNeeded",
|
|
17
|
+
"jsxQuoteStyle": "double",
|
|
18
|
+
"lineWidth": 80
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"linter": {
|
|
22
|
+
"enabled": true,
|
|
23
|
+
"rules": {
|
|
24
|
+
"recommended": true,
|
|
25
|
+
"suspicious": {
|
|
26
|
+
"noDuplicateFontNames": "off"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"organizeImports": {
|
|
31
|
+
"enabled": true
|
|
32
|
+
},
|
|
33
|
+
"files": {
|
|
34
|
+
"ignoreUnknown": true,
|
|
35
|
+
"ignore": [".vscode/**/*", "node_modules/**/*", "dist/**/*"]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{packageName}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"reset": "npx rimraf node_modules ./**/node_modules",
|
|
6
|
+
"dev": "modern dev",
|
|
7
|
+
"build": "modern build",
|
|
8
|
+
"serve": "modern serve"{{#unless isSubproject}},
|
|
9
|
+
"lint": "biome check",
|
|
10
|
+
"prepare": "simple-git-hooks"{{/unless}}
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=20"
|
|
14
|
+
}{{#unless isSubproject}},
|
|
15
|
+
"lint-staged": {
|
|
16
|
+
"*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [
|
|
17
|
+
"biome check --files-ignore-unknown=true"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"simple-git-hooks": {
|
|
21
|
+
"pre-commit": "npx lint-staged"
|
|
22
|
+
}{{/unless}},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@modern-js/runtime": "{{version}}",
|
|
25
|
+
"react": "^19.2.3",
|
|
26
|
+
"react-dom": "^19.2.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@modern-js/app-tools": "{{version}}",
|
|
30
|
+
"@modern-js/tsconfig": "{{version}}"{{#unless isSubproject}},
|
|
31
|
+
"@biomejs/biome": "1.9.4"{{/unless}},
|
|
32
|
+
"typescript": "~5.7.3",
|
|
33
|
+
"@types/node": "^20",
|
|
34
|
+
"@types/react": "^19.1.8",
|
|
35
|
+
"@types/react-dom": "^19.1.6"{{#unless isSubproject}},
|
|
36
|
+
"lint-staged": "~15.4.0",
|
|
37
|
+
"simple-git-hooks": "^2.11.1"{{/unless}},
|
|
38
|
+
"rimraf": "^6.0.1"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types='@modern-js/app-tools/types' />
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
html,
|
|
2
|
+
body {
|
|
3
|
+
padding: 0;
|
|
4
|
+
margin: 0;
|
|
5
|
+
font-family: PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
|
|
6
|
+
background: linear-gradient(to bottom, transparent, #fff) #eceeef;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
p {
|
|
10
|
+
margin: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
* {
|
|
14
|
+
-webkit-font-smoothing: antialiased;
|
|
15
|
+
-moz-osx-font-smoothing: grayscale;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.container-box {
|
|
20
|
+
min-height: 100vh;
|
|
21
|
+
max-width: 100%;
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
align-items: center;
|
|
26
|
+
padding-top: 10px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
main {
|
|
30
|
+
flex: 1;
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
align-items: center;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.title {
|
|
38
|
+
display: flex;
|
|
39
|
+
margin: 4rem 0 4rem;
|
|
40
|
+
align-items: center;
|
|
41
|
+
font-size: 4rem;
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.logo {
|
|
46
|
+
width: 6rem;
|
|
47
|
+
margin: 7px 0 0 1rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.name {
|
|
51
|
+
color: #4ecaff;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.description {
|
|
55
|
+
text-align: center;
|
|
56
|
+
line-height: 1.5;
|
|
57
|
+
font-size: 1.3rem;
|
|
58
|
+
color: #1b3a42;
|
|
59
|
+
margin-bottom: 5rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.code {
|
|
63
|
+
background: #fafafa;
|
|
64
|
+
border-radius: 12px;
|
|
65
|
+
padding: 0.6rem 0.9rem;
|
|
66
|
+
font-size: 1.05rem;
|
|
67
|
+
font-family:
|
|
68
|
+
Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
|
|
69
|
+
Bitstream Vera Sans Mono, Courier New, monospace;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.container-box .grid {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
width: 1100px;
|
|
77
|
+
margin-top: 3rem;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.card {
|
|
81
|
+
padding: 1.5rem;
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
height: 100px;
|
|
86
|
+
color: inherit;
|
|
87
|
+
text-decoration: none;
|
|
88
|
+
transition: 0.15s ease;
|
|
89
|
+
width: 45%;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.card:hover,
|
|
93
|
+
.card:focus {
|
|
94
|
+
transform: scale(1.05);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.card h2 {
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
font-size: 1.5rem;
|
|
101
|
+
margin: 0;
|
|
102
|
+
padding: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.card p {
|
|
106
|
+
opacity: 0.6;
|
|
107
|
+
font-size: 0.9rem;
|
|
108
|
+
line-height: 1.5;
|
|
109
|
+
margin-top: 1rem;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.arrow-right {
|
|
113
|
+
width: 1.3rem;
|
|
114
|
+
margin-left: 0.5rem;
|
|
115
|
+
margin-top: 3px;
|
|
116
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Helmet } from '@modern-js/runtime/head';
|
|
2
|
+
import './index.css';
|
|
3
|
+
|
|
4
|
+
const Index = () => (
|
|
5
|
+
<div className="container-box">
|
|
6
|
+
<Helmet>
|
|
7
|
+
<link
|
|
8
|
+
rel="icon"
|
|
9
|
+
type="image/x-icon"
|
|
10
|
+
href="https://lf3-static.bytednsdoc.com/obj/eden-cn/uhbfnupenuhf/favicon.ico"
|
|
11
|
+
/>
|
|
12
|
+
</Helmet>
|
|
13
|
+
<main>
|
|
14
|
+
<div className="title">
|
|
15
|
+
Welcome to
|
|
16
|
+
<img
|
|
17
|
+
className="logo"
|
|
18
|
+
src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/modern-js-logo.svg"
|
|
19
|
+
alt="Modern.js Logo"
|
|
20
|
+
/>
|
|
21
|
+
<p className="name">Modern.js</p>
|
|
22
|
+
</div>
|
|
23
|
+
<p className="description">
|
|
24
|
+
Get started by editing <code className="code">src/routes/page.tsx</code>
|
|
25
|
+
</p>
|
|
26
|
+
<div className="grid">
|
|
27
|
+
<a
|
|
28
|
+
href="https://modernjs.dev/guides/get-started/introduction.html"
|
|
29
|
+
target="_blank"
|
|
30
|
+
rel="noopener noreferrer"
|
|
31
|
+
className="card"
|
|
32
|
+
>
|
|
33
|
+
<h2>
|
|
34
|
+
Guide
|
|
35
|
+
<img
|
|
36
|
+
className="arrow-right"
|
|
37
|
+
src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"
|
|
38
|
+
alt="Guide"
|
|
39
|
+
/>
|
|
40
|
+
</h2>
|
|
41
|
+
<p>Follow the guides to use all features of Modern.js.</p>
|
|
42
|
+
</a>
|
|
43
|
+
<a
|
|
44
|
+
href="https://modernjs.dev/tutorials/foundations/introduction.html"
|
|
45
|
+
target="_blank"
|
|
46
|
+
className="card"
|
|
47
|
+
rel="noreferrer"
|
|
48
|
+
>
|
|
49
|
+
<h2>
|
|
50
|
+
Tutorials
|
|
51
|
+
<img
|
|
52
|
+
className="arrow-right"
|
|
53
|
+
src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"
|
|
54
|
+
alt="Tutorials"
|
|
55
|
+
/>
|
|
56
|
+
</h2>
|
|
57
|
+
<p>Learn to use Modern.js to create your first application.</p>
|
|
58
|
+
</a>
|
|
59
|
+
<a
|
|
60
|
+
href="https://modernjs.dev/configure/app/usage.html"
|
|
61
|
+
target="_blank"
|
|
62
|
+
className="card"
|
|
63
|
+
rel="noreferrer"
|
|
64
|
+
>
|
|
65
|
+
<h2>
|
|
66
|
+
Config
|
|
67
|
+
<img
|
|
68
|
+
className="arrow-right"
|
|
69
|
+
src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"
|
|
70
|
+
alt="Config"
|
|
71
|
+
/>
|
|
72
|
+
</h2>
|
|
73
|
+
<p>Find all configuration options provided by Modern.js.</p>
|
|
74
|
+
</a>
|
|
75
|
+
<a
|
|
76
|
+
href="https://github.com/web-infra-dev/modern.js"
|
|
77
|
+
target="_blank"
|
|
78
|
+
rel="noopener noreferrer"
|
|
79
|
+
className="card"
|
|
80
|
+
>
|
|
81
|
+
<h2>
|
|
82
|
+
GitHub
|
|
83
|
+
<img
|
|
84
|
+
className="arrow-right"
|
|
85
|
+
src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"
|
|
86
|
+
alt="Github"
|
|
87
|
+
/>
|
|
88
|
+
</h2>
|
|
89
|
+
<p>View the source code on GitHub; feel free to contribute.</p>
|
|
90
|
+
</a>
|
|
91
|
+
</div>
|
|
92
|
+
</main>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
export default Index;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@modern-js/tsconfig/base",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": false,
|
|
5
|
+
"jsx": "preserve",
|
|
6
|
+
"baseUrl": "./",
|
|
7
|
+
"paths": {
|
|
8
|
+
"@/*": ["./src/*"],
|
|
9
|
+
"@shared/*": ["./shared/*"]
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"include": ["src", "shared", "config", "modern.config.ts"],
|
|
13
|
+
"exclude": ["**/node_modules"]
|
|
14
|
+
}
|