Skip to content

Commit

Permalink
build(napi): napi build --no-dts-cache (#8499)
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Jan 15, 2025
1 parent 629c417 commit aa9d7e4
Show file tree
Hide file tree
Showing 11 changed files with 154 additions and 165 deletions.
1 change: 0 additions & 1 deletion napi/minify/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,3 @@ export interface SourceMap {
version: number
x_google_ignoreList?: Array<number>
}

9 changes: 6 additions & 3 deletions napi/minify/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// prettier-ignore
/* eslint-disable */
// @ts-nocheck
/* auto-generated by NAPI-RS */

const { readFileSync } = require('fs')
const { createRequire } = require('node:module')
require = createRequire(__filename)

const { readFileSync } = require('node:fs')
let nativeBinding = null
const loadErrors = []

Expand Down Expand Up @@ -336,15 +339,15 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
nativeBinding = require('./minify.wasi.cjs')
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
console.error(err)
loadErrors.push(err)
}
}
if (!nativeBinding) {
try {
nativeBinding = require('@oxc-minify/binding-wasm32-wasi')
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
console.error(err)
loadErrors.push(err)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions napi/minify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@oxc-minify/binding",
"private": true,
"scripts": {
"build-dev": "napi build --platform",
"build": "napi build --platform --release",
"build-dev": "napi build --no-dts-cache --platform",
"build": "napi build --no-dts-cache --platform --release",
"test": "vitest --typecheck run ./test"
},
"napi": {
Expand Down
9 changes: 6 additions & 3 deletions napi/parser/bindings.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// prettier-ignore
/* eslint-disable */
// @ts-nocheck
/* auto-generated by NAPI-RS */

const { readFileSync } = require('fs')
const { createRequire } = require('node:module')
require = createRequire(__filename)

const { readFileSync } = require('node:fs')
let nativeBinding = null
const loadErrors = []

Expand Down Expand Up @@ -336,15 +339,15 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
nativeBinding = require('./parser.wasi.cjs')
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
console.error(err)
loadErrors.push(err)
}
}
if (!nativeBinding) {
try {
nativeBinding = require('@oxc-parser/binding-wasm32-wasi')
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
console.error(err)
loadErrors.push(err)
}
}
}
Expand Down
1 change: 0 additions & 1 deletion napi/parser/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,3 @@ export interface ValueSpan {
start: number
end: number
}

4 changes: 2 additions & 2 deletions napi/parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@oxc-parser/binding",
"private": true,
"scripts": {
"build-dev": "napi build --platform --js bindings.js",
"build": "napi build --platform --js bindings.js --release",
"build-dev": "napi build --no-dts-cache --platform --js bindings.js",
"build": "napi build --no-dts-cache --platform --js bindings.js --release",
"test": "vitest --typecheck run ./test"
},
"napi": {
Expand Down
1 change: 0 additions & 1 deletion napi/transform/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,4 +352,3 @@ export interface TypeScriptOptions {
*/
rewriteImportExtensions?: 'rewrite' | 'remove' | boolean
}

9 changes: 6 additions & 3 deletions napi/transform/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// prettier-ignore
/* eslint-disable */
// @ts-nocheck
/* auto-generated by NAPI-RS */

const { readFileSync } = require('fs')
const { createRequire } = require('node:module')
require = createRequire(__filename)

const { readFileSync } = require('node:fs')
let nativeBinding = null
const loadErrors = []

Expand Down Expand Up @@ -336,15 +339,15 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
nativeBinding = require('./transform.wasi.cjs')
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
console.error(err)
loadErrors.push(err)
}
}
if (!nativeBinding) {
try {
nativeBinding = require('@oxc-transform/binding-wasm32-wasi')
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
console.error(err)
loadErrors.push(err)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions napi/transform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@oxc-transform/binding",
"private": true,
"scripts": {
"build-dev": "napi build --platform",
"build": "napi build --platform --release",
"build-dev": "napi --no-dts-cache build --platform",
"build": "napi --no-dts-cache build --platform --release",
"test": "vitest --typecheck run ./test"
},
"napi": {
Expand Down
Loading

0 comments on commit aa9d7e4

Please sign in to comment.