nodejs-sea 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,10 +6,10 @@
6
6
  <p align="center">
7
7
  CLI for NodeJS single executable applications.
8
8
  <p align="center">
9
- <a href="https://www.npmjs.com/package/nestjs-auditlog" target="_blank"><img alt="npm version" src="https://img.shields.io/npm/v/nestjs-auditlog" /></a>
10
- <a href="https://www.npmjs.com/package/nestjs-auditlog" target="_blank"><img alt="NPM" src="https://img.shields.io/npm/l/nestjs-auditlog" /></a>
11
- <a href="https://www.npmjs.com/package/nestjs-auditlog" target="_blank"><img alt="npm downloads" src="https://img.shields.io/npm/dm/nestjs-auditlog" /></a>
12
- <a href="https://coveralls.io/github/thanhlcm90/nestjs-auditlog?branch=main" target="_blank"><img alt="coverage" src="https://coveralls.io/repos/github/thanhlcm90/nestjs-auditlog/badge.svg?branch=main" /></a>
9
+ <a href="https://www.npmjs.com/package/nodejs-sea" target="_blank"><img alt="npm version" src="https://img.shields.io/npm/v/nodejs-sea" /></a>
10
+ <a href="https://www.npmjs.com/package/nodejs-sea" target="_blank"><img alt="NPM" src="https://img.shields.io/npm/l/nodejs-sea" /></a>
11
+ <a href="https://www.npmjs.com/package/nodejs-sea" target="_blank"><img alt="npm downloads" src="https://img.shields.io/npm/dm/nodejs-sea" /></a>
12
+ <a href="https://coveralls.io/github/thanhlcm90/nodejs-sea?branch=main" target="_blank"><img alt="coverage" src="https://coveralls.io/repos/github/thanhlcm90/nodejs-sea/badge.svg?branch=main" /></a>
13
13
  </p>
14
14
  </p>
15
15
 
@@ -53,6 +53,23 @@ With yarn
53
53
  yarn add nodejs-sea
54
54
  ```
55
55
 
56
+ ## CLI usage
57
+
58
+ Run build script with `npx`
59
+
60
+ ```
61
+ npx nodejs-sea sea
62
+ ```
63
+
64
+ ```sh
65
+ Options:
66
+ --version Show version number [boolean]
67
+ -s, --sea-config Path of the sea config file [string] [default: "sea/config.json"]
68
+ -n, --node-version Node.js version [string] [default: "*"]
69
+ -c, --clean Remove generated files [boolean] [default: true]
70
+ --help Show help [boolean]
71
+ ```
72
+
56
73
  ## Example
57
74
 
58
75
  To build the single executable applications from source, please create the folder `sea`, and put the `config.json` file
@@ -60,19 +77,36 @@ To build the single executable applications from source, please create the folde
60
77
  ```json
61
78
  {
62
79
  "main": "sea/dist/server-out.js",
63
- "output": "sea/dist/viactapp.blob",
64
- "copyFiles": [],
65
- "esbuild": {}
80
+ "output": "sea/dist/viactapp.blob"
66
81
  }
67
82
  ```
68
83
 
69
- Run build script with `npx`
84
+ If you want copy some files from your source to your build output, put them into `copyFiles`
70
85
 
71
- ```
72
- npx nodejs-sea sea
86
+ ```json
87
+ {
88
+ "main": "sea/dist/server-out.js",
89
+ "output": "sea/dist/viactapp.blob",
90
+ "copyFiles": ["src/config.json", ".env"]
91
+ }
73
92
  ```
74
93
 
75
- ## CLI usage
94
+ If you want run <a href="https://esbuild.github.io/">esbuild</a> before, put esbuild config into `esbuild`
95
+
96
+ ```json
97
+ {
98
+ "main": "sea/dist/server-out.js",
99
+ "output": "sea/dist/app.blob",
100
+ "esbuild": {
101
+ "entryPoints": ["main.js"],
102
+ "bundle": true,
103
+ "outfile": "sea/dist/server-out.js",
104
+ "platform": "node",
105
+ "external": ["@aws-sdk/client-s3", "hbs"],
106
+ "packages": "bundle"
107
+ }
108
+ }
109
+ ```
76
110
 
77
111
  ## Contact and Feedback
78
112
 
package/lib/cli.js CHANGED
@@ -213,10 +213,10 @@ class PackCommand extends clipanion.Command {
213
213
  description: `Path of the sea config file. Default is sea/config.json`,
214
214
  });
215
215
  this.nodeVersion = clipanion.Option.String(`-n,--node-version`, {
216
- description: `Node.js version or semver version range. Default is 22.11.0`,
216
+ description: `Node.js version. Default is 22.11.0`,
217
217
  });
218
218
  this.clean = clipanion.Option.String(`-c,--clean`, {
219
- description: `Node.js version or semver version range. Default is true`,
219
+ description: `Remove generated files. Default is true`,
220
220
  });
221
221
  }
222
222
  /**
package/lib/cli.mjs CHANGED
@@ -200,10 +200,10 @@ class PackCommand extends Command {
200
200
  description: `Path of the sea config file. Default is sea/config.json`,
201
201
  });
202
202
  this.nodeVersion = Option.String(`-n,--node-version`, {
203
- description: `Node.js version or semver version range. Default is 22.11.0`,
203
+ description: `Node.js version. Default is 22.11.0`,
204
204
  });
205
205
  this.clean = Option.String(`-c,--clean`, {
206
- description: `Node.js version or semver version range. Default is true`,
206
+ description: `Remove generated files. Default is true`,
207
207
  });
208
208
  }
209
209
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodejs-sea",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A powerful package for NodeJS single executable applications (SEA), support good for NestJS framework",
5
5
  "main": "lib/index.js",
6
6
  "license": "MIT",
@@ -19,7 +19,7 @@
19
19
  "prepare": "husky",
20
20
  "prepack": "rm -rf lib && rollup -c",
21
21
  "test": "sea -s test/sea/config.json",
22
- "version": "standard-version",
22
+ "standard-version": "standard-version",
23
23
  "build": "rollup -c"
24
24
  },
25
25
  "engines": {
@@ -48,6 +48,7 @@
48
48
  "rollup-plugin-multi-input": "^1.3.1",
49
49
  "rollup-plugin-preserve-shebang": "^1.0.1",
50
50
  "rollup-plugin-terser": "^7.0.2",
51
+ "standard-version": "^9.5.0",
51
52
  "terser": "^5.15.0",
52
53
  "ts-node": "^10.9.1",
53
54
  "typescript": "^4.8.2"