Skip to content

Commit cd28a7e

Browse files
chore: update deps. (#29)
* ci: check types.
1 parent 7e681cd commit cd28a7e

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
with:
2828
name: npm-debug-log-${{ hashFiles('package-lock.json') }}
2929
path: npm-debug.log
30+
- name: Types
31+
run: npm run check-types
3032
- name: Lint
3133
run: npm run lint
3234
- name: Test

codecov.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ coverage:
66
threshold: 0.5
77
patch:
88
default:
9-
target: 80.0
109
threshold: 1.0

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@knighted/specifier",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Node.js tool for updating your ES module and CommonJS specifiers.",
55
"type": "module",
66
"main": "dist",
@@ -54,7 +54,7 @@
5454
"url": "https://github.com/knightedcodemonkey/specifier/issues"
5555
},
5656
"dependencies": {
57-
"@knighted/walk": "^1.0.0-alpha.0",
57+
"@knighted/walk": "^1.0.0-rc.0",
5858
"magic-string": "^0.30.17",
5959
"oxc-parser": "^0.62.0"
6060
},

src/format.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const isBinaryExpression = (node: Node): node is BinaryExpression => {
2121
const isCallExpression = (node: Node): node is CallExpression => {
2222
return node.type === 'CallExpression' && node.callee !== undefined
2323
}
24-
const format = (src: string, ast: ParseResult, cb: Callback) => {
24+
const format = async (src: string, ast: ParseResult, cb: Callback) => {
2525
const code = new MagicString(src)
2626
const formatExpression = (expression: ImportExpression | CallExpression) => {
2727
/**
@@ -110,7 +110,7 @@ const format = (src: string, ast: ParseResult, cb: Callback) => {
110110
}
111111
}
112112

113-
walk(ast.program, {
113+
await walk(ast.program, {
114114
enter(node) {
115115
if (node.type === 'ExpressionStatement') {
116116
const { expression } = node

src/specifier.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const specifier = {
4444
const src = (await readFile(filename)).toString()
4545
const ast = parse(filename, src)
4646

47-
return format(src, ast, callback)
47+
return await format(src, ast, callback)
4848
},
4949

5050
async updateSrc(src: string, lang: ParserOptions['lang'], callback: Callback) {
@@ -58,7 +58,7 @@ const specifier = {
5858
: 'file.jsx'
5959
const ast = parse(filename, src)
6060

61-
return format(src, ast, callback)
61+
return await format(src, ast, callback)
6262
},
6363
} satisfies Specifier
6464

0 commit comments

Comments
 (0)