Skip to content

Commit b9231ef

Browse files
committed
use TypeScript
1 parent b5dc4ac commit b9231ef

File tree

6 files changed

+30
-12
lines changed

6 files changed

+30
-12
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
2+
dist
23
yarn.lock
3-
package-lock.json
4+
package-lock.json

.swcrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "http://json.schemastore.org/swcrc",
3+
"module": {
4+
"type": "commonjs",
5+
6+
// These are defaults.
7+
"strict": false,
8+
"strictMode": true,
9+
"lazy": false,
10+
"noInterop": false
11+
},
12+
"jsc": {
13+
"parser": {
14+
"syntax": "typescript",
15+
"tsx": false
16+
}
17+
}
18+
}

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
"access": "public"
99
},
1010
"scripts": {
11-
"test": "jest"
11+
"test": "jest",
12+
"swcify": "swc ./src/index.ts --out-dir ./dist",
13+
"build": "npm run swcify",
14+
"dev": "npm run swcify -- --watch"
1215
},
1316
"prettier": {
1417
"printWidth": 100,
@@ -21,20 +24,20 @@
2124
"<rootDir>/jest/custom-matchers.js"
2225
],
2326
"transform": {
24-
"\\.js$": "@swc/jest"
27+
"^.+\\.(t|j)sx?$": "@swc/jest"
2528
},
2629
"moduleNameMapper": {
2730
"^~/(.*)": "<rootDir>/$1"
2831
}
2932
},
3033
"files": [
31-
"./src/index.d.ts",
32-
"./src/index.js"
34+
"./dist"
3335
],
3436
"peerDependencies": {
3537
"tailwindcss": ">=3.2.0"
3638
},
3739
"devDependencies": {
40+
"@swc/cli": "^0.1.57",
3841
"@swc/core": "^1.3.7",
3942
"@swc/jest": "^0.2.23",
4043
"jest": "^29.1.2",

src/index.d.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.
File renamed without changes.

src/index.js renamed to src/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const plugin = require('tailwindcss/plugin')
2-
const { normalize } = require('tailwindcss/lib/util/dataTypes')
1+
import plugin from 'tailwindcss/plugin'
2+
import { normalize } from 'tailwindcss/lib/util/dataTypes'
33

4-
const containerQueries = plugin(function ({ matchVariant, theme }) {
4+
export default plugin(function containerQueries({ matchVariant, theme }) {
55
let values = theme('containers')
66

77
/**
@@ -100,5 +100,3 @@ const containerQueries = plugin(function ({ matchVariant, theme }) {
100100
}
101101
)
102102
})
103-
104-
module.exports = containerQueries

0 commit comments

Comments
 (0)