@bushizhanghan/dsh-publish-gate 0.1.5 → 0.1.6
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 +1 -1
- package/lib/engine.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/engine.js
CHANGED
|
@@ -519,7 +519,10 @@ export function checkEntrySource(dir) {
|
|
|
519
519
|
if (!/export\s+(?:const|function)\s+apply/.test(text)) out.push(F('no-apply-export', 'error', 'lib/index.js does not export `apply`', 'cordis calls apply(ctx, config); without it nothing happens.', 'Add `export function apply(ctx, config) {}`.'))
|
|
520
520
|
if (!/export\s+const\s+inject/.test(text)) out.push(F('no-inject', 'warn', 'lib/index.js does not export `inject`', 'Without an inject list the service is resolved late and `ctx.tools` may be undefined when apply runs.', 'Add `export const inject = [\'tools\']`.'))
|
|
521
521
|
// require() in ESM blows up at load
|
|
522
|
-
|
|
522
|
+
// Any call form, including destructuring and a member access: `const {a} = require(…)`,
|
|
523
|
+
// `x = require(…)`, `require('node:fs').readFileSync`. A bare `require(` inside a
|
|
524
|
+
// string is not matched because the regex requires a call with a quote argument.
|
|
525
|
+
if (/\brequire\s*\(\s*['"`]/.test(text)) {
|
|
523
526
|
out.push(
|
|
524
527
|
F(
|
|
525
528
|
'require-in-esm',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bushizhanghan/dsh-publish-gate",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Helps DSH plugin AUTHORS publish their plugins: a one-command gate that turns every silent failure in the publish path into a deterministic check — package.json completeness, BOM, YAML/JSON parseability, junction and patch insert correctness, npm scope permissions, GitHub repo and token state, market entry format, LICENSE/README, test suite. 帮助插件作者一键发布:写完插件后跑一遍门禁,把发布链路上的每个静默坑变成确定性检查,然后 GitHub + npm + 市场一键三连。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|