@tochii/build 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{b as t}from"./chunk-SOF474NV.mjs";import{defineConfig as n}from"tsup";var p={Utils:t,defineConfigTsup:n,defineConfig:o,defineConfigIndexEntries:i,defineConfigCommonEntrie:r};function o(...e){return n(t.defaultOptions(...e))}function i(...e){return n(t.defaultOptionsIndexEntries(...e))}function r(...e){return n(t.defaultOptionsCommonEntries(...e))}export{n as a,p as b,o as c,i as d,r as e};
1
+ import{b as t}from"./chunk-QFYOHOZF.mjs";import{defineConfig as n}from"tsup";var p={Utils:t,defineConfigTsup:n,defineConfig:o,defineConfigIndexEntries:i,defineConfigCommonEntrie:r};function o(...e){return n(t.defaultOptions(...e))}function i(...e){return n(t.defaultOptionsIndexEntries(...e))}function r(...e){return n(t.defaultOptionsCommonEntries(...e))}export{n as a,p as b,o as c,i as d,r as e};
@@ -0,0 +1 @@
1
+ var t=class t{};t.ignoredEntries=["!node_modules","!**/*/node_modules","!*.d.ts","!**/*/*.d.ts","!tsup.config*","!**/*/tsup.config*"],t.entriesCommon=["*.js","*.ts","**/*/*.js","**/*/*.ts"],t.entriesIndex=["index.js","index.ts","**/*/index.js","**/*/index.ts"],t.defaultEntriesIndex=[...t.entriesIndex,...t.ignoredEntries],t.defaultEntriesCommon=[...t.entriesCommon,...t.ignoredEntries],t.defaultOptions=n=>({tsconfig:"tsconfig.json",dts:!0,format:["esm"],minify:!0,...n,entry:r(n.entry,"ignoredEntries")}),t.defaultOptionsIndexEntries=n=>({entry:r(n.entry,"defaultEntriesIndex"),tsconfig:"tsconfig.json",dts:!0,format:["esm"],minify:!0,...n}),t.defaultOptionsCommonEntries=n=>({entry:r(n.entry,"defaultEntriesCommon"),tsconfig:"tsconfig.json",dts:!0,format:["esm"],minify:!0,...n});var e=t,a=e;function r(i,n){if(Array.isArray(i))return[...i,...e[n]];let o={};return e[n].forEach(s=>o[s]=s),{...i,...o}}export{e as a,a as b};
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import s from"chalk";import f from"fs";import y from"path";import{Command as w}from"commander";import{spawn as x}from"child_process";import{dirname as m,resolve as g}from"path";import{fileURLToPath as h}from"url";var a=g(m(h(import.meta.url)),"../node_modules/.bin/tsup");var u={name:"@tochii/build",version:"1.0.5",description:"Tools for bundling your projects in Node.js",repository:"https://github.com/tochiResources/project/packages/build.git",license:"MIT",bin:{tochibuild:"./dist/cli.mjs"},scripts:{build:"tsup-node",dev:"tsx cli.ts"},dependencies:{chalk:"^5.4.1",commander:"^13.1.0",tsup:"^8.4.0"},devDependencies:{"@tochii/build":"^1.0.1","@types/node":"^22.15.17",tsx:"^4.19.4",typescript:"^5.8.3"},engines:{node:">=18.17.0"},files:["dist"]};var v={node:"tsup-node"},k={node:a},d=s.cyan("tochibuild"),p=new w("tochibuild").name("tochibuild <command>").description("Tools for bundling your projects in Node.js").allowUnknownOption(!0).version(u.version);p.command("node").description("bundle a Node.js project using tsup (https://tsup.egoist.dev)").allowUnknownOption(!0).argument("[...args]","arguments to pass to tsup").option("-l, --local","whether to use the local tsup instead of the temporary one (defaults to false)",!1).action(async e=>T("node",e));p.command("config").description("generate config files for the selected bundler").argument("<bundler>","bundler to generate config for").option("--ext <string>","the file extension to use excluding the file extension (defaults to the common one for the bundler)","").option("-f, --file <string>","the file name to use (defaults to the common one for the bundler)","").option("-o, --overwrite","whether to overwrite the config file if it already exists (defaults to false)",!1).action((e,t)=>j(e,t));p.parseAsync(process.argv);async function T(e,t){return new Promise((r,i)=>{try{console.log(d,`running ${s.magenta(e)}...`),setTimeout(()=>{let o=x(`${k[e]}`,t,{stdio:"inherit",shell:!0,cwd:process.cwd(),env:process.env});o.on("exit",c=>{process.exit(c??1)}),process.on("SIGINT",()=>{i(),o.kill("SIGINT")}),process.on("SIGTERM",()=>{i(),o.kill("SIGTERM")}),r()},3e3)}catch(o){i(o)}})}function j(e,t){switch(v[e]){case"tsup-node":C(t);break}}function C(e){let t=process.cwd(),r=e.ext||".ts",i=e.file||"tsup.config",o=y.join(t,`${i}${r}`),c=f.existsSync(o);!e?.overwrite&&c&&(console.warn(d,s.yellow("the tsup config file already exists for this project.")),process.exit(1));let l=" ",n="";n+=`import build from '@tochii/build';
2
+ import s from"chalk";import f from"fs";import y from"path";import{Command as x}from"commander";import{spawn as w}from"child_process";import{dirname as g,resolve as m}from"path";import{fileURLToPath as h}from"url";var p=m(g(h(import.meta.url)),"../node_modules/.bin/tsup");var u={name:"@tochii/build",version:"1.0.5",description:"Tools for bundling your projects in Node.js",repository:"https://github.com/tochiResources/project/packages/build.git",license:"MIT",bin:{tochibuild:"./dist/cli.mjs"},scripts:{build:"tsup-node",dev:"tsx cli.ts"},dependencies:{chalk:"^5.4.1",commander:"^13.1.0"},devDependencies:{"@tochii/build":"^1.0.1","@types/node":"^22.15.17",tsup:"^8.4.0",tsx:"^4.19.4",typescript:"^5.8.3"},engines:{node:">=18.17.0"},files:["dist"]};var v={node:"tsup --target=node18.17"},k={node:p},d=s.cyan("tochibuild"),a=new x("tochibuild").name("tochibuild <command>").description("Tools for bundling your projects in Node.js").allowUnknownOption(!0).version(u.version);a.command("node").description("bundle a Node.js project using tsup (https://tsup.egoist.dev)").allowUnknownOption(!0).argument("[...args]","arguments to pass to tsup").option("-l, --local","whether to use the local tsup instead of the temporary one (defaults to false)",!1).action(async e=>T("node",e));a.command("config").description("generate config files for the selected bundler").argument("<bundler>","bundler to generate config for").option("--ext <string>","the file extension to use excluding the file extension (defaults to the common one for the bundler)","").option("-f, --file <string>","the file name to use (defaults to the common one for the bundler)","").option("-o, --overwrite","whether to overwrite the config file if it already exists (defaults to false)",!1).action((e,t)=>j(e,t));a.parseAsync(process.argv);async function T(e,t){return new Promise((r,i)=>{try{console.log(d,`running ${s.magenta(e)}...`),setTimeout(()=>{let o=w("npx",[`${k[e]}`,...t],{stdio:"inherit",shell:!0,cwd:process.cwd(),env:process.env});o.on("exit",c=>{process.exit(c??1)}),process.on("SIGINT",()=>{i(),o.kill("SIGINT")}),process.on("SIGTERM",()=>{i(),o.kill("SIGTERM")}),r()},3e3)}catch(o){i(o)}})}function j(e,t){switch(v[e]){case"tsup --target=node18.17":C(t);break}}function C(e){let t=process.cwd(),r=e.ext||".ts",i=e.file||"tsup.config",o=y.join(t,`${i}${r}`),c=f.existsSync(o);!e?.overwrite&&c&&(console.warn(d,s.yellow("the tsup config file already exists for this project.")),process.exit(1));let l=" ",n="";n+=`import build from '@tochii/build';
3
3
 
4
4
  `,n+=`export default build.node.defineConfig({
5
5
  `,n+=`${l}entry: ['index.ts'],
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{b as o}from"./chunk-VMOULNHQ.mjs";import"./chunk-SOF474NV.mjs";var r={node:o};export{r as default,o as node};
1
+ import{b as o}from"./chunk-LTYPVCKJ.mjs";import"./chunk-QFYOHOZF.mjs";var r={node:o};export{r as default,o as node};
@@ -1 +1 @@
1
- import{a as b,b as c,c as d,d as e,e as f}from"../chunk-VMOULNHQ.mjs";import{b as a}from"../chunk-SOF474NV.mjs";export{a as Utils,c as default,d as defineConfig,f as defineConfigCommonEntrie,e as defineConfigIndexEntries,b as defineConfigTsup};
1
+ import{a as b,b as c,c as d,d as e,e as f}from"../chunk-LTYPVCKJ.mjs";import{b as a}from"../chunk-QFYOHOZF.mjs";export{a as Utils,c as default,d as defineConfig,f as defineConfigCommonEntrie,e as defineConfigIndexEntries,b as defineConfigTsup};
@@ -1 +1 @@
1
- import{a,b}from"../chunk-SOF474NV.mjs";export{a as NodeBundlerUtils,b as default};
1
+ import{a,b}from"../chunk-QFYOHOZF.mjs";export{a as NodeBundlerUtils,b as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tochii/build",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Tools for bundling your projects in Node.js",
5
5
  "repository": "https://github.com/tochiResources/project/packages/build.git",
6
6
  "license": "MIT",
@@ -13,12 +13,12 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "chalk": "^5.4.1",
16
- "commander": "^13.1.0",
17
- "tsup": "^8.4.0"
16
+ "commander": "^13.1.0"
18
17
  },
19
18
  "devDependencies": {
20
19
  "@tochii/build": "^1.0.1",
21
20
  "@types/node": "^22.15.17",
21
+ "tsup": "^8.4.0",
22
22
  "tsx": "^4.19.4",
23
23
  "typescript": "^5.8.3"
24
24
  },
@@ -1 +0,0 @@
1
- var e=class n{static{this.ignoredEntries=["!node_modules","!**/*/node_modules","!*.d.ts","!**/*/*.d.ts","!tsup.config*","!**/*/tsup.config*"]}static{this.entriesCommon=["*.js","*.ts","**/*/*.js","**/*/*.ts"]}static{this.entriesIndex=["index.js","index.ts","**/*/index.js","**/*/index.ts"]}static{this.defaultEntriesIndex=[...n.entriesIndex,...n.ignoredEntries]}static{this.defaultEntriesCommon=[...n.entriesCommon,...n.ignoredEntries]}static{this.defaultOptions=t=>({tsconfig:"tsconfig.json",dts:!0,format:["esm"],minify:!0,...t,entry:s(t.entry,"ignoredEntries")})}static{this.defaultOptionsIndexEntries=t=>({entry:s(t.entry,"defaultEntriesIndex"),tsconfig:"tsconfig.json",dts:!0,format:["esm"],minify:!0,...t})}static{this.defaultOptionsCommonEntries=t=>({entry:s(t.entry,"defaultEntriesCommon"),tsconfig:"tsconfig.json",dts:!0,format:["esm"],minify:!0,...t})}},o=e;function s(n,t){if(Array.isArray(n))return[...n,...e[t]];let r={};return e[t].forEach(i=>r[i]=i),{...n,...r}}export{e as a,o as b};