vbapm 0.6.14 → 0.7.0
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 +46 -0
- package/addins/build/vbapm.xlam +0 -0
- package/lib/_commonjsHelpers-Bjf42z7h.js +1 -0
- package/lib/actions/add-source.d.ts +11 -0
- package/lib/add-source-_Z4tr2ea.js +17 -0
- package/lib/bin/vbapm-add.d.ts +2 -0
- package/lib/build-project-CIZanDh1.js +3 -0
- package/lib/build-target-B03OPzeI.js +9 -0
- package/lib/crc32-Cc3OMFYk.js +1 -0
- package/lib/create-project-CTAlegO8.js +10 -0
- package/lib/debug.js +1 -1
- package/lib/errors.d.ts +4 -0
- package/lib/export-project-DdTYRyAw.js +4 -0
- package/lib/export-target-CEupP86g.js +4 -0
- package/lib/{get-target-e760a439.js → get-target-Ba_ZoGUl.js} +1 -1
- package/lib/index-BlteXxjY.js +1 -0
- package/lib/index-CB6KQLC7.js +13 -0
- package/lib/index-CEojr58e.js +2 -0
- package/lib/index-Cwtynogk.js +54 -0
- package/lib/index-DSgWshzu.js +2 -0
- package/lib/index-_8uEunjn.js +6 -0
- package/lib/index-mBZsirl0.js +14 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/init-project-BY-a8CIk.js +15 -0
- package/lib/installer-C0iBwEpK.js +9 -0
- package/lib/{load-from-project-acf7400a.js → load-from-project-wNJg8fme.js} +1 -1
- package/lib/once-fkpTAKD3.js +1 -0
- package/lib/one_ini_bg.wasm +0 -0
- package/lib/project-DFh-2QTw.js +20 -0
- package/lib/run-macro-Ck_8Iku3.js +1 -0
- package/lib/sat-solver-CqS8Vf6C.js +1 -0
- package/lib/string_decoder-CW-j4E6X.js +1 -0
- package/lib/test-project-CM-XUOdH.js +1 -0
- package/lib/tmp-C7yJT4iq.js +8 -0
- package/lib/toml-patch-r8oqFm0h.js +3 -0
- package/lib/transform-target-DJmqMjY0.js +2 -0
- package/lib/vbapm-add-QPN5uEGK.js +16 -0
- package/lib/vbapm-build-BKtQ6OeP.js +9 -0
- package/lib/vbapm-export-4H_qDinP.js +7 -0
- package/lib/{vbapm-init-5c8eb026.js → vbapm-init-BMY4x_xq.js} +2 -2
- package/lib/vbapm-new-DLW9SdvJ.js +17 -0
- package/lib/vbapm-run-DzRxAhlD.js +10 -0
- package/lib/{vbapm-test-a7b30592.js → vbapm-test-DInh0MDC.js} +1 -1
- package/lib/vbapm-version-3Xv7JjGv.js +8 -0
- package/lib/vbapm.js +11 -10
- package/package.json +124 -137
- package/lib/_commonjsHelpers-553b27b3.js +0 -1
- package/lib/build-project-eb8454f0.js +0 -3
- package/lib/build-target-dbcc69c7.js +0 -9
- package/lib/create-project-3154aace.js +0 -10
- package/lib/export-project-bc13c1ae.js +0 -4
- package/lib/export-target-5d28d188.js +0 -4
- package/lib/index-4ce3d28b.js +0 -6
- package/lib/index-72c1a91d.js +0 -3
- package/lib/index-c5b5f6d1.js +0 -2
- package/lib/index-ddd39b65.js +0 -5
- package/lib/init-project-ceecd718.js +0 -15
- package/lib/installer-dbc2c34a.js +0 -21
- package/lib/once-5205b917.js +0 -1
- package/lib/project-43370ed3.js +0 -29
- package/lib/run-macro-4f1375ca.js +0 -1
- package/lib/sat-solver-f9155891.js +0 -1
- package/lib/test-project-669dfcfb.js +0 -1
- package/lib/tmp-14f9d850.js +0 -9
- package/lib/toml-patch.es-6bd2145d.js +0 -3
- package/lib/vbapm-build-8ff58485.js +0 -9
- package/lib/vbapm-export-96798f4f.js +0 -7
- package/lib/vbapm-new-cd174cbb.js +0 -17
- package/lib/vbapm-run-2f17fb22.js +0 -10
- package/lib/vbapm-version-c5f3d55a.js +0 -8
- package/lib/workbook-xml-a61269f4.js +0 -2
package/README.md
CHANGED
|
@@ -122,6 +122,40 @@ Create a blank package:
|
|
|
122
122
|
vba init --package
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
+
### `add`
|
|
126
|
+
|
|
127
|
+
Create a new source file in `src/` and register it in `vbaproject.toml`.
|
|
128
|
+
|
|
129
|
+
Create a standard module:
|
|
130
|
+
|
|
131
|
+
```txt
|
|
132
|
+
vba add Module1
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Create a class module:
|
|
136
|
+
|
|
137
|
+
```txt
|
|
138
|
+
vba add JsonParser --type class
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Register an existing source file by path (no overwrite):
|
|
142
|
+
|
|
143
|
+
```txt
|
|
144
|
+
vba add .\src\Test.bas
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Create and register a file in a nested path (missing folders are created):
|
|
148
|
+
|
|
149
|
+
```txt
|
|
150
|
+
vba add .\src\features\auth\LoginHelper.bas
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Add a development-only source to `[dev-src]`:
|
|
154
|
+
|
|
155
|
+
```txt
|
|
156
|
+
vba add TestHelpers --dev
|
|
157
|
+
```
|
|
158
|
+
|
|
125
159
|
### `build`
|
|
126
160
|
|
|
127
161
|
Build an Excel workbook from the project's source. The built file is located in the `build/` folder and if a previously built file is found it is moved to `/.backup` to protect against losing any previously saved work.
|
|
@@ -305,6 +339,18 @@ Scripting = { version = "1.0", guid = "{...}" }
|
|
|
305
339
|
<br>It will run the end-to-end CLI scenarios in excel.e2e.ts, covering workflows like build, export, new, and version against fixtures.
|
|
306
340
|
<br>To keep temporary e2e work folders for manual inspection, set `KEEP_E2E_TMP=1` before running (PowerShell: `$env:KEEP_E2E_TMP=1; npm run test:e2e`, cmd: `set KEEP_E2E_TMP=1 && npm run test:e2e`).
|
|
307
341
|
|
|
342
|
+
### Install local version
|
|
343
|
+
|
|
344
|
+
To install the local version you can use the `devinstall.ps1` script available in the installer submodule.
|
|
345
|
+
|
|
346
|
+
```powershell
|
|
347
|
+
# Update submodule
|
|
348
|
+
git submodule update --init --recursive installer
|
|
349
|
+
|
|
350
|
+
# Run devinstall
|
|
351
|
+
.\installer\devinstall.ps1
|
|
352
|
+
```
|
|
353
|
+
|
|
308
354
|
### Release
|
|
309
355
|
|
|
310
356
|
1. Run `npm version`
|
package/addins/build/vbapm.xlam
CHANGED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};exports.commonjsGlobal=e,exports.getAugmentedNamespace=function(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var o=function e(){var o=!1;try{o=this instanceof e}catch{}return o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};o.prototype=t.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),o},exports.getDefaultExportFromCjs=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface AddSourceOptions {
|
|
2
|
+
name?: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
dir?: string;
|
|
5
|
+
dev: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface AddSourceResult {
|
|
8
|
+
path: string;
|
|
9
|
+
isNew: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function addSource(options: AddSourceOptions): Promise<AddSourceResult>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";var e=require("./installer-C0iBwEpK.js"),r=require("./index-CB6KQLC7.js"),t=require("path");const n={".bas":"module",".cls":"class"},a={module:".bas",class:".cls"},o=/^[\p{L}_][\p{L}\p{N}\p{M}_]*$/u;exports.addSource=async function(s){const{name:d,type:i,dir:c,dev:u}=s,l=c||e.env.cwd;if(!d)throw new e.CliError(e.ErrorCode.AddNameRequired,e.dedent`
|
|
2
|
+
"name" is required with vbapm add (e.g. vbapm add Module1).
|
|
3
|
+
|
|
4
|
+
Try "vbapm help add" for more information.
|
|
5
|
+
`);const p=await r.loadManifest(l),m=function(r,o){const s=t.extname(r).toLowerCase(),d=o&&a[o.toLowerCase()];if(s&&!(s in n))throw new e.CliError(e.ErrorCode.AddUnsupportedType,`Unsupported source extension "${s}". Supported extensions are .bas and .cls.`);if(o&&!d)throw new e.CliError(e.ErrorCode.AddUnsupportedType,`Unsupported --type "${o}". Supported types are "module" and "class".`);if(s&&d&&s!==d)throw new e.CliError(e.ErrorCode.AddUnsupportedType,`Type "${o}" conflicts with extension "${s}".`);return s||(d||".bas")}(d,i);let w=d.includes("/")||d.includes("\\")?e.join(l,d):e.join(l,"src",d);t.extname(w)||(w=`${w}${m}`);const E=t.basename(w,t.extname(w));if(!E)throw new e.CliError(e.ErrorCode.AddInvalidName,`Invalid source name "${d}".`);if(!o.test(E))throw new e.CliError(e.ErrorCode.AddInvalidName,`Invalid VBA component name "${E}". Use Unicode letters, numbers, and underscores only, and do not start with a number.`);const b=u?"dev-src":"src",h=p.src.find(e=>e.name===E||e.path===w),f=p.devSrc.find(e=>e.name===E||e.path===w);if(h||f){const r=h?"src":"dev-src";throw new e.CliError(e.ErrorCode.AddSourceExists,`Source "${E}" already exists in [${r}] and cannot be added to [${b}].`)}const C=u?p.devSrc:p.src,x=await e.pathExistsExports.pathExists(w);x||(await e.mkdirsExports.ensureDir(t.dirname(w)),await e.writeFile(w,function(r,t){if(".cls"===t)return e.dedent`
|
|
6
|
+
VERSION 1.0 CLASS
|
|
7
|
+
BEGIN
|
|
8
|
+
MultiUse = -1 'True
|
|
9
|
+
END
|
|
10
|
+
Attribute VB_Name = "${r}"
|
|
11
|
+
Attribute VB_GlobalNameSpace = False
|
|
12
|
+
Attribute VB_Creatable = False
|
|
13
|
+
Attribute VB_PredeclaredId = False
|
|
14
|
+
Attribute VB_Exposed = False
|
|
15
|
+
`+"\n\n";return e.dedent`
|
|
16
|
+
Attribute VB_Name = "${r}"
|
|
17
|
+
`+"\n\n"}(E,m)));const A={name:E,path:w};return C.push(A),await r.writeManifest(p,l),{path:w,isNew:!x}};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";var e=require("./installer-C0iBwEpK.js"),r=require("./project-DFh-2QTw.js"),t=require("./index-CB6KQLC7.js"),i=require("./build-target-B03OPzeI.js");require("assert"),require("./transform-target-DJmqMjY0.js"),require("fs");var n=require("./get-target-Ba_ZoGUl.js");exports.buildProject=async function(a={}){e.env.reporter.log(e.Message.BuildProjectLoading,"[1/3] Loading project...");const s=await r.loadProject(),{target:o,blankTarget:g}=n.getTarget(s,a.target),c=await r.fetchDependencies(s),d=s.packages.map(e=>{const i=r.toDependency(e);return t.isRegistryDependency(i)?`${e.id} registry+${i.registry}`:`${e.id} ${e.source}`});e.env.reporter.log(e.Message.BuildTargetBuilding,e.dedent`
|
|
2
|
+
\n[2/3] Building target "${o.type}" for "${s.manifest.name}"...
|
|
3
|
+
${d.length?`\nDependencies:\n${d.join("\n")}`:""}`),await i.buildTarget(o,{project:s,dependencies:c,blankTarget:g},a);const l=!s.hasDirtyLockfile;return e.env.reporter.log(e.Message.BuildLockfileWriting,"\n[3/3] Writing lockfile..."+(l?" (skipped, no changes)":"")),l||await r.writeLockfile(s.paths.root,s),e.join(s.paths.dir,"build",o.filename)};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";var t=require("./installer-C0iBwEpK.js"),a=require("./transform-target-DJmqMjY0.js");require("assert");var r=require("./load-from-project-wNJg8fme.js"),e=require("path"),i=require("./project-DFh-2QTw.js");const o=t=>/1004/.test(t),n=(a,r)=>t.dedent`
|
|
2
|
+
Failed to build target "${a.name}", it is currently open.
|
|
3
|
+
|
|
4
|
+
Please close "${r}" and try again.
|
|
5
|
+
`;async function s(a,r){if(!await t.pathExistsExports.pathExists(r.path))throw new t.CliError(t.ErrorCode.TargetNotFound,`Target "${r.name}" not found at "${r.path}".`);const e=t.join(a.paths.staging,r.filename);try{await t.mkdirsExports.ensureDir(a.paths.staging),await i.zip(r.path,e)}catch(a){throw new t.CliError(t.ErrorCode.TargetCreateFailed,`Failed to create project for target "${r.name}".`,a)}return e}exports.buildTarget=async function(i,p,c={}){const{project:l}=p;let m;try{m=p.blankTarget?await a.createDocument(l,i,{staging:!0}):await s(l,i)}catch(a){if(!t.isRunError(a)||!a.result.errors.some(o))throw a;const r=t.join(l.paths.build,i.filename);throw new t.CliError(t.ErrorCode.TargetIsOpen,n(i,r))}await async function(i,o,n,s={}){const{project:p,dependencies:c}=o,l=t.join(p.paths.staging,"import");await t.mkdirsExports.ensureDir(l),await t.emptyExports.emptyDir(l);const m=await r.loadFromProject(p,c,s),w=await async function(a,r){const i=await t.parallel(a.components,async a=>{const i=t.join(r,a.filename);if(await t.writeFile(i,a.code),a.binaryPath){const i=t.join(r,e.basename(a.binaryPath));if(!a.details.binary)throw new Error(`Binary data missing for component "${a.name}"`);await t.writeFile(i,a.details.binary)}return{name:a.name,path:i}});return{name:a.name,components:i,references:a.references}}(m,l);try{await a.importGraph(p,i,w,n,s)}catch(a){throw new t.CliError(t.ErrorCode.TargetImportFailed,`Failed to import project for target "${i.name}".`,a)}finally{await t.removeExports.remove(l)}}(i,p,m,c);try{await async function(a,r){const e=t.join(a.paths.backup,r.filename),i=t.join(a.paths.build,r.filename);await t.pathExistsExports.pathExists(e)&&await t.removeExports.remove(e);if(await t.pathExistsExports.pathExists(i)){await t.mkdirsExports.ensureDir(a.paths.backup);try{await t.moveExports.move(i,e)}catch(a){throw new t.CliError(t.ErrorCode.TargetIsOpen,n(r,i))}}}(l,i);const a=t.join(l.paths.build,i.filename);await t.moveExports.move(m,a)}catch(a){throw await async function(a,r){const e=t.join(a.paths.backup,r.filename),i=t.join(a.paths.build,r.filename);if(!await t.pathExistsExports.pathExists(e))return;try{await t.copyExports.copy(e,i)}catch(a){throw new t.CliError(t.ErrorCode.TargetRestoreFailed,t.dedent`
|
|
6
|
+
Failed to automatically restore backup from "${e}" to "${i}".
|
|
7
|
+
|
|
8
|
+
The previous version can be moved back manually, if desired.
|
|
9
|
+
`,a)}}(l,i),a}finally{await t.removeExports.remove(m)}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var r,n={};exports.requireCrc32=function(){return r||(r=1,t=function(r){r.version="1.2.0";var n=function(){for(var r=0,n=new Array(256),t=0;256!=t;++t)r=1&(r=1&(r=1&(r=1&(r=1&(r=1&(r=1&(r=1&(r=t)?-306674912^r>>>1:r>>>1)?-306674912^r>>>1:r>>>1)?-306674912^r>>>1:r>>>1)?-306674912^r>>>1:r>>>1)?-306674912^r>>>1:r>>>1)?-306674912^r>>>1:r>>>1)?-306674912^r>>>1:r>>>1)?-306674912^r>>>1:r>>>1,n[t]=r;return"undefined"!=typeof Int32Array?new Int32Array(n):n}();r.table=n,r.bstr=function(r,t){for(var e=-1^t,o=r.length-1,f=0;f<o;)e=(e=e>>>8^n[255&(e^r.charCodeAt(f++))])>>>8^n[255&(e^r.charCodeAt(f++))];return f===o&&(e=e>>>8^n[255&(e^r.charCodeAt(f))]),-1^e},r.buf=function(r,t){if(r.length>1e4)return function(r,t){for(var e=-1^t,o=r.length-7,f=0;f<o;)e=(e=(e=(e=(e=(e=(e=(e=e>>>8^n[255&(e^r[f++])])>>>8^n[255&(e^r[f++])])>>>8^n[255&(e^r[f++])])>>>8^n[255&(e^r[f++])])>>>8^n[255&(e^r[f++])])>>>8^n[255&(e^r[f++])])>>>8^n[255&(e^r[f++])])>>>8^n[255&(e^r[f++])];for(;f<o+7;)e=e>>>8^n[255&(e^r[f++])];return-1^e}(r,t);for(var e=-1^t,o=r.length-3,f=0;f<o;)e=(e=(e=(e=e>>>8^n[255&(e^r[f++])])>>>8^n[255&(e^r[f++])])>>>8^n[255&(e^r[f++])])>>>8^n[255&(e^r[f++])];for(;f<o+3;)e=e>>>8^n[255&(e^r[f++])];return-1^e},r.str=function(r,t){for(var e,o,f=-1^t,u=0,a=r.length;u<a;)(e=r.charCodeAt(u++))<128?f=f>>>8^n[255&(f^e)]:e<2048?f=(f=f>>>8^n[255&(f^(192|e>>6&31))])>>>8^n[255&(f^(128|63&e))]:e>=55296&&e<57344?(e=64+(1023&e),o=1023&r.charCodeAt(u++),f=(f=(f=(f=f>>>8^n[255&(f^(240|e>>8&7))])>>>8^n[255&(f^(128|e>>2&63))])>>>8^n[255&(f^(128|o>>6&15|(3&e)<<4))])>>>8^n[255&(f^(128|63&o))]):f=(f=(f=f>>>8^n[255&(f^(224|e>>12&15))])>>>8^n[255&(f^(128|e>>6&63))])>>>8^n[255&(f^(128|63&e))];return-1^f}},"undefined"==typeof DO_NOT_EXPORT_CRC?t(n):t({})),n;var t};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";var r=require("./installer-C0iBwEpK.js"),e=require("./init-project-BY-a8CIk.js");exports.createProject=async function(t){if(!t||!t.name)throw new r.CliError(r.ErrorCode.NewNameRequired,r.dedent`
|
|
2
|
+
"name" is required with vbapm new (e.g. vbapm new project-name).
|
|
3
|
+
|
|
4
|
+
Try "vbapm help new" for more information.
|
|
5
|
+
`);let{name:i,target:o,from:a,pkg:n,git:s}=t;if(!o&&!a&&i.includes(".")){const r=i.split(".");o=r.pop(),i=r.join(".")}if(!n&&!o&&!a)throw new r.CliError(r.ErrorCode.NewTargetRequired,r.dedent`
|
|
6
|
+
.TYPE, --target, or --from is required for vbapm projects.
|
|
7
|
+
(e.g. vbapm new project.name.TYPE)
|
|
8
|
+
|
|
9
|
+
Try "vbapm help new" for more information.
|
|
10
|
+
`);const p=r.join(r.env.cwd,i);if(await r.pathExistsExports.pathExists(p))throw new r.CliError(r.ErrorCode.NewDirExists,`A directory for "${i}" already exists: "${p}". `);await r.mkdirsExports.ensureDir(p),await e.initProject({name:i,dir:p,target:o,from:a,pkg:n,git:s})};
|
package/lib/debug.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./_commonjsHelpers-
|
|
1
|
+
"use strict";var e,r,t=require("./_commonjsHelpers-Bjf42z7h.js"),s=require("tty"),n=require("util"),o=require("os"),i={exports:{}};var c,a,u,l,f,p,d,m,h,O,g={exports:{}};function y(){return a?c:(a=1,c=(e,r=process.argv)=>{const t=e.startsWith("-")?"":1===e.length?"-":"--",s=r.indexOf(t+e),n=r.indexOf("--");return-1!==s&&(-1===n||s<n)})}function b(){if(p)return f;p=1;var e=1e3,r=60*e,t=60*r,s=24*t,n=7*s,o=365.25*s;function i(e,r,t,s){var n=r>=1.5*t;return Math.round(e/t)+" "+s+(n?"s":"")}return f=function(c,a){a=a||{};var u=typeof c;if("string"===u&&c.length>0)return function(i){if((i=String(i)).length>100)return;var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!c)return;var a=parseFloat(c[1]);switch((c[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*o;case"weeks":case"week":case"w":return a*n;case"days":case"day":case"d":return a*s;case"hours":case"hour":case"hrs":case"hr":case"h":return a*t;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(c);if("number"===u&&isFinite(c))return a.long?function(n){var o=Math.abs(n);if(o>=s)return i(n,o,s,"day");if(o>=t)return i(n,o,t,"hour");if(o>=r)return i(n,o,r,"minute");if(o>=e)return i(n,o,e,"second");return n+" ms"}(c):function(n){var o=Math.abs(n);if(o>=s)return Math.round(n/s)+"d";if(o>=t)return Math.round(n/t)+"h";if(o>=r)return Math.round(n/r)+"m";if(o>=e)return Math.round(n/e)+"s";return n+"ms"}(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))}}function v(){return h||(h=1,function(e,r){const t=s,i=n;r.init=function(e){e.inspectOpts={};const t=Object.keys(r.inspectOpts);for(let s=0;s<t.length;s++)e.inspectOpts[t[s]]=r.inspectOpts[t[s]]},r.log=function(...e){return process.stderr.write(i.formatWithOptions(r.inspectOpts,...e)+"\n")},r.formatArgs=function(t){const{namespace:s,useColors:n}=this;if(n){const r=this.color,n="[3"+(r<8?r:"8;5;"+r),o=` ${n};1m${s} [0m`;t[0]=o+t[0].split("\n").join("\n"+o),t.push(n+"m+"+e.exports.humanize(this.diff)+"[0m")}else t[0]=function(){if(r.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+s+" "+t[0]},r.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},r.load=function(){return process.env.DEBUG},r.useColors=function(){return"colors"in r.inspectOpts?Boolean(r.inspectOpts.colors):t.isatty(process.stderr.fd)},r.destroy=i.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),r.colors=[6,2,3,4,5,1];try{const e=function(){if(l)return u;l=1;const e=o,r=s,t=y(),{env:n}=process;let i;function c(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function a(r,s){if(0===i)return 0;if(t("color=16m")||t("color=full")||t("color=truecolor"))return 3;if(t("color=256"))return 2;if(r&&!s&&void 0===i)return 0;const o=i||0;if("dumb"===n.TERM)return o;if("win32"===process.platform){const r=e.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in n)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in n)||"codeship"===n.CI_NAME?1:o;if("TEAMCITY_VERSION"in n)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION)?1:0;if("truecolor"===n.COLORTERM)return 3;if("TERM_PROGRAM"in n){const e=parseInt((n.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(n.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM)||"COLORTERM"in n?1:o}return t("no-color")||t("no-colors")||t("color=false")||t("color=never")?i=0:(t("color")||t("colors")||t("color=true")||t("color=always"))&&(i=1),"FORCE_COLOR"in n&&(i="true"===n.FORCE_COLOR?1:"false"===n.FORCE_COLOR?0:0===n.FORCE_COLOR.length?1:Math.min(parseInt(n.FORCE_COLOR,10),3)),u={supportsColor:function(e){return c(a(e,e&&e.isTTY))},stdout:c(a(!0,r.isatty(1))),stderr:c(a(!0,r.isatty(2)))}}();e&&(e.stderr||e).level>=2&&(r.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}r.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,r)=>{const t=r.substring(6).toLowerCase().replace(/_([a-z])/g,(e,r)=>r.toUpperCase());let s=process.env[r];return s=!!/^(yes|on|true|enabled)$/i.test(s)||!/^(no|off|false|disabled)$/i.test(s)&&("null"===s?null:Number(s)),e[t]=s,e},{}),e.exports=(m||(m=1,d=function(e){function r(e){let s,n,o,i=null;function c(...e){if(!c.enabled)return;const t=c,n=Number(new Date),o=n-(s||n);t.diff=o,t.prev=s,t.curr=n,s=n,e[0]=r.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(s,n)=>{if("%%"===s)return"%";i++;const o=r.formatters[n];if("function"==typeof o){const r=e[i];s=o.call(t,r),e.splice(i,1),i--}return s}),r.formatArgs.call(t,e),(t.log||r.log).apply(t,e)}return c.namespace=e,c.useColors=r.useColors(),c.color=r.selectColor(e),c.extend=t,c.destroy=r.destroy,Object.defineProperty(c,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(n!==r.namespaces&&(n=r.namespaces,o=r.enabled(e)),o),set:e=>{i=e}}),"function"==typeof r.init&&r.init(c),c}function t(e,t){const s=r(this.namespace+(void 0===t?":":t)+e);return s.log=this.log,s}function s(e,r){let t=0,s=0,n=-1,o=0;for(;t<e.length;)if(s<r.length&&(r[s]===e[t]||"*"===r[s]))"*"===r[s]?(n=s,o=t,s++):(t++,s++);else{if(-1===n)return!1;s=n+1,o++,t=o}for(;s<r.length&&"*"===r[s];)s++;return s===r.length}return r.debug=r,r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){const e=[...r.names,...r.skips.map(e=>"-"+e)].join(",");return r.enable(""),e},r.enable=function(e){r.save(e),r.namespaces=e,r.names=[],r.skips=[];const t=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of t)"-"===e[0]?r.skips.push(e.slice(1)):r.names.push(e)},r.enabled=function(e){for(const t of r.skips)if(s(e,t))return!1;for(const t of r.names)if(s(e,t))return!0;return!1},r.humanize=b(),r.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(t=>{r[t]=e[t]}),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return r.colors[Math.abs(t)%r.colors.length]},r.enable(r.load()),r}),d)(r);const{formatters:c}=e.exports;c.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},c.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)}}(g,g.exports)),g.exports}var C=(O||(O=1,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?i.exports=r?e:(r=1,e={}):i.exports=v()),i.exports),R=t.getDefaultExportFromCjs(C);module.exports=R;
|
package/lib/errors.d.ts
CHANGED
|
@@ -33,6 +33,10 @@ export declare enum ErrorCode {
|
|
|
33
33
|
ComponentUnrecognized = "component-unrecognized",
|
|
34
34
|
ComponentInvalidNoName = "component-invalid-no-name",
|
|
35
35
|
RunScriptNotFound = "run-script-not-found",
|
|
36
|
+
AddNameRequired = "add-name-required",
|
|
37
|
+
AddInvalidName = "add-invalid-name",
|
|
38
|
+
AddUnsupportedType = "add-unsupported-type",
|
|
39
|
+
AddSourceExists = "add-source-exists",
|
|
36
40
|
NewNameRequired = "new-name-required",
|
|
37
41
|
NewTargetRequired = "new-target-required",
|
|
38
42
|
NewDirExists = "new-dir-exists",
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";var e=require("./installer-C0iBwEpK.js"),t=require("./transform-target-DJmqMjY0.js"),r=require("./project-DFh-2QTw.js");require("assert"),require("fs");var a=require("./export-target-CEupP86g.js");exports.exportProject=async function(o={}){e.env.reporter.log(e.Message.ExportProjectLoading,"[1/3] Loading project...");const i=await r.loadProject();if(!o.target&&!i.manifest.target)throw new e.CliError(e.ErrorCode.ExportNoTarget,e.dedent`
|
|
2
|
+
No default target found for project,
|
|
3
|
+
use --target TYPE to export from a specific target.
|
|
4
|
+
`);let n,s=!1;if(i.manifest.target)o.target&&o.target!==i.manifest.target.type||(n=i.manifest.target);else{const t=o.target,r=i.manifest.name;n={type:t,name:r,path:`targets/${t}`,filename:`${e.sanitize(r)}.${t}`},s=!0}if(!n)throw new e.CliError(e.ErrorCode.ExportNoMatching,`No matching target found for type "${o.target}" in project.`);const p=await r.fetchDependencies(i);let g;try{o.completed?g=o.completed:(g=e.join(i.paths.staging,"export"),e.env.reporter.log(e.Message.ExportToStaging,`\n[2/3] Exporting src from "${n.filename}"`),await e.mkdirsExports.ensureDir(g),await e.emptyExports.emptyDir(g),await t.exportTo(i,n,g,o)),e.env.reporter.log(e.Message.ExportToProject,"\n[3/3] Updating project"),await a.exportTarget(n,{project:i,dependencies:p,blankTarget:s},g)}catch(e){throw e}finally{g&&await e.removeExports.remove(g)}};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";var e=require("./installer-C0iBwEpK.js"),n=require("./index-CB6KQLC7.js"),t=require("path"),r=require("./load-from-project-wNJg8fme.js"),o=require("./transform-target-DJmqMjY0.js");require("assert");var a=require("./project-DFh-2QTw.js");async function s(t,r){const o=e.env.reporter.progress("Updating src files"),a=o.start,s=o.done;o.start=()=>{},o.done=()=>{},a(),await e.parallel(r.components.changed,e=>i(e.details.path,e),{progress:o}),await e.parallel(r.components.added,async n=>{const r=e.join(t.paths.dir,"src",n.filename);n.details.path=r,await i(r,n)},{progress:o}),await e.parallel(r.components.removed,async n=>{await e.removeExports.remove(n.details.path)},{progress:o}),await async function(t,r){for(const n of r.components.added){const r={name:n.name,path:e.join(t.paths.dir,`src/${n.filename}`)};t.manifest.src.push(r)}for(const e of r.components.removed){const n=t.manifest.src.findIndex(n=>n.name===e.name);t.manifest.src.splice(n,1)}for(let e of r.references.added)t.manifest.references.push(e);for(const e of r.references.removed){const n=t.manifest.references.findIndex(n=>n.name===e.name);t.manifest.references.splice(n,1)}await n.writeManifest(t.manifest,t.paths.dir)}(t,r),s()}async function i(n,r){const o=t.dirname(n);if(await e.mkdirsExports.ensureDir(o),await e.writeFile(n,r.code),r.binaryPath){if(!r.details.binary)throw new Error(`Binary data missing for component "${r.name}"`);await e.writeFile(e.join(o,r.binaryPath),r.details.binary)}}const c=[".frx"];async function p(n){const a=o.walk(n,{directories:!1}).filter(e=>"project.json"!==e&&!e.startsWith("target")&&!e.startsWith("staged")&&!(e=>!(""!==t.extname(e)))(e)).map(t=>e.join(n,t)),{name:s,references:i}=await async function(n){const t=e.join(n,"project.json");if(!await e.pathExistsExports.pathExists(t))return{name:"VBAProject",references:[]};return await e.jsonfileExports.readJson(t)}(n),p={},d=a.filter(e=>{if(!function(e){return c.includes(t.extname(e))}(e))return!0;const n=m(e);return p[n]=e,!1}),f=await e.parallel(d,async n=>{const o=m(n),a=r.extensionToType[t.extname(n)],s=await e.readFile(n),i=p[o]&&await e.readFile(p[o]);if(!a)throw new e.CliError(e.ErrorCode.ComponentUnrecognized,`Unrecognized component extension "${t.extname(n)}" (at "${n}").`);return new r.Component(a,s,{binary:i})},{progress:e.env.reporter.progress("Loading exported components")});return f.sort(r.byComponentName),{name:s,components:f,references:i,fromDependencies:{components:new Map,references:new Map}}}function m(e){return t.basename(e,t.extname(e))}async function d(n,r,s){let i=e.join(n.paths.build,r.filename);const c=e.join(s,"target");if(!await e.pathExistsExports.pathExists(i))throw new e.CliError(e.ErrorCode.ExportTargetNotFound,e.dedent`
|
|
2
|
+
Could not find built target for type "${r.type}"
|
|
3
|
+
(checked "${i}").
|
|
4
|
+
`);if(!e.env.isWindows){const n=e.join(s,"staged",r.filename);await e.pathExistsExports.pathExists(n)||(await e.mkdirsExports.ensureDir(t.dirname(n)),await e.copyExports.copy(i,n)),i=n}return await e.mkdirsExports.ensureDir(c),await a.unzip(i,c,{filter:o.filterTarget,map:o.mapTarget}),c}exports.exportTarget=async function(n,t,a){const{project:i,dependencies:c,blankTarget:m}=t;let f;m||(f=await d(i,n,a));const l=await r.loadFromProject(i,c),u=await p(a),w=function(e,n){const t={components:{added:[],changed:[],removed:[]},references:{added:[],changed:[],removed:[]}},o={components:new Map,references:new Map};for(const n of e.components)o.components.set(n.name,n);for(const n of e.references)o.references.set(n.name,n);for(const r of n.components){const n=r.name,a=o.components.get(n);o.components.delete(n),a&&e.fromDependencies.components.has(a)||(a?r.code!==a.code&&(r.details.path=a.details.path,t.components.changed.push(r)):t.components.added.push(r))}for(const e of o.components.values())t.components.removed.push(e);t.components.added.sort(r.byComponentName),t.components.changed.sort(r.byComponentName),t.components.removed.sort(r.byComponentName);for(const r of n.references){const n=r.name,a=o.references.get(n);o.references.delete(n),a&&e.fromDependencies.references.has(a)||(a?r.guid===a.guid&&r.major===a.major&&r.minor===a.minor||t.references.changed.push(r):t.references.added.push(r))}for(const e of o.references.values())t.references.removed.push(e);return t}(l,await o.toSrc(u));await s(i,w),m||(await e.removeExports.remove(n.path),await e.copyExports.copy(f,n.path)),await e.removeExports.remove(a)},exports.extractTarget=d;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var t=require("./installer-
|
|
1
|
+
"use strict";var t=require("./installer-C0iBwEpK.js");exports.getTarget=function(e,r){let a,o=!1;if(r){if(e.manifest.target)e.manifest.target.type===r&&(a=e.manifest.target);else{const n=r,i=e.manifest.name;a={type:n,name:i,path:"target",filename:`${t.sanitize(i)}.${n}`},o=!0}if(!a)throw new t.CliError(t.ErrorCode.TargetNoMatching,`No matching target found for type "${r}" in project.`)}else e.manifest.target&&(a=e.manifest.target);if(!a)throw new t.CliError(t.ErrorCode.TargetNoDefault,t.dedent`
|
|
2
2
|
No default target found for project.
|
|
3
3
|
|
|
4
4
|
Use --target TYPE for a blank target
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t,r,e,n,o,i,a,f,u,y,p,c,l,s,b,g,h,d,A,m,v,P,w,S,j,O,E,F,R,U,I,B,M,_,T,x,N,G,k,D,C,W,L,V,q,J,$,H,z,Y,K,Q,X,Z,tt,rt,et,nt,ot,it,at,ft,ut,yt,pt,ct,lt,st,bt,gt,ht,dt,At,mt,vt,Pt,wt,St,jt,Ot,Et=require("./index-CEojr58e.js"),Ft=require("./_commonjsHelpers-Bjf42z7h.js");function Rt(){return n?e:(n=1,e=TypeError)}function Ut(){return i?o:(i=1,o=Object)}function It(){return f?a:(f=1,a=Error)}function Bt(){return y?u:(y=1,u=EvalError)}function Mt(){return c?p:(c=1,p=RangeError)}function _t(){return s?l:(s=1,l=ReferenceError)}function Tt(){return g?b:(g=1,b=SyntaxError)}function xt(){return d?h:(d=1,h=URIError)}function Nt(){return m?A:(m=1,A=Math.abs)}function Gt(){return P?v:(P=1,v=Math.floor)}function kt(){return S?w:(S=1,w=Math.max)}function Dt(){return O?j:(O=1,j=Math.min)}function Ct(){return F?E:(F=1,E=Math.pow)}function Wt(){return U?R:(U=1,R=Math.round)}function Lt(){return B?I:(B=1,I=Number.isNaN||function(t){return t!=t})}function Vt(){if(_)return M;_=1;var t=Lt();return M=function(r){return t(r)||0===r?r:r<0?-1:1}}function qt(){return x?T:(x=1,T=Object.getOwnPropertyDescriptor)}function Jt(){if(G)return N;G=1;var t=qt();if(t)try{t([],"length")}catch(r){t=null}return N=t}function $t(){if(D)return k;D=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(r){t=!1}return k=t}function Ht(){return W?C:(W=1,C=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},r=Symbol("test"),e=Object(r);if("string"==typeof r)return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;for(var n in t[r]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==r)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,r);if(42!==i.value||!0!==i.enumerable)return!1}return!0})}function zt(){if(V)return L;V=1;var t="undefined"!=typeof Symbol&&Symbol,r=Ht();return L=function(){return"function"==typeof t&&("function"==typeof Symbol&&("symbol"==typeof t("foo")&&("symbol"==typeof Symbol("bar")&&r())))}}function Yt(){return J?q:(J=1,q="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null)}function Kt(){return H?$:(H=1,$=Ut().getPrototypeOf||null)}function Qt(){if(Y)return z;Y=1;var t=Object.prototype.toString,r=Math.max,e=function(t,r){for(var e=[],n=0;n<t.length;n+=1)e[n]=t[n];for(var o=0;o<r.length;o+=1)e[o+t.length]=r[o];return e};return z=function(n){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,a=function(t,r){for(var e=[],n=r,o=0;n<t.length;n+=1,o+=1)e[o]=t[n];return e}(arguments,1),f=r(0,o.length-a.length),u=[],y=0;y<f;y++)u[y]="$"+y;if(i=Function("binder","return function ("+function(t,r){for(var e="",n=0;n<t.length;n+=1)e+=t[n],n+1<t.length&&(e+=r);return e}(u,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var t=o.apply(this,e(a,arguments));return Object(t)===t?t:this}return o.apply(n,e(a,arguments))}),o.prototype){var p=function(){};p.prototype=o.prototype,i.prototype=new p,p.prototype=null}return i},z}function Xt(){if(Q)return K;Q=1;var t=Qt();return K=Function.prototype.bind||t}function Zt(){return Z?X:(Z=1,X=Function.prototype.call)}function tr(){return rt?tt:(rt=1,tt=Function.prototype.apply)}function rr(){if(it)return ot;it=1;var t=Xt(),r=tr(),e=Zt(),n=nt?et:(nt=1,et="undefined"!=typeof Reflect&&Reflect&&Reflect.apply);return ot=n||t.call(e,r)}function er(){if(ft)return at;ft=1;var t=Xt(),r=Rt(),e=Zt(),n=rr();return at=function(o){if(o.length<1||"function"!=typeof o[0])throw new r("a function is required");return n(t,e,o)}}function nr(){if(yt)return ut;yt=1;var t,r=er(),e=Jt();try{t=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var n=!!t&&e&&e(Object.prototype,"__proto__"),o=Object,i=o.getPrototypeOf;return ut=n&&"function"==typeof n.get?r([n.get]):"function"==typeof i&&function(t){return i(null==t?t:o(t))}}function or(){if(ct)return pt;ct=1;var t=Yt(),r=Kt(),e=nr();return pt=t?function(r){return t(r)}:r?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return r(t)}:e?function(t){return e(t)}:null}function ir(){if(st)return lt;st=1;var t=Function.prototype.call,r=Object.prototype.hasOwnProperty,e=Xt();return lt=e.call(t,r)}function ar(){if(gt)return bt;var t;gt=1;var r=Ut(),e=It(),n=Bt(),o=Mt(),i=_t(),a=Tt(),f=Rt(),u=xt(),y=Nt(),p=Gt(),c=kt(),l=Dt(),s=Ct(),b=Wt(),g=Vt(),h=Function,d=function(t){try{return h('"use strict"; return ('+t+").constructor;")()}catch(t){}},A=Jt(),m=$t(),v=function(){throw new f},P=A?function(){try{return v}catch(t){try{return A(arguments,"callee").get}catch(t){return v}}}():v,w=zt()(),S=or(),j=Kt(),O=Yt(),E=tr(),F=Zt(),R={},U="undefined"!=typeof Uint8Array&&S?S(Uint8Array):t,I={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?t:ArrayBuffer,"%ArrayIteratorPrototype%":w&&S?S([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":R,"%AsyncGenerator%":R,"%AsyncGeneratorFunction%":R,"%AsyncIteratorPrototype%":R,"%Atomics%":"undefined"==typeof Atomics?t:Atomics,"%BigInt%":"undefined"==typeof BigInt?t:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?t:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":n,"%Float16Array%":"undefined"==typeof Float16Array?t:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?t:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?t:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?t:FinalizationRegistry,"%Function%":h,"%GeneratorFunction%":R,"%Int8Array%":"undefined"==typeof Int8Array?t:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?t:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&S?S(S([][Symbol.iterator]())):t,"%JSON%":"object"==typeof JSON?JSON:t,"%Map%":"undefined"==typeof Map?t:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&w&&S?S((new Map)[Symbol.iterator]()):t,"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":A,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?t:Promise,"%Proxy%":"undefined"==typeof Proxy?t:Proxy,"%RangeError%":o,"%ReferenceError%":i,"%Reflect%":"undefined"==typeof Reflect?t:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?t:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&w&&S?S((new Set)[Symbol.iterator]()):t,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&S?S(""[Symbol.iterator]()):t,"%Symbol%":w?Symbol:t,"%SyntaxError%":a,"%ThrowTypeError%":P,"%TypedArray%":U,"%TypeError%":f,"%Uint8Array%":"undefined"==typeof Uint8Array?t:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?t:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?t:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?t:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?t:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?t:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?t:WeakSet,"%Function.prototype.call%":F,"%Function.prototype.apply%":E,"%Object.defineProperty%":m,"%Object.getPrototypeOf%":j,"%Math.abs%":y,"%Math.floor%":p,"%Math.max%":c,"%Math.min%":l,"%Math.pow%":s,"%Math.round%":b,"%Math.sign%":g,"%Reflect.getPrototypeOf%":O};if(S)try{null.error}catch(t){var B=S(S(t));I["%Error.prototype%"]=B}var M=function t(r){var e;if("%AsyncFunction%"===r)e=d("async function () {}");else if("%GeneratorFunction%"===r)e=d("function* () {}");else if("%AsyncGeneratorFunction%"===r)e=d("async function* () {}");else if("%AsyncGenerator%"===r){var n=t("%AsyncGeneratorFunction%");n&&(e=n.prototype)}else if("%AsyncIteratorPrototype%"===r){var o=t("%AsyncGenerator%");o&&S&&(e=S(o.prototype))}return I[r]=e,e},_={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},T=Xt(),x=ir(),N=T.call(F,Array.prototype.concat),G=T.call(E,Array.prototype.splice),k=T.call(F,String.prototype.replace),D=T.call(F,String.prototype.slice),C=T.call(F,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,L=/\\(\\)?/g,V=function(t,r){var e,n=t;if(x(_,n)&&(n="%"+(e=_[n])[0]+"%"),x(I,n)){var o=I[n];if(o===R&&(o=M(n)),void 0===o&&!r)throw new f("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:e,name:n,value:o}}throw new a("intrinsic "+t+" does not exist!")};return bt=function(t,r){if("string"!=typeof t||0===t.length)throw new f("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof r)throw new f('"allowMissing" argument must be a boolean');if(null===C(/^%?[^%]*%?$/,t))throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var e=function(t){var r=D(t,0,1),e=D(t,-1);if("%"===r&&"%"!==e)throw new a("invalid intrinsic syntax, expected closing `%`");if("%"===e&&"%"!==r)throw new a("invalid intrinsic syntax, expected opening `%`");var n=[];return k(t,W,function(t,r,e,o){n[n.length]=e?k(o,L,"$1"):r||t}),n}(t),n=e.length>0?e[0]:"",o=V("%"+n+"%",r),i=o.name,u=o.value,y=!1,p=o.alias;p&&(n=p[0],G(e,N([0,1],p)));for(var c=1,l=!0;c<e.length;c+=1){var s=e[c],b=D(s,0,1),g=D(s,-1);if(('"'===b||"'"===b||"`"===b||'"'===g||"'"===g||"`"===g)&&b!==g)throw new a("property names with quotes must have matching quotes");if("constructor"!==s&&l||(y=!0),x(I,i="%"+(n+="."+s)+"%"))u=I[i];else if(null!=u){if(!(s in u)){if(!r)throw new f("base intrinsic for "+t+" exists, but the property is not available.");return}if(A&&c+1>=e.length){var h=A(u,s);u=(l=!!h)&&"get"in h&&!("originalValue"in h.get)?h.get:u[s]}else l=x(u,s),u=u[s];l&&!y&&(I[i]=u)}}return u},bt}function fr(){if(dt)return ht;dt=1;var t=ar(),r=er(),e=r([t("%String.prototype.indexOf%")]);return ht=function(n,o){var i=t(n,!!o);return"function"==typeof i&&e(n,".prototype.")>-1?r([i]):i}}function ur(){if(mt)return At;mt=1;var t,r,e=Function.prototype.toString,n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof n&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},n(function(){throw 42},null,t)}catch(t){t!==r&&(n=null)}else n=null;var o=/^\s*class\b/,i=function(t){try{var r=e.call(t);return o.test(r)}catch(t){return!1}},a=function(t){try{return!i(t)&&(e.call(t),!0)}catch(t){return!1}},f=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,y=!(0 in[,]),p=function(){return!1};if("object"==typeof document){var c=document.all;f.call(c)===f.call(document.all)&&(p=function(t){if((y||!t)&&(void 0===t||"object"==typeof t))try{var r=f.call(t);return("[object HTMLAllCollection]"===r||"[object HTML document.all class]"===r||"[object HTMLCollection]"===r||"[object Object]"===r)&&null==t("")}catch(t){}return!1})}return At=n?function(e){if(p(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{n(e,null,t)}catch(t){if(t!==r)return!1}return!i(e)&&a(e)}:function(t){if(p(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return a(t);if(i(t))return!1;var r=f.call(t);return!("[object Function]"!==r&&"[object GeneratorFunction]"!==r&&!/^\[object HTML/.test(r))&&a(t)}}function yr(){if(Pt)return vt;Pt=1;var t=ur(),r=Object.prototype.toString,e=Object.prototype.hasOwnProperty;return vt=function(n,o,i){if(!t(o))throw new TypeError("iterator must be a function");var a,f;arguments.length>=3&&(a=i),f=n,"[object Array]"===r.call(f)?function(t,r,n){for(var o=0,i=t.length;o<i;o++)e.call(t,o)&&(null==n?r(t[o],o,t):r.call(n,t[o],o,t))}(n,o,a):"string"==typeof n?function(t,r,e){for(var n=0,o=t.length;n<o;n++)null==e?r(t.charAt(n),n,t):r.call(e,t.charAt(n),n,t)}(n,o,a):function(t,r,n){for(var o in t)e.call(t,o)&&(null==n?r(t[o],o,t):r.call(n,t[o],o,t))}(n,o,a)},vt}function pr(){return St?wt:(St=1,wt=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"])}function cr(){if(Ot)return jt;Ot=1;var t=pr(),r="undefined"==typeof globalThis?Ft.commonjsGlobal:globalThis;return jt=function(){for(var e=[],n=0;n<t.length;n++)"function"==typeof r[t[n]]&&(e[e.length]=t[n]);return e}}var lr,sr,br,gr,hr,dr,Ar,mr,vr,Pr,wr,Sr,jr,Or,Er,Fr,Rr,Ur,Ir,Br={exports:{}};function Mr(){if(sr)return lr;sr=1;var t=$t(),r=Tt(),e=Rt(),n=Jt();return lr=function(o,i,a){if(!o||"object"!=typeof o&&"function"!=typeof o)throw new e("`obj` must be an object or a function`");if("string"!=typeof i&&"symbol"!=typeof i)throw new e("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new e("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new e("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new e("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new e("`loose`, if provided, must be a boolean");var f=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,y=arguments.length>5?arguments[5]:null,p=arguments.length>6&&arguments[6],c=!!n&&n(o,i);if(t)t(o,i,{configurable:null===y&&c?c.configurable:!y,enumerable:null===f&&c?c.enumerable:!f,value:a,writable:null===u&&c?c.writable:!u});else{if(!p&&(f||u||y))throw new r("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");o[i]=a}},lr}function _r(){if(gr)return br;gr=1;var t=$t(),r=function(){return!!t};return r.hasArrayLengthDefineBug=function(){if(!t)return null;try{return 1!==t([],"length",{value:1}).length}catch(t){return!0}},br=r}function Tr(){if(dr)return hr;dr=1;var t=ar(),r=Mr(),e=_r()(),n=Jt(),o=Rt(),i=t("%Math.floor%");return hr=function(t,a){if("function"!=typeof t)throw new o("`fn` is not a function");if("number"!=typeof a||a<0||a>4294967295||i(a)!==a)throw new o("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],u=!0,y=!0;if("length"in t&&n){var p=n(t,"length");p&&!p.configurable&&(u=!1),p&&!p.writable&&(y=!1)}return(u||y||!f)&&(e?r(t,"length",a,!0,!0):r(t,"length",a)),t},hr}function xr(){if(mr)return Ar;mr=1;var t=Xt(),r=tr(),e=rr();return Ar=function(){return e(t,r,arguments)},Ar}function Nr(){return vr||(vr=1,function(t){var r=Tr(),e=$t(),n=er(),o=xr();t.exports=function(t){var e=n(arguments),o=t.length-(arguments.length-1);return r(e,1+(o>0?o:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o}(Br)),Br.exports}function Gr(){if(jr)return Sr;jr=1;var t=yr(),r=cr(),e=Nr(),n=fr(),o=Jt(),i=or(),a=n("Object.prototype.toString"),f=function(){if(wr)return Pr;wr=1;var t=Ht();return Pr=function(){return t()&&!!Symbol.toStringTag}}()(),u="undefined"==typeof globalThis?Ft.commonjsGlobal:globalThis,y=r(),p=n("String.prototype.slice"),c=n("Array.prototype.indexOf",!0)||function(t,r){for(var e=0;e<t.length;e+=1)if(t[e]===r)return e;return-1},l={__proto__:null};t(y,f&&o&&i?function(t){var r=new u[t];if(Symbol.toStringTag in r&&i){var n=i(r),a=o(n,Symbol.toStringTag);if(!a&&n){var f=i(n);a=o(f,Symbol.toStringTag)}if(a&&a.get){var y=e(a.get);l["$"+t]=y}}}:function(t){var r=new u[t],n=r.slice||r.set;if(n){var o=e(n);l["$"+t]=o}});return Sr=function(r){if(!r||"object"!=typeof r)return!1;if(!f){var e=p(a(r),8,-1);return c(y,e)>-1?e:"Object"===e&&function(r){var e=!1;return t(l,function(t,n){if(!e)try{t(r),e=p(n,1)}catch(t){}}),e}(r)}return o?function(r){var e=!1;return t(l,function(t,n){if(!e)try{"$"+t(r)===n&&(e=p(n,1))}catch(t){}}),e}(r):null}}function kr(){if(Er)return Or;Er=1;var t=Gr();return Or=function(r){return!!t(r)}}function Dr(){if(Rr)return Fr;Rr=1;var t=Rt(),r=fr()("TypedArray.prototype.buffer",!0),e=kr();return Fr=r||function(r){if(!e(r))throw new t("Not a Typed Array");return r.buffer}}exports.requireToBuffer=function(){if(Ir)return Ur;Ir=1;var e=Et.requireSafeBuffer().Buffer,n=function(){if(r)return t;r=1;var e={}.toString;return t=Array.isArray||function(t){return"[object Array]"==e.call(t)}}(),o=Dr(),i=ArrayBuffer.isView||function(t){try{return o(t),!0}catch(t){return!1}},a="undefined"!=typeof Uint8Array,f="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,u=f&&(e.prototype instanceof Uint8Array||e.TYPED_ARRAY_SUPPORT);return Ur=function(t,r){if(e.isBuffer(t))return t.constructor&&!("isBuffer"in t)?e.from(t):t;if("string"==typeof t)return e.from(t,r);if(f&&i(t)){if(0===t.byteLength)return e.alloc(0);if(u){var o=e.from(t.buffer,t.byteOffset,t.byteLength);if(o.byteLength===t.byteLength)return o}var y=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),p=e.from(y);if(p.length===t.byteLength)return p}if(a&&t instanceof Uint8Array)return e.from(t);var c=n(t);if(c)for(var l=0;l<t.length;l+=1){var s=t[l];if("number"!=typeof s||s<0||s>255||~~s!==s)throw new RangeError("Array items must be numbers in the range 0-255.")}if(c||e.isBuffer(t)&&t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t))return e.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";var e=require("./installer-C0iBwEpK.js"),t=require("path");async function n(e){const{parse:t}=await Promise.resolve().then(function(){return require("./toml-patch-r8oqFm0h.js")});return t(e)}const r='Example vbaproject.toml:\n\n [dependencies]\n a = "^1.0.0"\n b = { version = "^0.1.0" }\n c = { path = "packages/c" }\n d = { git = "https://github.com/author/d" }\n e = { git = "https://github.com/author/e", branch = "next" }\n f = { git = "https://github.com/author/f", tag = "v1.0.0" }\n g = { git = "https://github.com/author/g", rev = "a1b2c3d4" }\n\n [dependencies.h]\n version = "^2.0.0"';function a(n,a){return Object.entries(n).map(([n,i])=>function(n,a,i){e.isString(a)&&(a={version:a});let{registry:s="vba-blocks",version:o,path:c,git:p,tag:u,branch:l="master",rev:m}=a;return e.manifestOk(o||c||p,`Invalid dependency <${n}>, no version, path, or git specified. \n\n${r}`),o?{name:n,registry:s,version:o}:c?{name:n,path:e.trailing(e.join(i,c))}:(p=function(e){return".git"===t.extname(e)?e:`${e}.git`}(p),m?{name:n,git:p,rev:m}:u?{name:n,git:p,tag:u}:{name:n,git:p,branch:l})}(n,i,a))}function i(t){return e.has(t,"registry")}function s(t){return e.has(t,"path")}function o(t,n){const r={};return t.forEach(t=>{if(i(t)){const{name:e,registry:n,version:a}=t;r[e]="vba-blocks"!==n?{version:a,registry:n}:a}else if(s(t)){let{name:a,path:i}=t;i=e.relative(n,i),r[a]={path:i}}else{const{name:e,git:n,tag:a,branch:i,rev:s}=t;r[e]={name:e,git:n},a&&(r[e].tag=a),i&&(r[e].branch=i),s&&(r[e].rev=s)}}),r}const c=/^(\d+)\.(\d+)$/,p=/\{.{8}-.{4}-.{4}-.{4}-.{12}\}/,u=e=>parseInt(e,10),l='Example vbaproject.toml:\n\n [references.Scripting]\n version = "1.0"\n guid = "{420B2830-E718-11CF-893D-00A0C9054228}"';function m(t){return Object.entries(t).map(([t,n])=>function(t,n){const{version:r,guid:a}=n;e.manifestOk((e=>c.test(e))(r),`Reference <${t}> has an invalid version <${r}>. \n\n${l}.`),e.manifestOk((e=>p.test(e))(a),`Reference <${t}> has an invalid guid <${a}>. \n\n${l}.`);const{major:i,minor:s}=(e=>{const[t,n]=e.split(".",2).map(u);return{major:t,minor:n}})(r);return{name:t,guid:a,major:i,minor:s}}(t,n))}function d(e){const t={};return e.forEach(e=>{const{name:n,guid:r,major:a,minor:i}=e,s=`${a}.${i}`;t[n]={version:s,guid:r}}),t}const f='Example vbaproject.toml:\n\n [src]\n A = "src/a.bas"\n B = { path = "src/b.cls" }',g=/^(bas|cls|frm|doccls)$/i;function h(t,n){return Object.entries(t).map(([t,r])=>function(t,n,r){e.isString(n)&&(n={path:n});const{path:a,binary:i}=n;if(!a){const r=Object.keys(n).find(e=>g.test(e));r&&e.manifestOk(!1,e.dedent`
|
|
2
|
+
src key <${t}.${r}> should not include the file extension.
|
|
3
|
+
You want to use a <${t}> instead.
|
|
4
|
+
`)}e.manifestOk(a,`src <${t}> is missing path. \n\n${f}`);const s=e.join(r,a),o={name:t,path:s};i&&(o.binary=e.join(r,i));return o}(t,r,n))}function v(t,n){const r={};return t.forEach(t=>{let{name:a,path:i}=t;i=e.relative(n,i),r[a]=i}),r}const j=["xlsx","xlsm","xlam"];function b(t,n,r){e.isString(t)&&(t={type:t}),e.has(t,"name")||(t={name:n,...t});const{type:a,name:i,path:s="target"}=t;e.manifestOk(e.isString(a),'Target is missing <type>. \n\nExample vbaproject.toml:\n\n [project]\n target = "xlsm"\n\nExample vbaproject.toml with alternative path:\n\n [project]\n target = { type = "xlsm", path = "target/xlsm" }.'),e.manifestOk(function(t){return e.isString(t)&&j.includes(t)}(a),`Unsupported target type <${a}>. Only <xlsx>, <xlsm>, and <xlam> are supported currently.`);return{name:i,type:a,path:e.join(r,s),filename:`${e.sanitize(i)}.${a}`}}const y="UNVERSIONED",$='Example vbaproject.toml for a package (e.g. library to be shared):\n\n [package]\n name = "my-package"\n version = "0.0.0"\n authors = ["..."]\n\nExample vbaproject.toml for a project (e.g. workbook, document, etc.):\n\n [project]\n name = "my-project"\n target = "xlsm"';function x(t,n){let r,i,s,o,c,p;e.manifestOk(t&&(t.package||t.project),`A [package] or [project] section is required. \n\n${$}`),t.project?(r="project",i=t.project.name,s=t.project.version||y,o=t.project.authors,e.manifestOk(i,`[project] name is a required field. \n\n${$}`),e.manifestOk(t.project.target,`[project] target is a required field. \n\n${$}`),p=b(t.project.target,i,n)):(r="package",i=t.package.name,s=t.package.version,o=t.package.authors,c=t.package.publish,e.manifestOk(i,`[package] name is a required field. \n\n${$}`),e.manifestOk(s,`[package] version is a required field. \n\n${$}`),e.manifestOk(o,`[package] authors is a required field. \n\n${$}`),p=t.package.target&&b(t.package.target,i,n));return{type:r,name:i,version:s,metadata:{authors:o,publish:c},src:h(t.src||{},n),dependencies:a(t.dependencies||{},n),references:m(t.references||{}),devSrc:h(t["dev-src"]||{},n),devDependencies:a(t["dev-dependencies"]||{},n),devReferences:m(t["dev-references"]||{}),target:p}}exports.isGitDependency=function(t){return e.has(t,"git")},exports.isPathDependency=s,exports.isRegistryDependency=i,exports.loadManifest=async function(t){let r=e.join(t,"vbaproject.toml");if(!await e.pathExistsExports.pathExists(r)){const n=e.join(t,"vba-block.toml");if(!await e.pathExistsExports.pathExists(n))throw new e.CliError(e.ErrorCode.ManifestNotFound,e.dedent`
|
|
5
|
+
vbaproject.toml not found in "${t}".
|
|
6
|
+
|
|
7
|
+
Try "vbapm init" to start a new project in this directory
|
|
8
|
+
or "cd YOUR_PROJECTS_DIRECTORY" to change to a folder that contains an existing project.
|
|
9
|
+
`);r=n}const a=await e.readFile(r);let i;try{i=await n(a.toString())}catch(t){throw new e.CliError(e.ErrorCode.ManifestInvalid,e.dedent`
|
|
10
|
+
vbaproject.toml is invalid:
|
|
11
|
+
|
|
12
|
+
Syntax Error: ${r} (${null==t?void 0:t.line}:${null==t?void 0:t.column})\n\n${(null==t?void 0:t.message)||t}
|
|
13
|
+
`)}return x(i,e.normalize(t))},exports.parse=n,exports.parseManifest=x,exports.toLockfile=function t(n,r=0){if(e.isString(n))return`"${n}"`;if(e.isNumber(n))return`${n}`;if(e.isBoolean(n))return n?"true":"false";if(e.isDate(n))return n.toISOString();if(e.isObject(n)){let e="";if(0===r)for(const[a,i]of Object.entries(n))Array.isArray(i)?i.forEach(n=>{e+=`[[${a}]]\n${t(n,r+1)}\n`}):e+=`[${a}]\n${t(i,r+1)}\n`;else if(1===r)for(const[a,i]of Object.entries(n))if(Array.isArray(i)){const n=0===i.length;e+=`${a} = [\n`,e+=i.map(e=>` ${t(e,r+1)}`).join(",\n"),e+=n?"]\n":",\n]\n"}else e+=`${a} = ${t(i,r+1)}\n`;return e}throw new Error("Unsupported type passed to toLockfile. Only String, Number, Boolean, Date, Array, and Object are supported")},exports.writeManifest=async function(t,n){const r=function(t,n){const{type:r,name:a,version:i,metadata:{authors:s,publish:c,...p}}=t,u={name:a};i!==y&&(u.version=i);null!=s&&(u.authors=s);null!=c&&(u.publish=c);Object.assign(u,p);const l={[r]:u};t.target&&(l[r].target=function(t,n,r){let a,{name:i,type:s,path:o}=t;return o=e.relative(r,o),i!==n||"target"!==o?(a={type:s},i!==n&&(a.name=i),"target"!==o&&(a.path=o)):a=s,a}(t.target,t.name,n));l.src=v(t.src,n),t.dependencies.length&&(l.dependencies=o(t.dependencies,n));t.references.length&&(l.references=d(t.references));t.devSrc.length&&(l["dev-src"]=v(t.devSrc,n));t.devDependencies.length&&(l["dev-dependencies"]=o(t.devDependencies,n));t.devReferences.length&&(l["dev-references"]=d(t.devReferences));return l}(t,n),a=e.join(n,"vbaproject.toml");let i;if(await e.pathExistsExports.pathExists(a)){const t=await e.readFile(a,"utf8");i=await async function(e,t){const{patch:n}=await Promise.resolve().then(function(){return require("./toml-patch-r8oqFm0h.js")});return n(e,t)}(t,r)}else i=await async function(e){const{stringify:t}=await Promise.resolve().then(function(){return require("./toml-patch-r8oqFm0h.js")});return t(e)}(r);await e.writeFile(a,i)};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var r,e,t=require("buffer"),o={exports:{}},n={exports:{}};var u,f={exports:{}};
|
|
2
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */exports.requireInherits=function(){if(e)return o.exports;e=1;try{var t=require("util");if("function"!=typeof t.inherits)throw"";o.exports=t.inherits}catch(e){o.exports=(r||(r=1,"function"==typeof Object.create?n.exports=function(r,e){e&&(r.super_=e,r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:n.exports=function(r,e){if(e){r.super_=e;var t=function(){};t.prototype=e.prototype,r.prototype=new t,r.prototype.constructor=r}}),n.exports)}return o.exports},exports.requireSafeBuffer=function(){return u||(u=1,function(r,e){var o=t,n=o.Buffer;function u(r,e){for(var t in r)e[t]=r[t]}function f(r,e,t){return n(r,e,t)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?r.exports=o:(u(o,e),e.Buffer=f),f.prototype=Object.create(n.prototype),u(n,f),f.from=function(r,e,t){if("number"==typeof r)throw new TypeError("Argument must not be a number");return n(r,e,t)},f.alloc=function(r,e,t){if("number"!=typeof r)throw new TypeError("Argument must be a number");var o=n(r);return void 0!==e?"string"==typeof t?o.fill(e,t):o.fill(e):o.fill(0),o},f.allocUnsafe=function(r){if("number"!=typeof r)throw new TypeError("Argument must be a number");return n(r)},f.allocUnsafeSlow=function(r){if("number"!=typeof r)throw new TypeError("Argument must be a number");return o.SlowBuffer(r)}}(f,f.exports)),f.exports};
|