Skip to content

Commit e0b4ef9

Browse files
committed
2.0.0
1 parent 718bef6 commit e0b4ef9

File tree

3 files changed

+14
-95
lines changed

3 files changed

+14
-95
lines changed

.github/workflows/CI.yaml

Lines changed: 2 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -12,98 +12,17 @@ on:
1212

1313
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1414
jobs:
15-
install:
16-
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, '.md')"
17-
strategy:
18-
matrix:
19-
os: [ubuntu-latest, macos-latest, windows-latest]
20-
node: ["16"]
21-
name: install - ${{ matrix.os }} - ${{ matrix.node }}
22-
runs-on: ${{ matrix.os }}
23-
steps:
24-
- uses: actions/checkout@v2
25-
- name: Use Node.js
26-
uses: actions/setup-node@v1
27-
with:
28-
node-version: ${{ matrix.node }}
29-
- name: restore lerna
30-
uses: actions/cache@v2
31-
with:
32-
path: |
33-
node_modules
34-
*/*/node_modules
35-
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
36-
restore-keys: |
37-
${{ runner.os }}-${{ matrix.node-version }}-nodemodules-
38-
- name: Install dependencies
39-
run: |
40-
yarn
41-
42-
lint:
43-
needs: install
44-
strategy:
45-
matrix:
46-
os: [ubuntu-latest, macos-latest, windows-latest]
47-
node: ["16"]
48-
name: lint - ${{ matrix.os }} - ${{ matrix.node }}
49-
runs-on: ${{ matrix.os }}
50-
steps:
51-
- uses: actions/checkout@v2
52-
- name: Use Node.js
53-
uses: actions/setup-node@v1
54-
with:
55-
node-version: ${{ matrix.node }}
56-
- name: Load node_modules
57-
uses: actions/cache@v2
58-
with:
59-
path: |
60-
node_modules
61-
*/*/node_modules
62-
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
63-
- run: yarn lint
64-
build:
65-
needs: [lint]
66-
strategy:
67-
matrix:
68-
os: [ubuntu-latest, macos-latest, windows-latest]
69-
node: ["16"]
70-
name: build - ${{ matrix.os }} - ${{ matrix.node }}
71-
runs-on: ${{ matrix.os }}
72-
steps:
73-
- uses: actions/checkout@v2
74-
- name: Use Node.js
75-
uses: actions/setup-node@v1
76-
with:
77-
node-version: ${{ matrix.node }}
78-
- name: Load node_modules
79-
uses: actions/cache@v2
80-
with:
81-
path: |
82-
node_modules
83-
*/*/node_modules
84-
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
85-
- run: yarn build
86-
- name: Upload artifact
87-
uses: actions/upload-artifact@v3
88-
with:
89-
name: build_output
90-
path: bin
91-
9215
publish:
9316
name: Publish
9417
runs-on: ubuntu-latest
95-
needs: [build]
9618
steps:
9719
- uses: actions/checkout@v2
9820
- name: Setup node
9921
uses: actions/setup-node@v1
10022
with:
10123
node-version: 16
102-
- name: Download artifacts
103-
uses: actions/download-artifact@v3
104-
with:
105-
name: build_output
106-
path: bin
24+
- name: build
25+
run: yarn && yarn build
10726
- name: Check out my other private repo
10827
uses: actions/checkout@master
10928
with:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-ssr-app",
3-
"version": "1.1.198",
3+
"version": "2.0.0",
44
"description": "Create Serverless SSR App",
55
"main": "./bin/init.js",
66
"scripts": {

src/init.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const init = async (options?: Options) => {
3535
message: 'Select ssr framework version (v6 or v7):',
3636
choices: [
3737
{ title: 'v7(Recommend, Support Rspack, Rolldown-Vite, Webpack@4)', value: 'v7' },
38-
{ title: 'v6(Support Webpack@4, Vite@2)', value: 'v6' },
38+
{ title: 'v6(Support Webpack@4, Vite@2)', value: 'v6' }
3939
]
4040
}, {
4141
onCancel: () => {
@@ -78,9 +78,9 @@ const init = async (options?: Options) => {
7878
{ title: 'Rspack', value: 'rspack' },
7979
...(!['nestjs-vue-ssr', 'midway-vue-ssr'].includes(template) ? [{ title: 'Rolldown-Vite', value: 'vite' }] : []),
8080
{ title: 'Webpack', value: 'webpack' }
81-
],
81+
]
8282
}
83-
]);
83+
])
8484
tools = response.tools
8585
}
8686
logGreen(`${template} is creating...`)
@@ -90,14 +90,14 @@ const init = async (options?: Options) => {
9090
const pkgJson = require(join(cwd, `./${targetDir}/package.json`))
9191
const bootstrapFileName = template.includes('nest') ? 'dist/main.js' : 'bootstrap.js'
9292
pkgJson.scripts = {
93-
"start": `ssr start ${tools[0] !== 'webpack' ? `--tool ${tools[0]}` : ''}`,
94-
...(tools.includes('vite') ? { "start:vite": "ssr start --tool vite" } : {}),
95-
...(tools.includes('rspack') ? { "start:rspack": "ssr start --tool rspack" } : {}),
96-
"prod": `ssr build ${tools[0] !== 'webpack' ? `--tool ${tools[0]}` : ''} && NODE_ENV=production node ${bootstrapFileName}`,
97-
...(tools.includes('vite') ? { "prod:vite": `ssr build --tool vite && NODE_ENV=production node ${bootstrapFileName}` } : {}),
98-
...(tools.includes('rspack') ? { "prod:rspack": `ssr build --tool rspack && NODE_ENV=production node ${bootstrapFileName}` } : {}),
99-
"lint": "biome format --diagnostic-level error",
100-
"lint:fix": "biome format --diagnostic-level error --write"
93+
start: `ssr start ${tools[0] !== 'webpack' ? `--tool ${tools[0]}` : ''}`,
94+
...(tools.includes('vite') ? { 'start:vite': 'ssr start --tool vite' } : {}),
95+
...(tools.includes('rspack') ? { 'start:rspack': 'ssr start --tool rspack' } : {}),
96+
prod: `ssr build ${tools[0] !== 'webpack' ? `--tool ${tools[0]}` : ''} && NODE_ENV=production node ${bootstrapFileName}`,
97+
...(tools.includes('vite') ? { 'prod:vite': `ssr build --tool vite && NODE_ENV=production node ${bootstrapFileName}` } : {}),
98+
...(tools.includes('rspack') ? { 'prod:rspack': `ssr build --tool rspack && NODE_ENV=production node ${bootstrapFileName}` } : {}),
99+
lint: 'biome format --diagnostic-level error',
100+
'lint:fix': 'biome format --diagnostic-level error --write'
101101
}
102102
const devDependencies = pkgJson.devDependencies
103103
if (!tools.includes('webpack')) {

0 commit comments

Comments
 (0)