vbapm 0.6.12 → 0.6.14
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 +26 -0
- package/addins/build/vbapm.xlam +0 -0
- package/lib/{build-project-59d26ffa.js → build-project-eb8454f0.js} +2 -2
- package/lib/{build-target-d6327f6f.js → build-target-dbcc69c7.js} +1 -1
- package/lib/create-project-3154aace.js +10 -0
- package/lib/{export-project-59836888.js → export-project-bc13c1ae.js} +1 -1
- package/lib/{export-target-902b2548.js → export-target-5d28d188.js} +2 -2
- package/lib/{get-target-cf4af796.js → get-target-e760a439.js} +1 -1
- package/lib/{index-4386ff9f.js → index-ddd39b65.js} +1 -1
- package/lib/index.js +1 -1
- package/lib/init-project-ceecd718.js +15 -0
- package/lib/{installer-2f42d28c.js → installer-dbc2c34a.js} +1 -1
- package/lib/{load-from-project-6be3cab9.js → load-from-project-acf7400a.js} +1 -1
- package/lib/{project-d784a14d.js → project-43370ed3.js} +3 -3
- package/lib/{run-macro-c5a7bb2d.js → run-macro-4f1375ca.js} +1 -1
- package/lib/{sat-solver-01db5ebc.js → sat-solver-f9155891.js} +1 -1
- package/lib/test-project-669dfcfb.js +1 -0
- package/lib/{vbapm-build-8e2c88c7.js → vbapm-build-8ff58485.js} +1 -1
- package/lib/{vbapm-export-af350c94.js → vbapm-export-96798f4f.js} +1 -1
- package/lib/{vbapm-init-131ea380.js → vbapm-init-5c8eb026.js} +1 -1
- package/lib/{vbapm-new-e3409051.js → vbapm-new-cd174cbb.js} +2 -2
- package/lib/{vbapm-run-795f5167.js → vbapm-run-2f17fb22.js} +1 -1
- package/lib/{vbapm-test-dc8aad3b.js → vbapm-test-a7b30592.js} +1 -1
- package/lib/{vbapm-version-3b5a838c.js → vbapm-version-c5f3d55a.js} +1 -1
- package/lib/vbapm.js +3 -3
- package/lib/{workbook-xml-5b96eac5.js → workbook-xml-a61269f4.js} +1 -1
- package/package.json +1 -1
- package/lib/create-project-0813adf7.js +0 -10
- package/lib/init-project-74a9b860.js +0 -15
- package/lib/test-project-b0a5536b.js +0 -1
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./installer-2f42d28c.js"),t=require("./project-d784a14d.js"),i=require("./workbook-xml-5b96eac5.js"),r=require("./build-target-d6327f6f.js"),a=require("./export-target-902b2548.js"),o=require("path");exports.initProject=async function(n){let{name:s,dir:p=e.env.cwd,target:c,from:d,pkg:m,git:l}=n;if(await e.pathExists_1.pathExists(e.join(p,"vbaproject.toml")))throw new e.CliError(e.ErrorCode.InitAlreadyInitialized,"A vbapm project already exists in this directory.");if(d&&!await e.pathExists_1.pathExists(d))throw new e.CliError(e.ErrorCode.FromNotFound,`The "from" document was not found at "${d}".`);if(s=s||(d?o.basename(d,o.extname(d)):o.basename(p)),!s)throw new e.CliError(e.ErrorCode.InitNameRequired,e.dedent`
|
|
2
|
-
Unable to determine name from current directory or --from.
|
|
3
|
-
--name NAME is required to initialize this project.
|
|
4
|
-
`);if(!c&&!d&&s.includes(".")){const e=s.split(".");c=e.pop(),s=e.join(".")}if(!m&&!c&&!d)throw new e.CliError(e.ErrorCode.InitTargetRequired,e.dedent`
|
|
5
|
-
--target or --from is required for vbapm projects.
|
|
6
|
-
(e.g. vbapm init --target xlsm)
|
|
7
|
-
`);await e.mkdirs_1.ensureDir(e.join(p,"src")),l&&!await e.pathExists_1.pathExists(e.join(p,".git"))&&(await t.init(p),await e.writeFile(e.join(p,".gitignore"),"/build"),await e.writeFile(e.join(p,".gitattributes"),"* text=auto\n*.bas text eol=crlf\n*.cls text eol=crlf"),await e.writeFile(e.join(p,".editorconfig"),e.dedent`
|
|
8
|
-
[*]
|
|
9
|
-
trim_trailing_whitespace = true
|
|
10
|
-
insert_final_newline = true
|
|
11
|
-
charset = utf-8
|
|
12
|
-
|
|
13
|
-
[*.{bas,cls}]
|
|
14
|
-
end_of_line = crlf
|
|
15
|
-
`));const f=await t.initProject(s,p,{type:m?"package":"project"});if(d&&(c=o.extname(d).replace(".","")),c){const n=[];await async function(n,s,p={}){const{project:c}=s;let{from:d,name:m=c.manifest.name,path:l="target"}=p;if(c.manifest.target)throw new e.CliError(e.ErrorCode.TargetAlreadyDefined,"A target is already defined for this project.");const f=e.join(c.paths.staging,"export");await e.mkdirs_1.ensureDir(f),await e.empty.emptyDir(f);try{let p;if(d)d=e.resolve(d),m=o.basename(d,o.extname(d)),p=c.manifest.target={name:m,type:n,path:e.join(c.paths.dir,l),filename:`${e.sanitize(m)}.${n}`},await e.copy.copy(d,e.join(c.paths.build,p.filename)),await i.exportTo(c,p,f),await a.exportTarget(p,s,f);else{p=c.manifest.target={name:m,type:n,path:e.join(c.paths.dir,l),filename:`${e.sanitize(m)}.${n}`},await i.createDocument(c,p);const t=await a.extractTarget(c,p,f);await e.remove.remove(p.path),await e.copy.copy(t,p.path),await r.buildTarget(p,s)}await t.writeManifest(c.manifest,c.paths.dir)}catch(e){throw e}finally{await e.remove.remove(f)}}(c,{project:f,dependencies:n},{from:d})}await t.writeManifest(f.manifest,f.paths.dir)};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var r=require("./installer-2f42d28c.js"),t=require("./run-macro-c5a7bb2d.js");exports.testProject=async function(s){const{target:e,args:a}=s,c=r.env.isWindows?"CON":"/dev/stdout";await t.runMacro({target:e,macro:"Tests.Run",args:[c,...a]})};
|