@tochii/build 1.1.1 → 2.0.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 CHANGED
@@ -1,94 +1,9 @@
1
1
  # @tochii/build
2
2
 
3
- Provides a CLI and utilities for bundling your projects optionally with **no config** in Node.js with extended features like **configuration file** generation.
3
+ Go to [tochibuild](https://www.npmjs.com/package/tochibuild) for documentation.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
8
  npm i -save-dev @tochii/build
9
- ```
10
-
11
- ## Why make this?
12
-
13
- I once permanently deleted my entire project when attempting to build a single file with the output directory as my project directory, and I hadn't pushed my progress to github for more than 1 week (no need to tell me...) which almost resulted in despair. I forgot to uncheck the `clean` option that cleans the entire output directory before the build process begins.
14
-
15
- How did I forgot to uncheck that critical option? Well my project had multiple config files for different purposes, so I just copied an existing config file instead of manually creating a new one.
16
-
17
- Luckily I was able to get my files back by building a script [@tochii/vscode-file-recovery](https://www.npmjs.com/package/@tochii/vscode-file-recovery) to restore the entire project while maintaining the folder structure.
18
-
19
- I wished that there were a safer way to define the options in a bundler config file, so I created some utilities with typesafety that requires the developer to be more aware of critical options such as the `clean` option.
20
-
21
- Other than that, the utilities eliminates redundant actions such as:
22
- - Manually creating a config file for each project/package/file to be built.
23
- - Removes the need to copy/paste an existing config file and will automatically disable critical options that could lead to unwanted results.
24
-
25
- ## Utilities
26
-
27
- #### NodeBundlerUtils
28
-
29
- This class provides several utilities when using the `node` bundler such as:
30
- - Only bundle entry files (eg. index.js|ts)
31
- - Automatically bundle common files (eg. any files ending with .js or .ts)
32
- - Ignore commonly ignored files and folders (eg. node_modules, .d.ts definition files)
33
- - And more...
34
-
35
- ## CLI Usage
36
-
37
- You can use the CLI by running the following command:
38
-
39
- ```bash
40
- tochibuild <command>
41
- ```
42
-
43
- ### Commands
44
-
45
- #### node
46
-
47
- ```bash
48
- tochibuild node [...args]
49
- ```
50
-
51
- - Uses `tsup` under the hood which is powered by `esbuild`.
52
- - the passed **...args** are compatible with `tsup` (https://tsup.egoist.dev/#usage)
53
-
54
- #### config
55
-
56
- ```bash
57
- tochibuild config [options] <bundler>
58
- ```
59
-
60
- Quickly generate a configuration file for the specified bundler
61
-
62
- #### config options
63
-
64
- `--ext <string>`
65
-
66
- the file extension to use (defaults to the common one for the bundler)
67
-
68
- ```bash
69
- tochibuild config --ext .ts node
70
- ```
71
-
72
- `-f <string> or --file <string>`
73
-
74
- the file name to use excluding the file extension (defaults to the common one for the bundler)
75
-
76
- ```bash
77
- tochibuild config -f tsup.config node
78
- ```
79
-
80
- `-o or --overwrite`
81
-
82
- whether to overwrite the config file if it already exists (defaults to false)
83
-
84
- ```bash
85
- tochibuild config -o node
86
- ```
87
-
88
- ### Bundlers
89
-
90
- These are the only available bundlers for now.
91
-
92
- **node**
93
- - Uses `tsup` under the hood (https://tsup.egoist.dev) which is powered by `esbuild`.
94
- - Supports both javascript and typescript eg. `.js`, `.json`, `.mjs`, `.ts` and `.tsx`. CSS support is experimental.
9
+ ```
@@ -0,0 +1,11 @@
1
+ import g from"chalk";import f from"fs";import h from"path";import a from"chalk";var u="tochibuild",c=a.cyan(u),y=class{static{this.log=(...e)=>{console.log(c,...e)}}static{this.debug=(...e)=>{console.debug(c,...e)}}static{this.info=(...e)=>{console.info(c,...e)}}static{this.warn=(...e)=>{console.warn(c,...[...e].map(t=>a.yellow(t)))}}static{this.error=(e,...t)=>{console.error(a.red(u),a.bgRed(...t),e?.stack?`
2
+ ${a.gray(e.stack)}`:"")}}static{this.success=(...e)=>{console.log(a.green(u),...e)}}static{this.custom=(e,...t)=>{console.log(e(u),...t)}}},l=y;var d=class i{static{this.ignoredEntries=["!build","!dist","!node_modules","!**/*/node_modules","!*.d.ts","!**/*/*.d.ts","!tochibuild.*","!tsup.*","!**/*/tochibuild.*","!**/*/tsup.*"]}static{this.entriesCommon=["*.js","*.ts","**/*/*.js","**/*/*.ts"]}static{this.entriesIndex=["index.js","index.ts","**/*/index.js","**/*/index.ts"]}static{this.defaultEntriesIndex=[...i.entriesIndex,...i.ignoredEntries]}static{this.defaultEntriesCommon=[...i.entriesCommon,...i.ignoredEntries]}static{this.defaultOptions=e=>O(e,t=>({tsconfig:"tsconfig.json",dts:!0,format:["esm"],minify:!0,...t,entry:x(t.entry,"ignoredEntries")}))}static{this.defaultOptionsWithIndexEntries=e=>O(e,t=>({tsconfig:"tsconfig.json",dts:!0,format:["esm"],minify:!0,...t,entry:x(t.entry,"defaultEntriesIndex")}))}static{this.defaultOptionsWithCommonEntries=e=>O(e,t=>({tsconfig:"tsconfig.json",dts:!0,format:["esm"],minify:!0,...t,entry:x(t.entry,"defaultEntriesCommon")}))}static{this.generateConfig=$}},D=d;function O(i,e){let t=n=>Array.isArray(n)?n.map(r=>({...e(r),...r})):{...e(n),...n};if(typeof i=="function"){let n=i;async function r(s){let B=await n(s);return t(B)}return r}return t(i)}function x(i,e){if(Array.isArray(i))return[...d[e],...i];let t={};return d[e].forEach(n=>t[n]=n),{...i,...t}}function q(i){return h.isAbsolute(i||".")?i:h.resolve(process.cwd(),i)}function $(i,e,t,n){let r="";try{let s=e?.ext||".ts",b=`${e?.filename||"tochibuild.config"}${s}`;(e?.outDir?.length?e.outDir:["."]).forEach(m=>{r=q(m),f.existsSync(m)||f.mkdirSync(m,{recursive:!0});let p=h.join(r,b),C=f.existsSync(p);!e?.overwrite&&C&&(l.warn(`the config '${b}' file already exists for this project.`),n&&process.exit(1));let K=" ",o="",E={clean:!1,splitting:!0},P=R=>{o+=R==="esm"?`import build from '${i}';
3
+
4
+ `:`const build = require('${i}');
5
+
6
+ `,o+=R==="esm"?`export default build.defineConfigWithIndexEntries({
7
+ `:`module.exports = build.defineConfigWithIndexEntries({
8
+ `,Object.entries(E).forEach(([j,k])=>{o+=`${K}${j}: ${JSON.stringify(k)},
9
+ `}),o+=`});
10
+ `};switch(s){case".ts":case".js":P("esm");break;case".cjs":P("cjs");break;case".json":o+=`${JSON.stringify({...E,entry:d.defaultEntriesIndex},null,2)}
11
+ `;break;default:l.error(void 0,`unsupported extension: ${s}`),process.exit(1)}f.writeFileSync(p,o),l.custom(g.green,g.cyan("the config file has been created at:"),g.gray(p))})}catch(s){if(t)throw s;l.error(s,s.message?`failed to generate config file in ${r}: ${s.message}`:`failed to generate config file in ${r}`),n&&process.exit(1)}}export{l as a,d as b,D as c};
package/dist/cli.mjs CHANGED
@@ -1,9 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import"./chunk-2WO5THKI.mjs";import s from"chalk";import u from"fs";import m from"path";import{Command as h}from"commander";import{spawn as y}from"child_process";var p={name:"@tochii/build",version:"1.1.0",description:"CLI and utilities for bundling your projects optionally with no config in Node.js with extended features like configuration file generation",repository:"https://github.com/tochiResources/project/packages/build.git",license:"MIT",bin:{tochibuild:"./dist/cli.mjs"},scripts:{dev:"tsx cli.ts"},dependencies:{chalk:"^5.4.1",commander:"^13.1.0"},devDependencies:{"@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 f={node:"tsup --target=node18.17"},b={node:"tsup"},l=s.cyan("tochibuild"),d=new h("tochibuild").name("tochibuild <command>").description("Tools for bundling your projects in Node.js").allowUnknownOption(!0).version(p.version);d.command("node").description("bundle a Node.js project using tsup (https://tsup.egoist.dev)").allowUnknownOption(!0).argument("[args...]","arguments to pass to tsup").action(async e=>w("node",e));d.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,n)=>x(e,n));d.parseAsync(process.argv);async function w(e,n){return new Promise((r,i)=>{try{console.log(l,`bundling with ${s.magenta(e)}...`),setTimeout(()=>{let t=y("npx",["--yes",`--package=${b[e]}`,"--package=typescript",`${f[e]}`,...n],{stdio:"inherit",shell:!0,cwd:process.cwd(),env:process.env});t.on("exit",c=>{process.exit(c??1)}),process.on("SIGINT",()=>{i(),t.kill("SIGINT")}),process.on("SIGTERM",()=>{i(),t.kill("SIGTERM")}),r()},3e3)}catch(t){i(t)}})}function x(e,n){switch(f[e]){case"tsup --target=node18.17":k(n);break}}function k(e){let n=process.cwd(),r=e.ext||".ts",i=e.file||"tsup.config",t=m.join(n,`${i}${r}`),c=u.existsSync(t);!e?.overwrite&&c&&(console.warn(l,s.yellow("the tsup config file already exists for this project.")),process.exit(1));let a=" ",o="";o+=`import build from '@tochii/build';
3
-
4
- `,o+=`export default build.node.defineConfig({
5
- `,o+=`${a}entry: ['index.ts'],
6
- `,o+=`${a}clean: false,
7
- `,o+=`${a}splitting: false,
8
- `,o+=`});
9
- `,u.writeFileSync(t,o),console.log(s.green(l,"the tsup config file has been created at:"),s.gray(t))}
2
+ import{a as s,c as b}from"./chunk-LBH52VOU.mjs";import y from"chalk";import f from"fs";import u from"path";import{Command as V}from"commander";import{spawn as B}from"child_process";var P={name:"tochibuild",version:"1.2.0",description:"CLI and utilities for bundling your projects optionally with no config in Node.js with extended features like configuration file generation",repository:"https://github.com/tochiResources/project/packages/build.git",license:"MIT",bin:"./dist/cli.mjs",scripts:{dev:"tsx cli.ts",build:"tsx cli.ts --config tochibuild.config.ts --entry index.ts --entry cli.ts --entry utils.ts",publish:"npm publish --access public --no-private"},dependencies:{chalk:"^5.4.1",commander:"^13.1.0",tsup:"^8.4.0"},devDependencies:{"@types/node":"^22.15.17",tsx:"^4.19.4",typescript:"^5.8.3"},engines:{node:">=18.17.0"},files:["dist"]};var J={node:"tsup --target=node18.17"},M={node:"tsup"},$=u.resolve(process.cwd(),"."),W=$.replace(/\\/g,"/").includes("packages/build"),d=W?void 0:u.join($,"package.json"),F=d?f.existsSync(d):!1,S=d&&F?f.readFileSync(d,"utf-8"):void 0,E=S?JSON.parse(S):void 0;async function N(l){let k=process.cwd(),A=[u.join(k,"tochibuild.config.ts"),...[".ts",".js",".cjs",".json"].map(e=>u.join(k,`tsup.config${e}`))],x=E?.tochibuild,w=E?.tsup,C=!!Object.keys(x||{}).length||!!Object.keys(w||{}).length,j=C||A.some(e=>f.existsSync(e)),v=new V("tochibuild").name("tochibuild <command>").description("bundle a Node.js project powered by tsup (https://tsup.egoist.dev)").allowUnknownOption(!0).version(P.version).argument("[args...]","arguments to pass to tsup").action(async e=>O(e));v.command("config").description("generate config files").option("--ext <string>","the file extension to use excluding the file extension (defaults to .ts)",".ts").option("-f, --filename <string>","the file name to use (defaults to tochibuild.config)","tochibuild.config").option("-o, --overwrite","whether to overwrite the config file if it already exists (defaults to false)",!1).option("--outDir <string...>","the absolute/relative output directory paths to create the config files in (defaults to the working directory)").action(e=>T("node",e)),v.parseAsync(process.argv);async function O(e){return new Promise((g,a)=>{try{let r="node",o=[],c=e.includes("--config"),p=e.includes("--no-config"),h=c?e.findIndex(t=>t==="--config")+1:void 0;if(!c&&!p&&!j)s.log("no config file found, generating default config..."),b.generateConfig(l,void 0,!1,!0),o.push(...e);else if(!c&&!p&&j){if(C){let t=x||w;e.filter(n=>n.startsWith("-")).forEach(n=>{let i=e.findIndex(R=>R===n),G=n.startsWith("--")?n.slice(2):n.slice(1);if(t[G]||(o.push(n),o[i+1]?.startsWith("-")))return;let I=o[i+1];I&&o.push(I)}),Object.entries(t).forEach(([n,i])=>{typeof i=="boolean"||i==="true"||i==="false"?i&&o.push(`--${n}`):typeof i=="string"&&o.push(`--${n}`,i)}),o.push("--no-config")}}else{if(h!=null&&h>=0){let t=e[h]||"unspecified";f.existsSync(t)||(s.error(void 0,`config file '${t}' does not exist`),s.info(`try running '${y.magenta(l)} ${y.blue("config")} ${y.gray("-h")}' to get help on how to generate a config file`),process.exit(1))}o.push(...e)}s.log("running build...");let m=B("npx",["--yes",`--package=${M[r]}`,"--package=typescript@5.8.3",`${J[r]}`,...!c&&!p?["--config","tochibuild.config.ts"]:[],...o],{stdio:"inherit",shell:!0,cwd:process.cwd(),env:process.env});m.on("exit",t=>{process.exit(t??1)}),process.on("SIGINT",()=>{a(),m.kill("SIGINT")}),process.on("SIGTERM",()=>{a(),m.kill("SIGTERM")}),g()}catch(r){a(r)}})}function T(e,g){switch(J[e]){case"tsup --target=node18.17":b.generateConfig(l,g,!1,!0);break}}}N("@tochii/build");
package/dist/index.d.mts CHANGED
@@ -1,16 +1,43 @@
1
1
  import * as tsup from 'tsup';
2
- import { defineConfig, defineConfigIndexEntries, defineConfigCommonEntrie } from './node/index.mjs';
3
- export { default as node } from './node/index.mjs';
4
- import NodeBundlerUtils from './node/utils.mjs';
2
+ import { B as BuildUtils$1, c as BuildOptionsParams } from './utils-CwdN3Nrj.mjs';
5
3
 
4
+ type DefineConfigOptions = BuildOptionsParams<'entry' | 'clean' | 'splitting'>;
5
+ type DefineConfigOptionsIndexEntries = BuildOptionsParams<'clean' | 'splitting'>;
6
+ type DefineConfigOptionsCommonEntries = BuildOptionsParams<'clean' | 'splitting'>;
7
+ declare const BuildUtils: typeof BuildUtils$1;
6
8
  declare const _default: {
7
- node: {
8
- Utils: typeof NodeBundlerUtils;
9
- defineConfigTsup: (options: tsup.Options | tsup.Options[] | ((overrideOptions: tsup.Options) => tsup.Options | tsup.Options[] | Promise<tsup.Options | tsup.Options[]>)) => tsup.Options | tsup.Options[] | ((overrideOptions: tsup.Options) => tsup.Options | tsup.Options[] | Promise<tsup.Options | tsup.Options[]>);
10
- defineConfig: typeof defineConfig;
11
- defineConfigIndexEntries: typeof defineConfigIndexEntries;
12
- defineConfigCommonEntrie: typeof defineConfigCommonEntrie;
13
- };
9
+ utils: typeof BuildUtils$1;
10
+ defineConfig: typeof defineConfig;
11
+ defineConfigWithIndexEntries: typeof defineConfigWithIndexEntries;
12
+ defineConfigWithCommonEntries: typeof defineConfigWithCommonEntries;
14
13
  };
15
14
 
16
- export { _default as default };
15
+ /**
16
+ * Define tochibuild configuration
17
+ *
18
+ * See all available options here: https://www.jsdocs.io/package/tsup#Options
19
+ *
20
+ * @default '{ tsconfig: "tsconfig.json", dts: true, format: ["esm"], minify: true }'
21
+ * @param options configuration with entry, clean and splitting as required properties to avoid unintended behaviour
22
+ */
23
+ declare function defineConfig(options: DefineConfigOptions): tsup.Options | tsup.Options[] | ((overrideOptions: tsup.Options) => tsup.Options | tsup.Options[] | Promise<tsup.Options | tsup.Options[]>);
24
+ /**
25
+ * Define tochibuild configuration with index files as entry
26
+ *
27
+ * See all available options here: https://www.jsdocs.io/package/tsup#Options
28
+ *
29
+ * @default '{ entry: BuildUtils.defaultEntriesIndex, tsconfig: "tsconfig.json", dts: true, format: ["esm"], minify: true }'
30
+ * @param options configuration with clean and splitting as required properties to avoid unintended behaviour
31
+ */
32
+ declare function defineConfigWithIndexEntries(options: DefineConfigOptionsIndexEntries): tsup.Options | tsup.Options[] | ((overrideOptions: tsup.Options) => tsup.Options | tsup.Options[] | Promise<tsup.Options | tsup.Options[]>);
33
+ /**
34
+ * Define tochibuild configuration with common files as entry
35
+ *
36
+ * See all available options here: https://www.jsdocs.io/package/tsup#Options
37
+ *
38
+ * @default '{ entry: BuildUtils.defaultEntriesCommon, tsconfig: "tsconfig.json", dts: true, format: ["esm"], minify: true }'
39
+ * @param options configuration with clean and splitting as required properties to avoid unintended behaviour
40
+ */
41
+ declare function defineConfigWithCommonEntries(options: DefineConfigOptionsCommonEntries): tsup.Options | tsup.Options[] | ((overrideOptions: tsup.Options) => tsup.Options | tsup.Options[] | Promise<tsup.Options | tsup.Options[]>);
42
+
43
+ export { BuildUtils, type DefineConfigOptions, type DefineConfigOptionsCommonEntries, type DefineConfigOptionsIndexEntries, _default as default, defineConfig, defineConfigWithCommonEntries, defineConfigWithIndexEntries };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{b as o}from"./chunk-RJ4VK7M7.mjs";import"./chunk-SOF474NV.mjs";import"./chunk-2WO5THKI.mjs";var r={node:o};export{r as default,o as node};
1
+ import{c as n}from"./chunk-LBH52VOU.mjs";import{defineConfig as t}from"tsup";var l=n,e={utils:n,defineConfig:o,defineConfigWithIndexEntries:r,defineConfigWithCommonEntries:f};function o(i){return t(n.defaultOptions(i))}function r(i){return t(n.defaultOptionsWithIndexEntries(i))}function f(i){return t(n.defaultOptionsWithCommonEntries(i))}var a=e;export{l as BuildUtils,a as default,o as defineConfig,f as defineConfigWithCommonEntries,r as defineConfigWithIndexEntries};
@@ -0,0 +1,84 @@
1
+ import { Options } from 'tsup';
2
+
3
+ type BuildOptionsParam<RequiredKeys extends keyof Options> = WithRequired<Options, RequiredKeys> | WithRequired<Options, RequiredKeys>[];
4
+ type BuildOptionsOverrideParam<RequiredKeys extends keyof Options> = (overrideOptions: Options) => MaybePromise<BuildOptionsParam<RequiredKeys>>;
5
+ type BuildOptionsParams<RequiredKeys extends keyof Options> = BuildOptionsParam<RequiredKeys> | BuildOptionsOverrideParam<RequiredKeys>;
6
+ type ConfigResult<RequiredKeys extends keyof Options> = BuildOptionsParam<RequiredKeys> | BuildOptionsOverrideParam<RequiredKeys>;
7
+ declare class BuildUtils {
8
+ /**
9
+ * Array of commonly ignored entries
10
+ *
11
+ * @static
12
+ * @memberof BuildUtils
13
+ */
14
+ static ignoredEntries: string[];
15
+ /**
16
+ * Aray of commonly used entries
17
+ *
18
+ * @static
19
+ * @memberof BuildUtils
20
+ */
21
+ static entriesCommon: string[];
22
+ /**
23
+ * Array of index entries
24
+ *
25
+ * @static
26
+ * @memberof BuildUtils
27
+ */
28
+ static entriesIndex: string[];
29
+ /**
30
+ * Array of default entries including index files and commonly ignored entries
31
+ *
32
+ * @static
33
+ * @memberof BuildUtils
34
+ */
35
+ static defaultEntriesIndex: string[];
36
+ /**
37
+ * Array of default entries including any .ts files and commonly ignored entries
38
+ *
39
+ * @static
40
+ * @memberof BuildUtils
41
+ */
42
+ static defaultEntriesCommon: string[];
43
+ /**
44
+ * Default options
45
+ *
46
+ * See all available options here: https://www.jsdocs.io/package/tsup#Options
47
+ *
48
+ * @default '{ tsconfig: "tsconfig.json", dts: true, format: ["esm"], minify: true }'
49
+ * @param options configuration with entry, clean and splitting as required properties to avoid unintended behaviour
50
+ */
51
+ static defaultOptions: (options: BuildOptionsParams<"entry" | "clean" | "splitting">) => ConfigResult<"entry" | "clean" | "splitting">;
52
+ /**
53
+ * Default options for index files as entry
54
+ *
55
+ * See all available options here: https://www.jsdocs.io/package/tsup#Options
56
+ *
57
+ * @default '{ entry: BuildUtils.defaultEntriesIndex, tsconfig: "tsconfig.json", dts: true, format: ["esm"], minify: true }'
58
+ * @param options configuration with clean and splitting as required properties to avoid unintended behaviour
59
+ */
60
+ static defaultOptionsWithIndexEntries: (options: BuildOptionsParams<"clean" | "splitting">) => ConfigResult<"clean" | "splitting">;
61
+ /**
62
+ * Default options for common files as entry
63
+ *
64
+ * See all available options here: https://www.jsdocs.io/package/tsup#Options
65
+ *
66
+ * @default '{ entry: BuildUtils.defaultEntriesCommon, tsconfig: "tsconfig.json", dts: true, format: ["esm"], minify: true }'
67
+ * @param options configuration with clean and splitting as required properties to avoid unintended behaviour
68
+ */
69
+ static defaultOptionsWithCommonEntries: (options: BuildOptionsParams<"clean" | "splitting">) => ConfigResult<"clean" | "splitting">;
70
+ /**
71
+ * Generate a config file
72
+ *
73
+ * @param module which module to use
74
+ * @param options (optional) `GenerateConfigOptions`
75
+ * @param throwErr (optional) whether or not to throw an error if something goes wrong
76
+ * @param cli (optional) whether or not this is being called from the CLI
77
+ * @returns {void}
78
+ */
79
+ static generateConfig: typeof generateConfig;
80
+ }
81
+
82
+ declare function generateConfig(module: '@tochii/build' | 'tochibuild', options?: GenerateConfigOptions, throwErr?: boolean, cli?: boolean): void;
83
+
84
+ export { BuildUtils as B, type ConfigResult as C, type BuildOptionsParam as a, type BuildOptionsOverrideParam as b, type BuildOptionsParams as c };
@@ -0,0 +1,7 @@
1
+ import { B as BuildUtils } from './utils-CwdN3Nrj.mjs';
2
+ export { b as BuildOptionsOverrideParam, a as BuildOptionsParam, c as BuildOptionsParams, C as ConfigResult } from './utils-CwdN3Nrj.mjs';
3
+ import 'tsup';
4
+
5
+
6
+
7
+ export { BuildUtils, BuildUtils as default };
package/dist/utils.mjs ADDED
@@ -0,0 +1 @@
1
+ import{b as r,c as o}from"./chunk-LBH52VOU.mjs";var e=o;export{r as BuildUtils,e as default};
package/package.json CHANGED
@@ -1,14 +1,19 @@
1
1
  {
2
2
  "name": "@tochii/build",
3
- "version": "1.1.1",
3
+ "version": "2.0.0",
4
4
  "description": "CLI and utilities for bundling your projects optionally with no config in Node.js with extended features like configuration file generation",
5
5
  "repository": "https://github.com/tochiResources/project/packages/build.git",
6
6
  "license": "MIT",
7
- "bin": {
8
- "tochibuild": "./dist/cli.mjs"
9
- },
7
+ "bin": "./dist/cli.mjs",
10
8
  "scripts": {
11
- "dev": "tsx cli.ts"
9
+ "dev": "tsx cli.ts",
10
+ "build": "yarn build:tochibuild && yarn build:root",
11
+ "build:root": "tsx cli.ts --config ./tochibuild/tochibuild.config.ts --entry index.ts --entry cli.ts --entry utils.ts",
12
+ "build:tochibuild": "cd ./tochibuild && bun run build",
13
+ "build:publish": "yarn build && yarn publish:root && yarn publish:tochibuild",
14
+ "publish": "yarn publish:root && yarn publish:tochibuild",
15
+ "publish:root": "npm publish --access public --no-private",
16
+ "publish:tochibuild": "cd ./tochibuild && bun run publish"
12
17
  },
13
18
  "dependencies": {
14
19
  "chalk": "^5.4.1",
@@ -1 +0,0 @@
1
- var h=Object.create;var e=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(a&&(b=a(a=0)),b);var o=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),p=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},g=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of j(b))!l.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=i(b,d))||f.enumerable});return a};var q=(a,b,c)=>(c=a!=null?h(k(a)):{},g(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a)),r=a=>g(e({},"__esModule",{value:!0}),a);export{m as a,n as b,o as c,p as d,q as e,r as f};