Skip to content

Commit 33cb398

Browse files
authored
Merge pull request #7 from 20minutes/feat/swc
Remove Babel & use SWC for the build
2 parents 3df91c2 + f06b526 commit 33cb398

File tree

18 files changed

+1387
-1981
lines changed

18 files changed

+1387
-1981
lines changed

.eslintrc

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
time: "04:00"
8+
timezone: Europe/Paris
9+
open-pull-requests-limit: 10
10+
- package-ecosystem: github-actions
11+
directory: "/"
12+
schedule:
13+
interval: weekly
14+
time: "04:00"
15+
timezone: Europe/Paris
16+
open-pull-requests-limit: 10

.github/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- dependencies
5+
authors:
6+
- dependabot

.github/workflows/ci.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
1-
name: Node.js Package
1+
name: Node Publish
22

33
on:
44
release:
5-
types: [created]
5+
types:
6+
- created
67

78
jobs:
89
build:
910
runs-on: ubuntu-latest
1011
steps:
11-
- uses: actions/checkout@v5
12-
- uses: actions/setup-node@v6
13-
with:
14-
node-version: 22
15-
cache: 'yarn'
16-
- run: yarn install
17-
- run: yarn test
12+
- name: checkout
13+
uses: actions/checkout@v6
1814

19-
publish-npm:
20-
needs: build
21-
runs-on: ubuntu-latest
22-
steps:
23-
- uses: actions/checkout@v5
24-
- uses: actions/setup-node@v6
15+
- name: use node
16+
uses: actions/setup-node@v6
2517
with:
26-
node-version: 22
27-
registry-url: https://registry.npmjs.org/
18+
node-version-file: '.nvmrc'
2819
cache: 'yarn'
20+
registry-url: https://registry.npmjs.org/
21+
2922
- run: yarn install
23+
3024
- run: yarn build
25+
26+
- run: yarn test
27+
3128
- run: yarn publish --access public
3229
env:
3330
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

.github/workflows/tests.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
CI: true
11+
TZ: 'Europe/Paris'
12+
NODE_ENV: 'test'
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: checkout
20+
uses: actions/checkout@v6
21+
22+
- name: use node
23+
uses: actions/setup-node@v6
24+
with:
25+
node-version-file: '.nvmrc'
26+
cache: 'yarn'
27+
28+
- name: install
29+
run: yarn install
30+
31+
- name: build
32+
run: yarn build
33+
34+
- name: lint
35+
run: yarn lint
36+
37+
- name: test
38+
run: yarn test

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

.swcrc.cjs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"jsc": {
3+
"target": "es2022",
4+
"parser": {
5+
"syntax": "ecmascript",
6+
"jsx": true
7+
},
8+
"transform": {
9+
"react": {
10+
"runtime": "classic"
11+
}
12+
}
13+
},
14+
"module": {
15+
"type": "commonjs"
16+
}
17+
}

.swcrc.esm

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"jsc": {
3+
"target": "es2022",
4+
"parser": {
5+
"syntax": "ecmascript",
6+
"jsx": true
7+
},
8+
"transform": {
9+
"react": {
10+
"runtime": "classic"
11+
}
12+
}
13+
},
14+
"module": {
15+
"type": "es6"
16+
}
17+
}

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
@20minutes/draft-convert
22
===============
33

4-
[![Node CI](https://github.com/20minutes/draft-convert/actions/workflows/ci.yml/badge.svg)](https://github.com/20minutes/draft-convert/actions/workflows/ci.yml)
5-
[![npm version](https://badge.fury.io/js/@20minutes%2Fdraft-convert.svg)](https://badge.fury.io/js/@20minutes%2Fdraft-convert)
6-
[![npm downloads](https://img.shields.io/npm/dt/@20minutes%2Fdraft-convert.svg?style=flat)](https://www.npmjs.com/package/@20minutes%2Fdraft-convert)
4+
[![Build status](https://github.com/20minutes/draft-convert/actions/workflows/tests.yml/badge.svg)](https://github.com/20minutes/draft-convert/actions/workflows/tests.yml)
5+
[![NPM](https://img.shields.io/npm/v/@20minutes/draft-convert)](https://www.npmjs.com/package/@20minutes/draft-convert)
76

87
Forked version:
98
- with deps up to date

0 commit comments

Comments
 (0)