@unbrained/pm-cli 2026.12.1 → 2026.12.3
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/.claude-plugin/marketplace.json +1 -1
- package/dist/cli/commander-usage.js +4 -4
- package/dist/cli/expected-revisions.js +1 -1
- package/dist/cli/extension-command-help.js +4 -4
- package/dist/cli/main.js +5 -5
- package/dist/cli/runtime/invocation-rewrites.js +1 -1
- package/dist/cli/runtime-field-commands.js +2 -0
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/chunk-3ESBFEQC.js +2 -0
- package/dist/cli-bundle/chunks/chunk-46AZP5QW.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-OBPO6V7H.js → chunk-5WTBF4M4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3KEMIPKG.js → chunk-6TOZQ5BQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4YYFY33T.js → chunk-AHVOEE7F.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-CQHB3ZZH.js +2 -0
- package/dist/cli-bundle/chunks/chunk-DZPOS3YT.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-OKEJ4U2I.js → chunk-E5ADC3HT.js} +65 -65
- package/dist/cli-bundle/chunks/{chunk-SY5C3U32.js → chunk-E5HO7HWP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3HKPVOAN.js → chunk-EDJ3KR2H.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XME6GIFQ.js → chunk-FWQNWPIV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CWPR234D.js → chunk-H4U3LEOD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MZZ4ZJ5Z.js → chunk-HNMED75Y.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-U7RBJGLF.js → chunk-HPCMM74Q.js} +22 -22
- package/dist/cli-bundle/chunks/{chunk-WSEIEDEK.js → chunk-ITM4AMVM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q6K7HWZ7.js → chunk-IW4A3I4N.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4YQMQOUO.js → chunk-JJ73G5UT.js} +52 -52
- package/dist/cli-bundle/chunks/chunk-L4HMFRHB.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-YSVOXCYH.js → chunk-LTQWPQ7H.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q6GLSAJY.js → chunk-MRT3ADO4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZL6J6JYT.js → chunk-PBMLIV74.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NA6D75V5.js → chunk-PJMGWJKU.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-Q2HMDV56.js +9 -0
- package/dist/cli-bundle/chunks/{chunk-OXC5KBIQ.js → chunk-RRBNCL63.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CBUC4X7Q.js → chunk-TDOF7BKO.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-UXEZXGAD.js +113 -0
- package/dist/cli-bundle/chunks/{chunk-PCDTWL6V.js → chunk-W7HA65EO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-I4SPJQQI.js → chunk-XGNUDSCG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-AHV3CSQG.js → chunk-XKJ5NWQ7.js} +2 -2
- package/dist/cli-bundle/chunks/{field-option-collisions-BBGTV7AD.js → field-option-collisions-DXKTKW6J.js} +2 -2
- package/dist/cli-bundle/chunks/item-revision-DXEF4XBU.js +2 -0
- package/dist/cli-bundle/chunks/item-transaction-EANA7V4W.js +2 -0
- package/dist/cli-bundle/chunks/{linked-resource-value-list-E2DX52LY.js → linked-resource-value-list-5JRGUDUB.js} +2 -2
- package/dist/cli-bundle/chunks/{mutation-actor-NHN33ITJ.js → mutation-actor-S5G7FMNG.js} +2 -2
- package/dist/cli-bundle/chunks/{mutation-admission-PGKJTCG6.js → mutation-admission-HQVNPOXV.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-7S5QWDTI.js → register-list-query-SQF5PSJ4.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-2F6JUBST.js → register-mutation-4AQ4CEBL.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-ET3UKPYK.js → register-operations-76P7OM4P.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-I63QTFCU.js → register-setup-T6OEOZK3.js} +2 -2
- package/dist/cli-bundle/chunks/{stage-4ZCF74G4.js → stage-KUICZHSF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-4SCFAWAW.js → chunk-3LHBKFPD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-4DDXERKN.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-JPZGC3W4.js → chunk-4YU75CWI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-TXTPAFHJ.js → chunk-5JQVPQMN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-KNBGHCIP.js → chunk-5Z4DXYBZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-7DOP5HEZ.js +44 -0
- package/dist/cli-bundle/focused-chunks/{chunk-TR22GU7M.js → chunk-AX4RBJ7B.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-7A6SEZEY.js → chunk-BEHQCHQV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-BUIF6CMZ.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-E2IWEJL5.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-GBU7GKNJ.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-EQCQTYKO.js → chunk-K35KTBDZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-VQIC3UZB.js → chunk-KNST4PGF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-P2H3GTJK.js → chunk-L2XJB5PK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-L6NOGC4N.js +100 -0
- package/dist/cli-bundle/focused-chunks/{chunk-VK3IE3TS.js → chunk-LWIIDPAV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-6IY5CVGJ.js → chunk-M54BMYG4.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-6BKT6XQN.js → chunk-NEK7RX3N.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BHNBPCHP.js → chunk-OKGWIW6C.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-2DGKVXFT.js → chunk-RFDSSOTZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-SSX5YBDC.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-OG57ESZK.js → chunk-TIEQVIFN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-SQ72CVUH.js → chunk-VEUBDQDP.js} +54 -54
- package/dist/cli-bundle/focused-chunks/{chunk-2UWKU2BQ.js → chunk-WDHNPNHX.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{field-option-collisions-2C6DLUC4.js → field-option-collisions-32X7FP3H.js} +2 -2
- package/dist/cli-bundle/focused-chunks/item-revision-GUYSVVQD.js +2 -0
- package/dist/cli-bundle/focused-chunks/{item-transaction-2K4SFLJ7.js → item-transaction-MLKHZPL7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{mutation-actor-DJMZUIZI.js → mutation-actor-RDZJTRW2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{mutation-admission-SDWQVVHN.js → mutation-admission-IQB6XL75.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{stage-QBZIK3T5.js → stage-AA7LORZ2.js} +2 -2
- package/dist/cli-bundle/main.js +27 -27
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +1 -1
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +63 -63
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +9 -9
- package/dist/core/extensions/loader.d.ts +8 -0
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/item/actionability.js +1 -1
- package/dist/core/output/output.js +16 -16
- package/dist/mcp/server.js +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +25 -1
- package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1
- package/dist/sdk/context-intent-contracts.js +1 -1
- package/dist/sdk/extension/install-sources.d.ts +2 -2
- package/dist/sdk/extension/install-sources.js +5 -5
- package/dist/sdk/lifecycle/expect-hash-admission.d.ts +27 -8
- package/dist/sdk/lifecycle/expect-hash-admission.js +1 -1
- package/dist/sdk/lifecycle/item-revision.d.ts +12 -4
- package/dist/sdk/lifecycle/item-revision.js +1 -1
- package/dist/sdk/output-projection.d.ts +1 -1
- package/dist/sdk/output-projection.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/read-output/surfaces.js +1 -1
- package/dist/sdk/runtime/schema.js +1 -1
- package/dist/sdk/runtime-input.d.ts +6 -0
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime-primitives.d.ts +1 -1
- package/dist/sdk/runtime-primitives.js +1 -1
- package/dist/sdk/runtime.js +1 -1
- package/docs/COMMANDS.md +23 -5
- package/docs/EXTENSIONS.md +1 -1
- package/docs/SDK.md +15 -2
- package/marketplace.json +1 -1
- package/node_modules/tar/README.md +1792 -1147
- package/node_modules/tar/dist/commonjs/bytes.d.ts +21 -0
- package/node_modules/tar/dist/commonjs/bytes.js +83 -0
- package/node_modules/tar/dist/commonjs/codec.d.ts +53 -0
- package/node_modules/tar/dist/commonjs/codec.js +35 -0
- package/node_modules/tar/dist/commonjs/concat.d.ts +3 -0
- package/node_modules/tar/dist/commonjs/concat.js +20 -0
- package/node_modules/tar/dist/commonjs/create.d.ts +39 -2
- package/node_modules/tar/dist/commonjs/create.js +150 -64
- package/node_modules/tar/dist/commonjs/dealias.d.ts +79 -0
- package/node_modules/tar/dist/commonjs/dealias.js +50 -0
- package/node_modules/tar/dist/commonjs/delete.d.ts +19 -0
- package/node_modules/tar/dist/commonjs/delete.js +121 -0
- package/node_modules/tar/dist/commonjs/entries.d.ts +82 -0
- package/node_modules/tar/dist/commonjs/entries.js +398 -0
- package/node_modules/tar/dist/commonjs/extract.d.ts +14 -2
- package/node_modules/tar/dist/commonjs/extract.js +40 -81
- package/node_modules/tar/dist/commonjs/fs.d.ts +201 -0
- package/node_modules/tar/dist/commonjs/fs.js +5 -0
- package/node_modules/tar/dist/commonjs/header.d.ts +4 -4
- package/node_modules/tar/dist/commonjs/header.js +71 -53
- package/node_modules/tar/dist/commonjs/index.d.ts +25 -18
- package/node_modules/tar/dist/commonjs/index.js +46 -18
- package/node_modules/tar/dist/commonjs/index.min.js +2 -3
- package/node_modules/tar/dist/commonjs/large-numbers.d.ts +2 -2
- package/node_modules/tar/dist/commonjs/large-numbers.js +4 -4
- package/node_modules/tar/dist/commonjs/list.d.ts +23 -6
- package/node_modules/tar/dist/commonjs/list.js +99 -138
- package/node_modules/tar/dist/commonjs/mkdir.d.ts +16 -11
- package/node_modules/tar/dist/commonjs/mkdir.js +121 -159
- package/node_modules/tar/dist/commonjs/normalize-unicode.js +9 -0
- package/node_modules/tar/dist/commonjs/options.d.ts +284 -513
- package/node_modules/tar/dist/commonjs/options.js +20 -61
- package/node_modules/tar/dist/commonjs/pack.d.ts +150 -96
- package/node_modules/tar/dist/commonjs/pack.js +752 -445
- package/node_modules/tar/dist/commonjs/parser.d.ts +98 -0
- package/node_modules/tar/dist/commonjs/parser.js +452 -0
- package/node_modules/tar/dist/commonjs/path-reservations.d.ts +17 -7
- package/node_modules/tar/dist/commonjs/path-reservations.js +110 -140
- package/node_modules/tar/dist/commonjs/path.d.ts +19 -0
- package/node_modules/tar/dist/commonjs/path.js +90 -0
- package/node_modules/tar/dist/commonjs/pax.d.ts +3 -1
- package/node_modules/tar/dist/commonjs/pax.js +67 -36
- package/node_modules/tar/dist/commonjs/read-entry.d.ts +97 -11
- package/node_modules/tar/dist/commonjs/read-entry.js +251 -97
- package/node_modules/tar/dist/commonjs/read-file.d.ts +22 -0
- package/node_modules/tar/dist/commonjs/read-file.js +104 -0
- package/node_modules/tar/dist/commonjs/replace.d.ts +45 -1
- package/node_modules/tar/dist/commonjs/replace.js +164 -211
- package/node_modules/tar/dist/commonjs/server/codecs.d.ts +38 -0
- package/node_modules/tar/dist/commonjs/server/codecs.js +252 -0
- package/node_modules/tar/dist/commonjs/server/index.d.ts +115 -0
- package/node_modules/tar/dist/commonjs/server/index.js +166 -0
- package/node_modules/tar/dist/commonjs/server/index.min.js +3 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +8 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.js +17 -20
- package/node_modules/tar/dist/commonjs/to-stream.d.ts +7 -0
- package/node_modules/tar/dist/commonjs/to-stream.js +22 -0
- package/node_modules/tar/dist/commonjs/types.d.ts +4 -3
- package/node_modules/tar/dist/commonjs/types.js +4 -3
- package/node_modules/tar/dist/commonjs/unpack.d.ts +143 -89
- package/node_modules/tar/dist/commonjs/unpack.js +780 -725
- package/node_modules/tar/dist/commonjs/update.d.ts +11 -1
- package/node_modules/tar/dist/commonjs/update.js +37 -28
- package/node_modules/tar/dist/commonjs/warn.d.ts +27 -0
- package/node_modules/tar/dist/commonjs/warn.js +36 -0
- package/node_modules/tar/dist/commonjs/win32-path.d.ts +16 -0
- package/node_modules/tar/dist/commonjs/win32-path.js +67 -0
- package/node_modules/tar/dist/commonjs/write-entry.d.ts +64 -111
- package/node_modules/tar/dist/commonjs/write-entry.js +108 -672
- package/node_modules/tar/dist/commonjs/write-flag.d.ts +18 -0
- package/node_modules/tar/dist/commonjs/write-flag.js +29 -0
- package/node_modules/tar/dist/esm/bytes.d.ts +21 -0
- package/node_modules/tar/dist/esm/bytes.js +72 -0
- package/node_modules/tar/dist/esm/codec.d.ts +53 -0
- package/node_modules/tar/dist/esm/codec.js +32 -0
- package/node_modules/tar/dist/esm/concat.d.ts +3 -0
- package/node_modules/tar/dist/esm/concat.js +16 -0
- package/node_modules/tar/dist/esm/create.d.ts +39 -2
- package/node_modules/tar/dist/esm/create.js +144 -61
- package/node_modules/tar/dist/esm/dealias.d.ts +79 -0
- package/node_modules/tar/dist/esm/dealias.js +46 -0
- package/node_modules/tar/dist/esm/delete.d.ts +19 -0
- package/node_modules/tar/dist/esm/delete.js +117 -0
- package/node_modules/tar/dist/esm/entries.d.ts +82 -0
- package/node_modules/tar/dist/esm/entries.js +388 -0
- package/node_modules/tar/dist/esm/extract.d.ts +14 -2
- package/node_modules/tar/dist/esm/extract.js +37 -44
- package/node_modules/tar/dist/esm/fs.d.ts +201 -0
- package/node_modules/tar/dist/esm/fs.js +4 -0
- package/node_modules/tar/dist/esm/header.d.ts +4 -4
- package/node_modules/tar/dist/esm/header.js +71 -53
- package/node_modules/tar/dist/esm/index.d.ts +25 -18
- package/node_modules/tar/dist/esm/index.js +23 -18
- package/node_modules/tar/dist/esm/index.min.js +2 -3
- package/node_modules/tar/dist/esm/large-numbers.d.ts +2 -2
- package/node_modules/tar/dist/esm/large-numbers.js +4 -4
- package/node_modules/tar/dist/esm/list.d.ts +23 -6
- package/node_modules/tar/dist/esm/list.js +96 -101
- package/node_modules/tar/dist/esm/mkdir.d.ts +16 -11
- package/node_modules/tar/dist/esm/mkdir.js +119 -154
- package/node_modules/tar/dist/esm/normalize-unicode.js +9 -0
- package/node_modules/tar/dist/esm/options.d.ts +284 -513
- package/node_modules/tar/dist/esm/options.js +17 -51
- package/node_modules/tar/dist/esm/pack.d.ts +150 -96
- package/node_modules/tar/dist/esm/pack.js +750 -441
- package/node_modules/tar/dist/esm/parser.d.ts +98 -0
- package/node_modules/tar/dist/esm/parser.js +448 -0
- package/node_modules/tar/dist/esm/path-reservations.d.ts +17 -7
- package/node_modules/tar/dist/esm/path-reservations.js +110 -140
- package/node_modules/tar/dist/esm/path.d.ts +19 -0
- package/node_modules/tar/dist/esm/path.js +80 -0
- package/node_modules/tar/dist/esm/pax.d.ts +3 -1
- package/node_modules/tar/dist/esm/pax.js +66 -35
- package/node_modules/tar/dist/esm/read-entry.d.ts +97 -11
- package/node_modules/tar/dist/esm/read-entry.js +248 -96
- package/node_modules/tar/dist/esm/read-file.d.ts +22 -0
- package/node_modules/tar/dist/esm/read-file.js +99 -0
- package/node_modules/tar/dist/esm/replace.d.ts +45 -1
- package/node_modules/tar/dist/esm/replace.js +160 -207
- package/node_modules/tar/dist/esm/server/codecs.d.ts +38 -0
- package/node_modules/tar/dist/esm/server/codecs.js +214 -0
- package/node_modules/tar/dist/esm/server/index.d.ts +115 -0
- package/node_modules/tar/dist/esm/server/index.js +102 -0
- package/node_modules/tar/dist/esm/server/index.min.js +3 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.d.ts +8 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.js +17 -20
- package/node_modules/tar/dist/esm/to-stream.d.ts +7 -0
- package/node_modules/tar/dist/esm/to-stream.js +18 -0
- package/node_modules/tar/dist/esm/types.d.ts +4 -3
- package/node_modules/tar/dist/esm/types.js +4 -3
- package/node_modules/tar/dist/esm/unpack.d.ts +143 -89
- package/node_modules/tar/dist/esm/unpack.js +776 -719
- package/node_modules/tar/dist/esm/update.d.ts +11 -1
- package/node_modules/tar/dist/esm/update.js +35 -28
- package/node_modules/tar/dist/esm/warn.d.ts +27 -0
- package/node_modules/tar/dist/esm/warn.js +31 -0
- package/node_modules/tar/dist/esm/win32-path.d.ts +16 -0
- package/node_modules/tar/dist/esm/win32-path.js +60 -0
- package/node_modules/tar/dist/esm/write-entry.d.ts +64 -111
- package/node_modules/tar/dist/esm/write-entry.js +107 -633
- package/node_modules/tar/dist/esm/write-flag.d.ts +18 -0
- package/node_modules/tar/dist/esm/write-flag.js +25 -0
- package/node_modules/tar/package.json +68 -224
- package/package.json +2 -2
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/dist/cli-bundle/chunks/chunk-A5ZEMOVR.js +0 -2
- package/dist/cli-bundle/chunks/chunk-AJLU6KLW.js +0 -2
- package/dist/cli-bundle/chunks/chunk-C6WM6ZN4.js +0 -9
- package/dist/cli-bundle/chunks/chunk-HZZLSBIJ.js +0 -2
- package/dist/cli-bundle/chunks/chunk-L2ZSSMYY.js +0 -2
- package/dist/cli-bundle/chunks/chunk-NRQCBUYD.js +0 -113
- package/dist/cli-bundle/chunks/chunk-QDV7S2QS.js +0 -2
- package/dist/cli-bundle/chunks/item-revision-3LENTXYF.js +0 -2
- package/dist/cli-bundle/chunks/item-transaction-66RDV7PH.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-HTDYNY4L.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-N64AC5G6.js +0 -100
- package/dist/cli-bundle/focused-chunks/chunk-PT7RT3T6.js +0 -44
- package/dist/cli-bundle/focused-chunks/chunk-QZRYGYTI.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-SQMOF65W.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-T3ILWAEV.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-W4JMV7GF.js +0 -3
- package/dist/cli-bundle/focused-chunks/item-revision-723XCQPS.js +0 -2
- package/node_modules/@isaacs/fs-minipass/LICENSE +0 -15
- package/node_modules/@isaacs/fs-minipass/README.md +0 -71
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts +0 -118
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +0 -430
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +0 -3
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts +0 -118
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.js +0 -420
- package/node_modules/@isaacs/fs-minipass/dist/esm/package.json +0 -3
- package/node_modules/@isaacs/fs-minipass/package.json +0 -72
- package/node_modules/chownr/LICENSE.md +0 -63
- package/node_modules/chownr/README.md +0 -3
- package/node_modules/chownr/dist/commonjs/index.d.ts +0 -3
- package/node_modules/chownr/dist/commonjs/index.js +0 -93
- package/node_modules/chownr/dist/commonjs/package.json +0 -3
- package/node_modules/chownr/dist/esm/index.d.ts +0 -3
- package/node_modules/chownr/dist/esm/index.js +0 -85
- package/node_modules/chownr/dist/esm/package.json +0 -3
- package/node_modules/chownr/package.json +0 -69
- package/node_modules/minipass/LICENSE.md +0 -55
- package/node_modules/minipass/README.md +0 -825
- package/node_modules/minipass/dist/commonjs/index.d.ts +0 -545
- package/node_modules/minipass/dist/commonjs/index.js +0 -1038
- package/node_modules/minipass/dist/commonjs/package.json +0 -3
- package/node_modules/minipass/dist/esm/index.d.ts +0 -545
- package/node_modules/minipass/dist/esm/index.js +0 -1020
- package/node_modules/minipass/dist/esm/package.json +0 -3
- package/node_modules/minipass/package.json +0 -77
- package/node_modules/minizlib/LICENSE +0 -26
- package/node_modules/minizlib/README.md +0 -64
- package/node_modules/minizlib/dist/commonjs/constants.d.ts +0 -2
- package/node_modules/minizlib/dist/commonjs/constants.js +0 -123
- package/node_modules/minizlib/dist/commonjs/index.d.ts +0 -99
- package/node_modules/minizlib/dist/commonjs/index.js +0 -416
- package/node_modules/minizlib/dist/commonjs/package.json +0 -3
- package/node_modules/minizlib/dist/esm/constants.d.ts +0 -2
- package/node_modules/minizlib/dist/esm/constants.js +0 -117
- package/node_modules/minizlib/dist/esm/index.d.ts +0 -99
- package/node_modules/minizlib/dist/esm/index.js +0 -363
- package/node_modules/minizlib/dist/esm/package.json +0 -3
- package/node_modules/minizlib/package.json +0 -80
- package/node_modules/tar/dist/commonjs/get-write-flag.d.ts +0 -2
- package/node_modules/tar/dist/commonjs/get-write-flag.js +0 -32
- package/node_modules/tar/dist/commonjs/make-command.d.ts +0 -49
- package/node_modules/tar/dist/commonjs/make-command.js +0 -52
- package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +0 -2
- package/node_modules/tar/dist/commonjs/normalize-windows-path.js +0 -12
- package/node_modules/tar/dist/commonjs/parse.d.ts +0 -92
- package/node_modules/tar/dist/commonjs/parse.js +0 -655
- package/node_modules/tar/dist/commonjs/process-umask.d.ts +0 -2
- package/node_modules/tar/dist/commonjs/process-umask.js +0 -7
- package/node_modules/tar/dist/commonjs/warn-method.d.ts +0 -24
- package/node_modules/tar/dist/commonjs/warn-method.js +0 -31
- package/node_modules/tar/dist/esm/get-write-flag.d.ts +0 -2
- package/node_modules/tar/dist/esm/get-write-flag.js +0 -26
- package/node_modules/tar/dist/esm/make-command.d.ts +0 -49
- package/node_modules/tar/dist/esm/make-command.js +0 -48
- package/node_modules/tar/dist/esm/normalize-windows-path.d.ts +0 -2
- package/node_modules/tar/dist/esm/normalize-windows-path.js +0 -9
- package/node_modules/tar/dist/esm/parse.d.ts +0 -92
- package/node_modules/tar/dist/esm/parse.js +0 -651
- package/node_modules/tar/dist/esm/process-umask.d.ts +0 -2
- package/node_modules/tar/dist/esm/process-umask.js +0 -3
- package/node_modules/tar/dist/esm/warn-method.d.ts +0 -24
- package/node_modules/tar/dist/esm/warn-method.js +0 -27
- package/node_modules/yallist/LICENSE.md +0 -63
- package/node_modules/yallist/README.md +0 -205
- package/node_modules/yallist/dist/commonjs/index.d.ts +0 -39
- package/node_modules/yallist/dist/commonjs/index.js +0 -384
- package/node_modules/yallist/dist/commonjs/package.json +0 -3
- package/node_modules/yallist/dist/esm/index.d.ts +0 -39
- package/node_modules/yallist/dist/esm/index.js +0 -379
- package/node_modules/yallist/dist/esm/package.json +0 -3
- package/node_modules/yallist/package.json +0 -68
|
@@ -1,113 +1,108 @@
|
|
|
1
|
-
// tar -t
|
|
2
|
-
import * as fsm from '@isaacs/fs-minipass';
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import { dirname, parse } from 'path';
|
|
5
|
-
import { makeCommand } from './make-command.js';
|
|
6
|
-
import { Parser } from './parse.js';
|
|
7
1
|
import { stripTrailingSlashes } from './strip-trailing-slashes.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
2
|
+
import { dealias } from './dealias.js';
|
|
3
|
+
import { TarReader, TarReaderSync } from './entries.js';
|
|
4
|
+
import { readFile, readFileSync } from './read-file.js';
|
|
5
|
+
import { warn } from './warn.js';
|
|
6
|
+
/**
|
|
7
|
+
* Make a filter that passes the entries that `files` lists. An entry
|
|
8
|
+
* passes if `filter` accepts it, and it is in the list or one of its
|
|
9
|
+
* parent directories is. Trailing slashes are ignored.
|
|
10
|
+
*
|
|
11
|
+
* The second item of the result reports each listed path that no
|
|
12
|
+
* entry of the archive matched, as a `TAR_ENTRY_ERROR` warning. An
|
|
13
|
+
* entry that `filter` refuses also matches. Call it when the archive
|
|
14
|
+
* ends.
|
|
15
|
+
*/
|
|
16
|
+
export const filesFilter = (files, filter) => {
|
|
17
|
+
const set = new Set(files.map(f => stripTrailingSlashes(f)));
|
|
18
|
+
// The listed paths that no entry matched yet.
|
|
19
|
+
const missing = new Set(set);
|
|
20
|
+
let max = 0;
|
|
21
|
+
for (const f of set)
|
|
22
|
+
max = Math.max(max, f.length);
|
|
23
|
+
const listed = (path) => {
|
|
24
|
+
const p = stripTrailingSlashes(path);
|
|
25
|
+
const root = p.charAt(0) === '/' ? '/' : '.';
|
|
26
|
+
let found = false;
|
|
27
|
+
// Look at the path, and then at each parent directory. One that
|
|
28
|
+
// is longer than each listed path is not looked up, so the work
|
|
29
|
+
// for a very long path stays small.
|
|
30
|
+
for (let end = p.length; end > 0; end = p.lastIndexOf('/', end - 1)) {
|
|
31
|
+
if (end > max)
|
|
32
|
+
continue;
|
|
33
|
+
const dir = p.slice(0, end);
|
|
34
|
+
if (dir === root || !set.has(dir))
|
|
35
|
+
continue;
|
|
36
|
+
found = true;
|
|
37
|
+
missing.delete(dir);
|
|
38
|
+
// A parent directory can also be in the list.
|
|
39
|
+
if (!missing.size)
|
|
40
|
+
break;
|
|
39
41
|
}
|
|
40
|
-
|
|
41
|
-
return ret;
|
|
42
|
+
return found;
|
|
42
43
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
return [
|
|
45
|
+
(path, entry) => {
|
|
46
|
+
// The filter of the caller gets each entry.
|
|
47
|
+
const ok = !filter || filter(path, entry);
|
|
48
|
+
return listed(path) && ok;
|
|
49
|
+
},
|
|
50
|
+
opt => {
|
|
51
|
+
for (const path of missing) {
|
|
52
|
+
warn(opt, 'TAR_ENTRY_ERROR', `${path}: not found in archive`, {
|
|
53
|
+
path,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
];
|
|
47
58
|
};
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
59
|
+
const noInput = () => new TypeError('list needs input, or file and fs');
|
|
60
|
+
/**
|
|
61
|
+
* Call `opt.onEntry` with each entry of an archive. If `files` is
|
|
62
|
+
* set, only with the entries that it lists, and the entries in the
|
|
63
|
+
* directories that it lists. A listed path that no entry matches is
|
|
64
|
+
* a warning when the archive ends.
|
|
65
|
+
*/
|
|
66
|
+
export const list = async (options, files) => {
|
|
67
|
+
const opt = dealias(options);
|
|
68
|
+
const { input, file, fs, onEntry } = opt;
|
|
69
|
+
const source = input ?? (file && fs ? readFile(fs, file, opt.maxReadSize) : undefined);
|
|
70
|
+
if (!source)
|
|
71
|
+
throw noInput();
|
|
72
|
+
const [filter, report] = files?.length ? filesFilter(files, opt.filter) : [];
|
|
73
|
+
if (filter)
|
|
74
|
+
opt.filter = filter;
|
|
75
|
+
const reader = new TarReader(source, opt);
|
|
52
76
|
try {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
else {
|
|
62
|
-
let pos = 0;
|
|
63
|
-
const buf = Buffer.allocUnsafe(readSize);
|
|
64
|
-
while (pos < stat.size) {
|
|
65
|
-
const bytesRead = fs.readSync(fd, buf, 0, readSize, pos);
|
|
66
|
-
if (bytesRead === 0)
|
|
67
|
-
break;
|
|
68
|
-
pos += bytesRead;
|
|
69
|
-
p.write(buf.subarray(0, bytesRead));
|
|
70
|
-
}
|
|
71
|
-
p.end();
|
|
77
|
+
for (;;) {
|
|
78
|
+
const entry = reader.poll();
|
|
79
|
+
if (entry === null)
|
|
80
|
+
break;
|
|
81
|
+
if (entry === undefined)
|
|
82
|
+
await reader.fill();
|
|
83
|
+
else if (onEntry)
|
|
84
|
+
await onEntry(entry);
|
|
72
85
|
}
|
|
73
86
|
}
|
|
74
87
|
finally {
|
|
75
|
-
|
|
76
|
-
try {
|
|
77
|
-
fs.closeSync(fd);
|
|
78
|
-
/* c8 ignore next */
|
|
79
|
-
}
|
|
80
|
-
catch { }
|
|
81
|
-
}
|
|
88
|
+
await reader.return();
|
|
82
89
|
}
|
|
90
|
+
report?.(opt);
|
|
83
91
|
};
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
const file = opt
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
});
|
|
100
|
-
stream.on('error', reject);
|
|
101
|
-
stream.pipe(parse);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
return p;
|
|
92
|
+
/** The sync form of `list`. */
|
|
93
|
+
export const listSync = (options, files) => {
|
|
94
|
+
const opt = dealias(options);
|
|
95
|
+
const { input, file, fs, onEntry } = opt;
|
|
96
|
+
const source = input ??
|
|
97
|
+
(file && fs ? readFileSync(fs, file, opt.maxReadSize) : undefined);
|
|
98
|
+
if (!source)
|
|
99
|
+
throw noInput();
|
|
100
|
+
const [filter, report] = files?.length ? filesFilter(files, opt.filter) : [];
|
|
101
|
+
if (filter)
|
|
102
|
+
opt.filter = filter;
|
|
103
|
+
const reader = new TarReaderSync(source, opt);
|
|
104
|
+
for (const entry of reader)
|
|
105
|
+
onEntry?.(entry);
|
|
106
|
+
report?.(opt);
|
|
106
107
|
};
|
|
107
|
-
export const list = makeCommand(listFileSync, listFile, opt => new Parser(opt), opt => new Parser(opt), (opt, files) => {
|
|
108
|
-
if (files?.length)
|
|
109
|
-
filesFilter(opt, files);
|
|
110
|
-
if (!opt.noResume)
|
|
111
|
-
onReadEntryFunction(opt);
|
|
112
|
-
});
|
|
113
108
|
//# sourceMappingURL=list.js.map
|
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { ExtractFS, ExtractFSSync } from './fs.js';
|
|
2
|
+
/** The options of `mkdir`. Each path has `/` separators. */
|
|
3
3
|
export type MkdirOptions = {
|
|
4
|
+
/** The owner of each directory that is made, if it has `gid` also. */
|
|
4
5
|
uid?: number;
|
|
5
6
|
gid?: number;
|
|
6
7
|
processUid?: number;
|
|
7
8
|
processGid?: number;
|
|
8
|
-
|
|
9
|
+
/** If the mode has a bit of this mask, `chmod` sets the mode. */
|
|
10
|
+
umask: number;
|
|
11
|
+
/** Permit a symbolic link in the path. */
|
|
9
12
|
preserve: boolean;
|
|
13
|
+
/** Remove an object in the path that is not a directory. */
|
|
10
14
|
unlink: boolean;
|
|
15
|
+
/** The absolute path of the extraction directory. */
|
|
11
16
|
cwd: string;
|
|
12
17
|
mode: number;
|
|
13
18
|
};
|
|
14
|
-
export type MkdirError = NodeJS.ErrnoException | CwdError | SymlinkError;
|
|
15
19
|
/**
|
|
16
|
-
*
|
|
20
|
+
* Make the directory `dir` and its parents, below `opt.cwd`.
|
|
17
21
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
+
* If `opt.preserve` is not set, a symbolic link in the path is an
|
|
23
|
+
* error, so that no entry is extracted through a link. The
|
|
24
|
+
* extraction directory itself is never made: it must be a directory,
|
|
25
|
+
* or the error is a `CwdError`.
|
|
22
26
|
*/
|
|
23
|
-
export declare const mkdir: (dir: string, opt: MkdirOptions
|
|
24
|
-
|
|
27
|
+
export declare const mkdir: (fs: ExtractFS, dir: string, opt: MkdirOptions) => Promise<void>;
|
|
28
|
+
/** The sync form of `mkdir`. */
|
|
29
|
+
export declare const mkdirSync: (fs: ExtractFSSync, dir: string, opt: MkdirOptions) => void;
|
|
25
30
|
//# sourceMappingURL=mkdir.d.ts.map
|
|
@@ -1,179 +1,144 @@
|
|
|
1
|
-
import { chownr, chownrSync } from 'chownr';
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import fsp from 'node:fs/promises';
|
|
4
|
-
import path from 'node:path';
|
|
5
1
|
import { CwdError } from './cwd-error.js';
|
|
6
|
-
import { normalizeWindowsPath } from './normalize-windows-path.js';
|
|
7
2
|
import { SymlinkError } from './symlink-error.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
import { relative } from './path.js';
|
|
4
|
+
// The parts of the mkdir options that do not need the file system.
|
|
5
|
+
const plan = (opt) => {
|
|
6
|
+
const mode = opt.mode | 0o700;
|
|
7
|
+
const { uid, gid } = opt;
|
|
8
|
+
return {
|
|
9
|
+
mode,
|
|
10
|
+
// The umask removes bits when the system makes the directory.
|
|
11
|
+
needChmod: (mode & opt.umask) !== 0,
|
|
12
|
+
owner: (typeof uid === 'number' &&
|
|
13
|
+
typeof gid === 'number' &&
|
|
14
|
+
(uid !== opt.processUid || gid !== opt.processGid)) ?
|
|
15
|
+
{ uid, gid }
|
|
16
|
+
: undefined,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
const child = (dir, name) => dir.endsWith('/') ? dir + name : dir + '/' + name;
|
|
20
|
+
// The directories that a recursive mkdir made: `dir`, and its parents
|
|
21
|
+
// up to `first`, the one that was made first. On Windows, Node.js
|
|
22
|
+
// gives `first` with `\` separators, after the prefix `\\?\`. So
|
|
23
|
+
// `first` is the parent that it ends with. If it ends with none of
|
|
24
|
+
// them, only `dir` is known.
|
|
25
|
+
const chain = (first, dir) => {
|
|
26
|
+
const end = first.replaceAll('\\', '/');
|
|
27
|
+
const made = [dir];
|
|
28
|
+
for (let i = dir.length; !end.endsWith(dir.slice(0, i));) {
|
|
29
|
+
i = dir.lastIndexOf('/', i - 1);
|
|
30
|
+
if (i <= 0)
|
|
31
|
+
return [dir];
|
|
32
|
+
made.push(dir.slice(0, i));
|
|
33
|
+
}
|
|
34
|
+
return made;
|
|
15
35
|
};
|
|
16
36
|
/**
|
|
17
|
-
*
|
|
37
|
+
* Make the directory `dir` and its parents, below `opt.cwd`.
|
|
18
38
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
39
|
+
* If `opt.preserve` is not set, a symbolic link in the path is an
|
|
40
|
+
* error, so that no entry is extracted through a link. The
|
|
41
|
+
* extraction directory itself is never made: it must be a directory,
|
|
42
|
+
* or the error is a `CwdError`.
|
|
23
43
|
*/
|
|
24
|
-
export const mkdir = (dir, opt
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/* c8 ignore next */
|
|
29
|
-
const umask = opt.umask ?? 0o22;
|
|
30
|
-
const mode = opt.mode | 0o0700;
|
|
31
|
-
const needChmod = (mode & umask) !== 0;
|
|
32
|
-
const uid = opt.uid;
|
|
33
|
-
const gid = opt.gid;
|
|
34
|
-
const doChown = typeof uid === 'number' &&
|
|
35
|
-
typeof gid === 'number' &&
|
|
36
|
-
(uid !== opt.processUid || gid !== opt.processGid);
|
|
37
|
-
const preserve = opt.preserve;
|
|
38
|
-
const unlink = opt.unlink;
|
|
39
|
-
const cwd = normalizeWindowsPath(opt.cwd);
|
|
40
|
-
const done = (er, created) => {
|
|
41
|
-
if (er) {
|
|
42
|
-
cb(er);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
if (created && doChown) {
|
|
46
|
-
chownr(created, uid, gid, er => done(er));
|
|
47
|
-
}
|
|
48
|
-
else if (needChmod) {
|
|
49
|
-
fs.chmod(dir, mode, cb);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
cb();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
};
|
|
44
|
+
export const mkdir = async (fs, dir, opt) => {
|
|
45
|
+
const { mode, needChmod, owner } = plan(opt);
|
|
46
|
+
const { cwd } = opt;
|
|
47
|
+
let made = [];
|
|
56
48
|
if (dir === cwd) {
|
|
57
|
-
|
|
49
|
+
let code = 'ENOTDIR';
|
|
50
|
+
const ok = await fs.stat(dir).then(st => st.isDirectory(), (er) => {
|
|
51
|
+
code = er?.code || code;
|
|
52
|
+
return false;
|
|
53
|
+
});
|
|
54
|
+
if (!ok)
|
|
55
|
+
throw new CwdError(dir, code);
|
|
58
56
|
}
|
|
59
|
-
if (preserve) {
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
else if (opt.preserve) {
|
|
58
|
+
const first = await fs.mkdir(dir, { mode, recursive: true });
|
|
59
|
+
if (first)
|
|
60
|
+
made = chain(first, dir);
|
|
62
61
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
const p = parts.shift();
|
|
72
|
-
const part = normalizeWindowsPath(path.resolve(base + '/' + p));
|
|
73
|
-
fs.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb));
|
|
74
|
-
};
|
|
75
|
-
const onmkdir = (part, parts, mode, unlink, cwd, created, cb) => (er) => {
|
|
76
|
-
if (er) {
|
|
77
|
-
fs.lstat(part, (statEr, st) => {
|
|
78
|
-
if (statEr) {
|
|
79
|
-
statEr.path = statEr.path && normalizeWindowsPath(statEr.path);
|
|
80
|
-
cb(statEr);
|
|
81
|
-
}
|
|
82
|
-
else if (st.isDirectory()) {
|
|
83
|
-
mkdir_(part, parts, mode, unlink, cwd, created, cb);
|
|
84
|
-
}
|
|
85
|
-
else if (unlink) {
|
|
86
|
-
fs.unlink(part, er => {
|
|
87
|
-
if (er) {
|
|
88
|
-
return cb(er);
|
|
89
|
-
}
|
|
90
|
-
fs.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb));
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
else if (st.isSymbolicLink()) {
|
|
94
|
-
return cb(new SymlinkError(part, part + '/' + parts.join('/')));
|
|
62
|
+
else {
|
|
63
|
+
const parts = relative(cwd, dir).split('/');
|
|
64
|
+
let part = cwd;
|
|
65
|
+
for (let i = 0; i < parts.length; i++) {
|
|
66
|
+
part = child(part, parts[i]);
|
|
67
|
+
try {
|
|
68
|
+
await fs.mkdir(part, { mode });
|
|
95
69
|
}
|
|
96
|
-
|
|
97
|
-
|
|
70
|
+
catch (er) {
|
|
71
|
+
const st = await fs.lstat(part);
|
|
72
|
+
if (st.isDirectory())
|
|
73
|
+
continue;
|
|
74
|
+
if (!opt.unlink) {
|
|
75
|
+
throw st.isSymbolicLink() ?
|
|
76
|
+
new SymlinkError(part, part + '/' + parts.slice(i + 1).join('/'))
|
|
77
|
+
: er;
|
|
78
|
+
}
|
|
79
|
+
await fs.unlink(part);
|
|
80
|
+
await fs.mkdir(part, { mode });
|
|
98
81
|
}
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
created = created || part;
|
|
103
|
-
mkdir_(part, parts, mode, unlink, cwd, created, cb);
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
const checkCwdSync = (dir) => {
|
|
107
|
-
let ok = false;
|
|
108
|
-
let code;
|
|
109
|
-
try {
|
|
110
|
-
ok = fs.statSync(dir).isDirectory();
|
|
111
|
-
}
|
|
112
|
-
catch (er) {
|
|
113
|
-
code = er?.code;
|
|
114
|
-
}
|
|
115
|
-
finally {
|
|
116
|
-
if (!ok) {
|
|
117
|
-
throw new CwdError(dir, code ?? 'ENOTDIR');
|
|
82
|
+
made.push(part);
|
|
118
83
|
}
|
|
119
84
|
}
|
|
85
|
+
if (owner) {
|
|
86
|
+
for (const d of made)
|
|
87
|
+
await fs.lchown(d, owner.uid, owner.gid);
|
|
88
|
+
}
|
|
89
|
+
if (needChmod)
|
|
90
|
+
await fs.chmod(dir, mode);
|
|
120
91
|
};
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
const doChown = typeof uid === 'number' &&
|
|
132
|
-
typeof gid === 'number' &&
|
|
133
|
-
(uid !== opt.processUid || gid !== opt.processGid);
|
|
134
|
-
const preserve = opt.preserve;
|
|
135
|
-
const unlink = opt.unlink;
|
|
136
|
-
const cwd = normalizeWindowsPath(opt.cwd);
|
|
137
|
-
const done = (created) => {
|
|
138
|
-
if (created && doChown) {
|
|
139
|
-
chownrSync(created, uid, gid);
|
|
92
|
+
/** The sync form of `mkdir`. */
|
|
93
|
+
export const mkdirSync = (fs, dir, opt) => {
|
|
94
|
+
const { mode, needChmod, owner } = plan(opt);
|
|
95
|
+
const { cwd } = opt;
|
|
96
|
+
let made = [];
|
|
97
|
+
if (dir === cwd) {
|
|
98
|
+
let code = 'ENOTDIR';
|
|
99
|
+
let ok = false;
|
|
100
|
+
try {
|
|
101
|
+
ok = fs.statSync(dir).isDirectory();
|
|
140
102
|
}
|
|
141
|
-
|
|
142
|
-
|
|
103
|
+
catch (er) {
|
|
104
|
+
code = er?.code || code;
|
|
143
105
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
checkCwdSync(cwd);
|
|
147
|
-
return done();
|
|
106
|
+
if (!ok)
|
|
107
|
+
throw new CwdError(dir, code);
|
|
148
108
|
}
|
|
149
|
-
if (preserve) {
|
|
150
|
-
|
|
109
|
+
else if (opt.preserve) {
|
|
110
|
+
const first = fs.mkdirSync(dir, { mode, recursive: true });
|
|
111
|
+
if (first)
|
|
112
|
+
made = chain(first, dir);
|
|
151
113
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
created = created || part;
|
|
160
|
-
}
|
|
161
|
-
catch {
|
|
162
|
-
const st = fs.lstatSync(part);
|
|
163
|
-
if (st.isDirectory()) {
|
|
164
|
-
continue;
|
|
114
|
+
else {
|
|
115
|
+
const parts = relative(cwd, dir).split('/');
|
|
116
|
+
let part = cwd;
|
|
117
|
+
for (let i = 0; i < parts.length; i++) {
|
|
118
|
+
part = child(part, parts[i]);
|
|
119
|
+
try {
|
|
120
|
+
fs.mkdirSync(part, { mode });
|
|
165
121
|
}
|
|
166
|
-
|
|
122
|
+
catch (er) {
|
|
123
|
+
const st = fs.lstatSync(part);
|
|
124
|
+
if (st.isDirectory())
|
|
125
|
+
continue;
|
|
126
|
+
if (!opt.unlink) {
|
|
127
|
+
throw st.isSymbolicLink() ?
|
|
128
|
+
new SymlinkError(part, part + '/' + parts.slice(i + 1).join('/'))
|
|
129
|
+
: er;
|
|
130
|
+
}
|
|
167
131
|
fs.unlinkSync(part);
|
|
168
|
-
fs.mkdirSync(part, mode);
|
|
169
|
-
created = created || part;
|
|
170
|
-
continue;
|
|
171
|
-
}
|
|
172
|
-
else if (st.isSymbolicLink()) {
|
|
173
|
-
return new SymlinkError(part, part + '/' + parts.join('/'));
|
|
132
|
+
fs.mkdirSync(part, { mode });
|
|
174
133
|
}
|
|
134
|
+
made.push(part);
|
|
175
135
|
}
|
|
176
136
|
}
|
|
177
|
-
|
|
137
|
+
if (owner) {
|
|
138
|
+
for (const d of made)
|
|
139
|
+
fs.lchownSync(d, owner.uid, owner.gid);
|
|
140
|
+
}
|
|
141
|
+
if (needChmod)
|
|
142
|
+
fs.chmodSync(dir, mode);
|
|
178
143
|
};
|
|
179
144
|
//# sourceMappingURL=mkdir.js.map
|
|
@@ -6,7 +6,16 @@ const normalizeCache = Object.create(null);
|
|
|
6
6
|
// Limit the size of this. Very low-sophistication LRU cache
|
|
7
7
|
const MAX = 10000;
|
|
8
8
|
const cache = new Set();
|
|
9
|
+
// A longer string is not cached. Long paths do not repeat, and the
|
|
10
|
+
// cache would keep them for the life of the process.
|
|
11
|
+
const MAX_LENGTH = 256;
|
|
9
12
|
export const normalizeUnicode = (s) => {
|
|
13
|
+
if (s.length > MAX_LENGTH) {
|
|
14
|
+
return s
|
|
15
|
+
.normalize('NFD')
|
|
16
|
+
.toLocaleLowerCase('en')
|
|
17
|
+
.toLocaleUpperCase('en');
|
|
18
|
+
}
|
|
10
19
|
if (!cache.has(s)) {
|
|
11
20
|
// shake out identical accents and ligatures
|
|
12
21
|
normalizeCache[s] = s
|