@napi-rs/cli 3.0.0-alpha.92 → 3.0.0-alpha.94
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/dist/cli.js +8 -5
- package/dist/def/pre-publish.d.ts +9 -0
- package/dist/index.cjs +8 -5
- package/dist/index.js +8 -5
- package/package.json +2 -2
- package/src/api/pre-publish.ts +6 -4
- package/src/api/templates/load-wasi-template.ts +1 -1
- package/src/def/pre-publish.ts +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@napi-rs/cli",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.94",
|
|
4
4
|
"description": "Cli tools for napi-rs",
|
|
5
5
|
"author": "LongYinan <lynweklm@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/napi-rs/napi-rs",
|
|
@@ -132,5 +132,5 @@
|
|
|
132
132
|
"e2e/**/*.spec.ts"
|
|
133
133
|
]
|
|
134
134
|
},
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "08c364f5a76fa5f3b887b3050ffd175d33206a30"
|
|
136
136
|
}
|
package/src/api/pre-publish.ts
CHANGED
|
@@ -164,10 +164,12 @@ export async function prePublish(userOptions: PrePublishOptions) {
|
|
|
164
164
|
continue
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
if (!options.skipOptionalPublish) {
|
|
168
|
+
execSync(`${npmClient} publish`, {
|
|
169
|
+
cwd: pkgDir,
|
|
170
|
+
env: process.env,
|
|
171
|
+
})
|
|
172
|
+
}
|
|
171
173
|
|
|
172
174
|
if (options.ghRelease && repo && owner) {
|
|
173
175
|
debug.info(`Creating GitHub release ${pkgInfo.tag}`)
|
|
@@ -177,7 +177,7 @@ const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule
|
|
|
177
177
|
const kHandle = Object.getOwnPropertySymbols(worker).find(s =>
|
|
178
178
|
s.toString().includes("kHandle")
|
|
179
179
|
);
|
|
180
|
-
if (
|
|
180
|
+
if (kHandle) {
|
|
181
181
|
worker[kHandle].ref = () => {};
|
|
182
182
|
}
|
|
183
183
|
|
package/src/def/pre-publish.ts
CHANGED
|
@@ -43,6 +43,10 @@ export abstract class BasePrePublishCommand extends Command {
|
|
|
43
43
|
description: 'Existing GitHub release id',
|
|
44
44
|
})
|
|
45
45
|
|
|
46
|
+
skipOptionalPublish = Option.Boolean('--skip-optional-publish', false, {
|
|
47
|
+
description: 'Whether skip optionalDependencies packages publish',
|
|
48
|
+
})
|
|
49
|
+
|
|
46
50
|
dryRun = Option.Boolean('--dry-run', false, {
|
|
47
51
|
description: 'Dry run without touching file system',
|
|
48
52
|
})
|
|
@@ -57,6 +61,7 @@ export abstract class BasePrePublishCommand extends Command {
|
|
|
57
61
|
ghRelease: this.ghRelease,
|
|
58
62
|
ghReleaseName: this.ghReleaseName,
|
|
59
63
|
ghReleaseId: this.ghReleaseId,
|
|
64
|
+
skipOptionalPublish: this.skipOptionalPublish,
|
|
60
65
|
dryRun: this.dryRun,
|
|
61
66
|
}
|
|
62
67
|
}
|
|
@@ -108,6 +113,12 @@ export interface PrePublishOptions {
|
|
|
108
113
|
* Existing GitHub release id
|
|
109
114
|
*/
|
|
110
115
|
ghReleaseId?: string
|
|
116
|
+
/**
|
|
117
|
+
* Whether skip optionalDependencies packages publish
|
|
118
|
+
*
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
121
|
+
skipOptionalPublish?: boolean
|
|
111
122
|
/**
|
|
112
123
|
* Dry run without touching file system
|
|
113
124
|
*
|
|
@@ -123,6 +134,7 @@ export function applyDefaultPrePublishOptions(options: PrePublishOptions) {
|
|
|
123
134
|
npmDir: 'npm',
|
|
124
135
|
tagStyle: 'lerna',
|
|
125
136
|
ghRelease: true,
|
|
137
|
+
skipOptionalPublish: false,
|
|
126
138
|
dryRun: false,
|
|
127
139
|
...options,
|
|
128
140
|
}
|