Skip to content

Commit

Permalink
Fix standalone pack script
Browse files Browse the repository at this point in the history
  • Loading branch information
yhatt committed Oct 31, 2024
1 parent a438d1e commit 3f230e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"prepack": "npm-run-all --parallel check:* lint:* test:coverage --parallel build types",
"preversion": "run-p check:* lint:* test:coverage",
"standalone": "node -e \"fs.rmSync('bin',{recursive:true,force:true})\" && pkg -C gzip --out-path ./bin .",
"standalone:pack": "node ./scripts/pack.js",
"standalone:pack": "node ./scripts/pack.mjs",
"test": "jest",
"test:coverage": "jest --coverage",
"types": "node -e \"fs.rmSync('types',{recursive:true,force:true})\" && tsc --declaration --emitDeclarationOnly --outDir types",
Expand Down
15 changes: 10 additions & 5 deletions scripts/pack.js → scripts/pack.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
/* Pack built standalone binaries for release. */

const fs = require('node:fs')
const path = require('node:path')
const zlib = require('node:zlib')
const tar = require('tar-stream')
const ZipStream = require('zip-stream')
import fs from 'node:fs'
import { createRequire } from 'node:module'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import zlib from 'node:zlib'
import tar from 'tar-stream'
import ZipStream from 'zip-stream'

const __dirname = path.dirname(fileURLToPath(import.meta.url))
const require = createRequire(import.meta.url)
const { version } = require('../package.json')

const bin = path.resolve(__dirname, '../bin')
Expand Down

0 comments on commit 3f230e2

Please sign in to comment.