Skip to content

Commit

Permalink
chore: switch from yarn to npm
Browse files Browse the repository at this point in the history
- update rollup config
  • Loading branch information
abichinger committed Nov 4, 2023
1 parent 055a6b1 commit bc162fe
Show file tree
Hide file tree
Showing 21 changed files with 30,679 additions and 16,386 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,30 @@ on:
- main
- next
- vue2
- beta

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18

- run: yarn install
- run: yarn build
- run: npm install
- run: npm run build
- run: |
cd demo
yarn install
yarn build-all
npm install
npm run build-all
- run: |
cd docs
yarn install
- run: yarn build-docs
npm install
- run: npm run build-docs

- name: Deploy
if: github.ref == 'refs/heads/main'
Expand All @@ -39,6 +40,7 @@ jobs:
clean-exclude: |
next
vue2
beta
- name: Deploy next
if: github.ref == 'refs/heads/next'
Expand All @@ -54,4 +56,12 @@ jobs:
with:
branch: gh-pages
folder: docs/src/.vuepress/dist
target-folder: ./vue2
target-folder: ./vue2

- name: Deploy beta
if: github.ref == 'refs/heads/beta'
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs/src/.vuepress/dist
target-folder: ./beta
40 changes: 14 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
name: Release

on: [push, pull_request]
on:
push:
branches:
- main
- next
- vue2
- beta

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16

- name: Install dependencies
run: yarn install

- name: Lint
run: yarn lint

- name: Run tests
run: yarn test
uses: ./.github/workflows/test.yml

release:
name: Release
Expand All @@ -31,21 +19,21 @@ jobs:
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18

- name: Install dependencies
run: yarn install
run: npm install

- name: Build
run: yarn build
run: npm run build

- name: Release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn multi-semantic-release --ignore-private-packages
run: npx multi-semantic-release --ignore-private-packages
14 changes: 4 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
name: Test

on:
push:
branches:
- main
pull_request:
branches:
- main
on: [push, pull_request, workflow_call]

jobs:
test:
Expand All @@ -23,8 +17,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install Node.js modules
run: yarn install
run: npm install
- name: Lint
run: yarn lint
run: npm run lint
- name: Test
run: yarn test
run: npm run test
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ Contributions are always welcome.

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

## Contributing new localization strings

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

## Install dependencies
```
yarn install
```bash
npm install
```

## Run development server
```
yarn dev-core
yarn dev-vuetify
yarn dev-docs
```bash
npm run dev -w=core
npm run dev -w=light
...
cd docs && npm run dev
```

## Test
```
yarn test
```bash
npm run test
```

## Build
```
yarn build
yarn build-docs
```bash
npm run build # builds all public packages
npm run build-demo # build demo, embedded inside docs
npm run build-docs # build documentaion using vuepress
```

## Attribution
Expand Down
9 changes: 2 additions & 7 deletions ant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "Cron editor for Ant Vue",
"main": "dist/ant.umd.js",
"module": "dist/ant.esm.js",
"unpkg": "dist/ant.min.js",
"browser": {
"./sfc": "src/CronEditor.vue"
},
Expand All @@ -13,12 +12,8 @@
"license": "MIT",
"private": false,
"scripts": {
"test": "jest",
"serve": "vue-cli-service serve dev/serve.js",
"build": "yarn build:umd & yarn run build:es & yarn run build:unpkg",
"build:umd": "yarn rollup --config build/rollup.config.js --format umd --file dist/ant.umd.js",
"build:es": "yarn rollup --config build/rollup.config.js --format es --file dist/ant.esm.js",
"build:unpkg": "yarn rollup --config build/rollup.config.js --format iife --file dist/ant.min.js",
"dev": "vue-cli-service serve dev/serve.js",
"build": "npx rollup --config",
"clean": "git clean -xf dist"
},
"dependencies": {
Expand Down
19 changes: 15 additions & 4 deletions ant/build/rollup.config.js → ant/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,21 @@ import css from 'rollup-plugin-css-only'
import vue from 'rollup-plugin-vue' // Handle .vue SFC files
export default {
input: 'src/index.js', // Path relative to package.json
output: {
name: 'ant',
exports: 'named',
},
output: [
{
format: 'es',
file: 'dist/ant.esm.js',
},
{
name: 'CronAnt',
format: 'umd',
file: 'dist/ant.umd.js',
globals: {
vue: 'Vue',
'@vue-js-cron/core': 'CronCore',
},
},
],
plugins: [
css({
output: 'ant.css',
Expand Down
Loading

0 comments on commit bc162fe

Please sign in to comment.