Skip to content

Commit

Permalink
Merge pull request #616 from marp-team/fix-standalone-build
Browse files Browse the repository at this point in the history
Fix packaging script for standalone binaries
  • Loading branch information
yhatt authored Oct 31, 2024
2 parents a438d1e + fbfc94b commit baa43a3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Fixed

- Fix packaging script for standalone binaries ([#616](https://github.com/marp-team/marp-cli/pull/616))

## v4.0.1 - 2024-10-31

### Removed
Expand Down
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 baa43a3

Please sign in to comment.