Skip to content

Commit bc162fe

Browse files
committed
chore: switch from yarn to npm
- update rollup config
1 parent 055a6b1 commit bc162fe

21 files changed

+30679
-16386
lines changed

.github/workflows/release-docs.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,30 @@ on:
66
- main
77
- next
88
- vue2
9+
- beta
910

1011
jobs:
1112
build-and-deploy:
1213
runs-on: ubuntu-latest
1314
steps:
1415
- name: Checkout
15-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
1617

1718
- name: Setup Node.js
18-
uses: actions/setup-node@v1
19+
uses: actions/setup-node@v3
1920
with:
20-
node-version: 16
21+
node-version: 18
2122

22-
- run: yarn install
23-
- run: yarn build
23+
- run: npm install
24+
- run: npm run build
2425
- run: |
2526
cd demo
26-
yarn install
27-
yarn build-all
27+
npm install
28+
npm run build-all
2829
- run: |
2930
cd docs
30-
yarn install
31-
- run: yarn build-docs
31+
npm install
32+
- run: npm run build-docs
3233

3334
- name: Deploy
3435
if: github.ref == 'refs/heads/main'
@@ -39,6 +40,7 @@ jobs:
3940
clean-exclude: |
4041
next
4142
vue2
43+
beta
4244
4345
- name: Deploy next
4446
if: github.ref == 'refs/heads/next'
@@ -54,4 +56,12 @@ jobs:
5456
with:
5557
branch: gh-pages
5658
folder: docs/src/.vuepress/dist
57-
target-folder: ./vue2
59+
target-folder: ./vue2
60+
61+
- name: Deploy beta
62+
if: github.ref == 'refs/heads/beta'
63+
uses: JamesIves/github-pages-deploy-action@4.1.7
64+
with:
65+
branch: gh-pages
66+
folder: docs/src/.vuepress/dist
67+
target-folder: ./beta

.github/workflows/release.yml

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
name: Release
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- next
8+
- vue2
9+
- beta
410

511
jobs:
612
test:
7-
name: Test
8-
runs-on: ubuntu-latest
9-
steps:
10-
- name: Checkout
11-
uses: actions/checkout@v2
12-
13-
- name: Setup Node.js
14-
uses: actions/setup-node@v1
15-
with:
16-
node-version: 16
17-
18-
- name: Install dependencies
19-
run: yarn install
20-
21-
- name: Lint
22-
run: yarn lint
23-
24-
- name: Run tests
25-
run: yarn test
13+
uses: ./.github/workflows/test.yml
2614

2715
release:
2816
name: Release
@@ -31,21 +19,21 @@ jobs:
3119
if: github.event_name == 'push'
3220
steps:
3321
- name: Checkout
34-
uses: actions/checkout@v2
22+
uses: actions/checkout@v4
3523

3624
- name: Setup Node.js
37-
uses: actions/setup-node@v1
25+
uses: actions/setup-node@v3
3826
with:
39-
node-version: 16
27+
node-version: 18
4028

4129
- name: Install dependencies
42-
run: yarn install
30+
run: npm install
4331

4432
- name: Build
45-
run: yarn build
33+
run: npm run build
4634

4735
- name: Release
4836
env:
4937
GH_TOKEN: ${{ secrets.GH_TOKEN }}
5038
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
51-
run: yarn multi-semantic-release --ignore-private-packages
39+
run: npx multi-semantic-release --ignore-private-packages

.github/workflows/test.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
name: Test
22

3-
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
3+
on: [push, pull_request, workflow_call]
104

115
jobs:
126
test:
@@ -23,8 +17,8 @@ jobs:
2317
with:
2418
node-version: ${{ matrix.node-version }}
2519
- name: Install Node.js modules
26-
run: yarn install
20+
run: npm install
2721
- name: Lint
28-
run: yarn lint
22+
run: npm run lint
2923
- name: Test
30-
run: yarn test
24+
run: npm run test

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ Contributions are always welcome.
3333

3434
Before you open a PR, please make sure your changes comply with the following rules:
3535
- commits messages follow the [AngularJS commit message format](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit)
36-
- `yarn lint` completes without errors
37-
- `yarn build` completes without errors
38-
- `yarn test` completes without errors
36+
- `npm run lint` completes without errors
37+
- `npm run build` completes without errors
38+
- `npm run test` completes without errors
3939

4040
## Contributing new localization strings
4141

@@ -51,26 +51,28 @@ You can use the commit [feat: add portuguese translation](https://github.com/abi
5151
# Development
5252

5353
## Install dependencies
54-
```
55-
yarn install
54+
```bash
55+
npm install
5656
```
5757

5858
## Run development server
59-
```
60-
yarn dev-core
61-
yarn dev-vuetify
62-
yarn dev-docs
59+
```bash
60+
npm run dev -w=core
61+
npm run dev -w=light
62+
...
63+
cd docs && npm run dev
6364
```
6465

6566
## Test
66-
```
67-
yarn test
67+
```bash
68+
npm run test
6869
```
6970

7071
## Build
71-
```
72-
yarn build
73-
yarn build-docs
72+
```bash
73+
npm run build # builds all public packages
74+
npm run build-demo # build demo, embedded inside docs
75+
npm run build-docs # build documentaion using vuepress
7476
```
7577

7678
## Attribution

ant/package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "Cron editor for Ant Vue",
55
"main": "dist/ant.umd.js",
66
"module": "dist/ant.esm.js",
7-
"unpkg": "dist/ant.min.js",
87
"browser": {
98
"./sfc": "src/CronEditor.vue"
109
},
@@ -13,12 +12,8 @@
1312
"license": "MIT",
1413
"private": false,
1514
"scripts": {
16-
"test": "jest",
17-
"serve": "vue-cli-service serve dev/serve.js",
18-
"build": "yarn build:umd & yarn run build:es & yarn run build:unpkg",
19-
"build:umd": "yarn rollup --config build/rollup.config.js --format umd --file dist/ant.umd.js",
20-
"build:es": "yarn rollup --config build/rollup.config.js --format es --file dist/ant.esm.js",
21-
"build:unpkg": "yarn rollup --config build/rollup.config.js --format iife --file dist/ant.min.js",
15+
"dev": "vue-cli-service serve dev/serve.js",
16+
"build": "npx rollup --config",
2217
"clean": "git clean -xf dist"
2318
},
2419
"dependencies": {

ant/build/rollup.config.js renamed to ant/rollup.config.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,21 @@ import css from 'rollup-plugin-css-only'
33
import vue from 'rollup-plugin-vue' // Handle .vue SFC files
44
export default {
55
input: 'src/index.js', // Path relative to package.json
6-
output: {
7-
name: 'ant',
8-
exports: 'named',
9-
},
6+
output: [
7+
{
8+
format: 'es',
9+
file: 'dist/ant.esm.js',
10+
},
11+
{
12+
name: 'CronAnt',
13+
format: 'umd',
14+
file: 'dist/ant.umd.js',
15+
globals: {
16+
vue: 'Vue',
17+
'@vue-js-cron/core': 'CronCore',
18+
},
19+
},
20+
],
1021
plugins: [
1122
css({
1223
output: 'ant.css',

0 commit comments

Comments
 (0)