susee 1.5.1 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright [yyyy] [name of copyright owner]
189
+ Copyright 2025 Pho Thin Maung
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -6,81 +6,196 @@
6
6
  </div>
7
7
  <!-- markdownlint-enable MD033 -->
8
8
 
9
- [![npm version](https://img.shields.io/npm/v/susee)](https://www.npmjs.com/package/susee) [![license](https://img.shields.io/npm/l/susee)](LICENSE) [![Socket Badge](https://badge.socket.dev/npm/package/susee/1.0.1)](https://badge.socket.dev/npm/package/susee/1.0.1) [![codecov](https://codecov.io/gh/phothinmg/susee/graph/badge.svg?token=6240Y3L0V1)](https://codecov.io/gh/phothinmg/susee)
9
+ [![NPM][nodei_img]][nodei_url]
10
10
 
11
- ## Overview
11
+ [![npm version][npm_v_img]][npm_v_url] [![license][license_img]](LICENSE) [![codecov][codecov_img]][codecov_url][![publish to npm][publish_npm_svg]][publish_npm][![CodeQL Advanced][code_ql_svg]][code_ql]
12
12
 
13
- Susee is a TypeScript-first bundler for library packages.
13
+ ## About
14
14
 
15
- It reads `susee.config.{ts,js,mjs}`, resolves the dependency graph for each entry,
16
- bundles sources into a single unit, then compiles output for ESM and/or CommonJS with types.
15
+ A **TypeScript-first** bundler designed specifically for **library packages** that delivers **fast builds**, **type safety**, and **modern JavaScript output** with minimal configuration.
17
16
 
18
- ## Features
17
+ ---
19
18
 
20
- - Loads config from one of:
21
- - `susee.config.ts`
22
- - `susee.config.js`
23
- - `susee.config.mjs`
24
- - Supports multiple entry points with subpath exports (`.` and `./subpath`).
25
- - Validates and type-checks dependency files before bundling.
26
- - Runs dependency, pre-process, and post-process plugins (sync or async).
27
- - Compiles to:
28
- - ESM (`.mjs`, `.d.mts`, source maps)
29
- - CommonJS (`.cjs`, `.d.cts`, source maps)
30
- - Can update `package.json` fields (`type`, `main`, `module`, `types`, `exports`) when `allowUpdatePackageJson` is enabled.
19
+ ## Key Features
31
20
 
32
- ## Current Constraints
21
+ **TypeScript-first** - Built with TypeScript for maximum type safety
33
22
 
34
- - CommonJS dependencies in the source graph are rejected by core (suggested workaround: `@suseejs/plugin-commonjs`).
35
- - JSX/TSX dependencies are currently rejected.
36
- - CLI supports only `susee` and `susee init`.
23
+ **Dual Output** - Generate both ESM and CommonJS formats automatically
24
+
25
+ **Automatic Renaming** - Handles duplicate declarations intelligently
26
+
27
+ ✅ **Fast Builds** - Optimized for library packages with minimal overhead
28
+
29
+ ✅ **Package.json Management** - Automatic updates to package.json fields based on the build results
30
+
31
+ ✅ **Plugin System** - Extend functionality with custom plugins
32
+
33
+ ✅ **CLI & Programmatic API** - Use as a CLI tool or integrate directly
34
+
35
+ ---
37
36
 
38
37
  ## Installation and Quick Start
39
38
 
40
- ### Install
39
+ ### Installation Methods
41
40
 
42
- ```sh
41
+ #### Local Development Dependency (Recommended)
42
+
43
+ Install `susee` as a development dependency in your project:
44
+
45
+ ```bash
43
46
  npm i -D susee
44
47
  ```
45
48
 
46
- ### Create a config file
49
+ This method is recommended for library projects as it ensures the bundler version is locked to the project and available for CI/CD pipelines.
47
50
 
48
- ```sh
49
- npx susee init
51
+ #### Global Installation
52
+
53
+ For system-wide availability of the `susee` CLI:
54
+
55
+ ```bash
56
+ npm install -g susee
50
57
  ```
51
58
 
52
- ### Build your first project
59
+ Global installation enables running `susee` directly from any directory without the `npx` prefix.
60
+
61
+ #### Installation Verification
62
+
63
+ After installation, verify the package is available by checking the version command:
64
+
65
+ ```bash
66
+ npx susee --version
67
+ ```
53
68
 
54
- Use the CLI:
69
+ ---
55
70
 
56
- ```sh
71
+ ### Quick Start
72
+
73
+ ### Using config file
74
+
75
+ The easiest way to start is using the built-in initialization command which generates a configuration template at your project root.This command creates a `susee.config.ts`, `susee.config.js`, or `susee.config.mjs` file.
76
+
77
+ ```bash
78
+ npx susee init
79
+ ```
80
+
81
+ Build your project by running:
82
+
83
+ ```bash
57
84
  npx susee
58
85
  ```
59
86
 
60
- Or in `package.json`:
87
+ ### Using Programmatic API
88
+
89
+ You can trigger the build process within a TypeScript/JavaScript script using the `build()` function.
90
+
91
+ ```typescript
92
+ import { build } from "susee";
93
+
94
+ await build({
95
+ entryPoints: [
96
+ {
97
+ entry: "src/index.ts",
98
+ exportPath: ".",
99
+ format: ["esm", "commonjs"],
100
+ renameDuplicates: true,
101
+ },
102
+ ],
103
+ outDir: "dist",
104
+ allowUpdatePackageJson: true,
105
+ });
106
+ ```
61
107
 
62
- ```json
63
- {
64
- "scripts": {
65
- "build": "susee"
66
- }
67
- }
108
+ ### Using CLI (Direct Build)
109
+
110
+ Build a single entry directly without a config file.This method uses default values for options not explicitly provided.
111
+
112
+ ```bash
113
+ npx susee build src/index.ts --outdir dist --format esm
68
114
  ```
69
115
 
70
- ## Config Reference
116
+ ### Contributor Setup (Repository)
71
117
 
72
- `SuSeeConfig`
118
+ When contributing to this repository, use `npm` to keep installs aligned with `package-lock.json` and npm-based scripts.
73
119
 
74
- ```ts
75
- interface SuSeeConfig {
76
- entryPoints: EntryPoint[];
77
- outDir?: string; // default: "dist"
78
- plugins?: (SuseePlugin | SuseePluginFunction)[]; // default: []
79
- allowUpdatePackageJson?: boolean; // default: false
80
- }
120
+ ```bash
121
+ npm install
122
+ npm run hooks:install
81
123
  ```
82
124
 
83
- `EntryPoint`
125
+ This installs project dependencies and configures local git hooks for commit workflow checks.
126
+
127
+ ---
128
+
129
+ ## Security
130
+
131
+ Please report vulnerabilities privately and follow the disclosure process in [SECURITY.md](./SECURITY.md).
132
+
133
+ Do not open public issues for security reports.
134
+
135
+ ---
136
+
137
+ ## API Quick Reference
138
+
139
+ | Surface | Command / API | Purpose | Defaults |
140
+ | ------------ | -------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
141
+ | Programmatic | `build(options?)` | Build from provided options or discovered config file | Exits with code 1 when options and config are both missing |
142
+ | CLI | `susee` | Build using `susee.config.ts/js/mjs` in project root | Uses resolved config |
143
+ | CLI | `susee init` | Create config template in project root | Prompts for TypeScript project |
144
+ | CLI | `susee build <entry> [options]` | Build a single entry directly from CLI args | `--outdir dist`, `--format esm`, `--rename true`, `--allow-update false`, `--minify false`, `--warning false` |
145
+ | Config | `entryPoints[].format` | Output module format(s) | `["esm"]` |
146
+ | Config | `entryPoints[].renameDuplicates` | Rename duplicate declarations | `true` |
147
+ | Config | `entryPoints[].tsconfigFilePath` | Custom tsconfig path | `undefined` |
148
+ | Config | `entryPoints[].plugins` | Post-process plugin list | `[]` |
149
+ | Config | `outDir` | Root output directory | `"dist"` |
150
+ | Config | `allowUpdatePackageJson` | Update package fields based on output | `false` |
151
+
152
+ ---
153
+
154
+ ## CLI Usage
155
+
156
+ ```txt
157
+ Susee CLI.
158
+
159
+ Usage:
160
+ susee Build using susee.config.{ts,js,mjs}
161
+ susee init Generate susee.config.{ts,js,mjs}
162
+ susee --version | -v Check susee version
163
+ susee --help | -h Show this message
164
+ susee build <entry> [options] Build from a single entry file
165
+ ```
166
+
167
+ ### CLI Build Options
168
+
169
+ ```txt
170
+ --entry <path> Entry file (optional if provided as positional <entry>)
171
+ --outdir <path> Output directory (default: dist)
172
+ --format <cjs|commonjs|esm> Output format (default: esm)
173
+ --tsconfig <path> Custom tsconfig path
174
+ --rename[=true|false] Rename duplicate declarations (default: true)
175
+ --allow-update[=true|false] Allow package.json updates (default: false)
176
+ --minify[=true|false] Minify output (default: false)
177
+ --warning[=true|false] Enable warnings (default: false)
178
+ ```
179
+
180
+ ### CLI Examples
181
+
182
+ ```bash
183
+ npx susee build src/index.ts --outdir dist
184
+ npx susee build src/index.ts --format commonjs
185
+ npx susee build --entry src/index.ts --format esm --minify
186
+ ```
187
+
188
+ ---
189
+
190
+ ## Config File
191
+
192
+ Supported config filenames at project root:
193
+
194
+ 1. `susee.config.ts`
195
+ 2. `susee.config.js`
196
+ 3. `susee.config.mjs`
197
+
198
+ ### `SuSeeConfig` shape
84
199
 
85
200
  ```ts
86
201
  type OutputFormat = ("commonjs" | "esm")[];
@@ -89,96 +204,127 @@ interface EntryPoint {
89
204
  entry: string;
90
205
  exportPath: "." | `./${string}`;
91
206
  format?: OutputFormat; // default: ["esm"]
92
- tsconfigFilePath?: string;
207
+ tsconfigFilePath?: string | undefined; // default: undefined
93
208
  renameDuplicates?: boolean; // default: true
94
- binary?: { name: string };
209
+ plugins?: unknown[]; // default: []
210
+ warning?: boolean; // default: false
211
+ }
212
+
213
+ interface SuSeeConfig {
214
+ entryPoints: EntryPoint[];
215
+ outDir?: string; // default: "dist"
216
+ allowUpdatePackageJson?: boolean; // default: false
95
217
  }
96
218
  ```
97
219
 
98
- ### Entry Validation Rules
220
+ ### Example `susee.config.ts`
99
221
 
100
- - At least one `entryPoint` is required.
101
- - Duplicate `exportPath` values are rejected.
102
- - Each `entry` file must exist.
222
+ ```ts
223
+ import type { SuSeeConfig } from "susee";
224
+
225
+ const config: SuSeeConfig = {
226
+ entryPoints: [
227
+ {
228
+ entry: "src/index.ts",
229
+ exportPath: ".",
230
+ format: ["esm", "commonjs"],
231
+ },
232
+ ],
233
+ outDir: "dist",
234
+ allowUpdatePackageJson: false,
235
+ };
236
+
237
+ export default config;
238
+ ```
103
239
 
104
- ### TypeScript Options Behavior
240
+ ## Programmatic API
105
241
 
106
- For each entry point, Susee builds compiler options from:
242
+ ### `build(options?)`
107
243
 
108
- 1. `tsconfigFilePath` (if provided)
109
- 2. project `tsconfig.json`
110
- 3. Susee defaults
244
+ Signature:
111
245
 
112
- Susee enforces/adjusts key options internally:
246
+ ```ts
247
+ function build(options?: SuSeeConfig): Promise<void>;
248
+ ```
113
249
 
114
- - `moduleResolution: "NodeNext"`
115
- - `allowJs: true`
116
- - `outDir` set per entry output path
117
- - `types` includes `node`
118
- - `lib` includes `ESNext`
250
+ Parameters:
119
251
 
120
- ## Plugin Hooks
252
+ 1. `options` (optional): Build options passed directly from code.
121
253
 
122
- Susee supports these plugin stages:
254
+ Returns:
123
255
 
124
- - `dependency`
125
- - receives resolved dependency files and compiler options
126
- - transforms dependency metadata/content before bundling
127
- - `pre-process`
128
- - receives bundled code before compilation
129
- - `post-process`
130
- - receives emitted JS output content per file
256
+ 1. `Promise<void>` that resolves when compilation completes.
131
257
 
132
- Both sync and async plugins are supported.
258
+ Runtime behavior:
133
259
 
134
- ## Output Behavior
260
+ 1. If `options` is provided, Susee builds from that object.
261
+ 2. If `options` is omitted, Susee tries to load config from project root.
262
+ 3. If both are missing, Susee logs an error and exits with code `1`.
135
263
 
136
- - `format: ["esm"]`
137
- - emits `.mjs` and `.d.mts`
138
- - `format: ["commonjs"]`
139
- - emits `.cjs` and `.d.cts`
140
- - `format: ["esm", "commonjs"]`
141
- - emits both sets
264
+ ```ts
265
+ import { build, type SuSeeConfig } from "susee";
266
+
267
+ const options: SuSeeConfig = {
268
+ entryPoints: [
269
+ {
270
+ entry: "src/index.ts",
271
+ exportPath: ".",
272
+ format: ["esm", "commonjs"],
273
+ },
274
+ ],
275
+ };
276
+
277
+ await build(options);
278
+ ```
142
279
 
143
- When `allowUpdatePackageJson` is `true`, Susee can update:
280
+ ## Output Notes
144
281
 
145
- - `type` (forced to `module`)
146
- - `main`
147
- - `module`
148
- - `types`
149
- - `exports` (including subpath exports from `exportPath`)
282
+ For an entry like `src/index.ts` with both formats enabled, output includes:
150
283
 
151
- ## CLI
284
+ 1. ESM: `dist/index.mjs`
285
+ 2. CommonJS: `dist/index.cjs`
286
+ 3. Sourcemaps: `.mjs.map` and `.cjs.map`
152
287
 
153
- ```bash
154
- susee
155
- susee init
156
- ```
288
+ Declaration files are emitted by the compiler when available.
289
+
290
+ ## Build Output Matrix
157
291
 
158
- Any other argument combination exits with an error.
292
+ | Input | Output Directory Rule | ESM Files | CommonJS Files |
293
+ | -------------------------------------------- | --------------------- | ------------------------------------------- | ------------------------------------------- |
294
+ | `entry: "src/index.ts"`, `exportPath: "."` | `<outDir>` | `index.mjs`, `index.mjs.map`, `index.d.mts` | `index.cjs`, `index.cjs.map`, `index.d.cts` |
295
+ | `entry: "src/foo.ts"`, `exportPath: "./foo"` | `<outDir>/foo` | `foo.mjs`, `foo.mjs.map`, `foo.d.mts` | `foo.cjs`, `foo.cjs.map`, `foo.d.cts` |
159
296
 
160
- ## Local Development
297
+ Notes:
161
298
 
162
- Common project scripts:
299
+ 1. Default `outDir` is `dist` when not set.
300
+ 2. For subpath exports, output directory is computed as `outDir + exportPath.slice(1)`.
301
+ 3. Declarations (`.d.mts` / `.d.cts`) are emitted when provided by the underlying compiler result.
163
302
 
164
- ```bash
165
- npm run build
166
- npm run test
167
- npm run lint
168
- npm run fmt
169
- npm run hooks:install
170
- ```
303
+ ## Package.json Update Matrix
304
+
305
+ When `allowUpdatePackageJson` (config) or `--allow-update` (CLI build) is enabled, Susee can update package fields.
306
+
307
+ | Context | Condition | Updated Fields | Observed Result |
308
+ | -------------------- | --------------------------------------------- | --------------------------- | ----------------------------------------------------------- |
309
+ | Main export build | `exportPath: "."` with ESM + CommonJS outputs | `main`, `module` | `main: "dist/index.cjs"`, `module: "dist/index.mjs"` |
310
+ | Main export build | `exportPath: "."` with declarations | `types` | Set from generated CommonJS declaration path when available |
311
+ | Subpath export build | `exportPath: "./foo"` | `exports` (subpath mapping) | Currently remains `{}` in tested behavior |
171
312
 
172
313
  Notes:
173
314
 
174
- - `npm run test` opens an interactive selector (`scripts/susee-tests.ts`).
175
- - Git hooks are tracked in `.githooks` and installed via `npm run hooks:install`.
315
+ 1. Package update requires a `package.json` file in the project root.
316
+ 2. With update disabled, package fields are left unchanged.
317
+ 3. Existing tests in this repo currently assert `exports` remains `{}` for the tested update flows.
176
318
 
177
- ## Contributing
319
+ ## Validation Rules
178
320
 
179
- Contributions are welcome for bug fixes, features, documentation, and code quality improvements.
321
+ From config validation logic:
180
322
 
181
- See detail in [CONTRIBUTING.md][file-contribute]
323
+ 1. At least one `entryPoints` item is required.
324
+ 2. Duplicate `exportPath` values are rejected.
325
+ 3. Each `entry` path must exist.
326
+
327
+ Violations print an error and exit with code `1`.
182
328
 
183
329
  ## License
184
330
 
@@ -189,3 +335,22 @@ See detail in [CONTRIBUTING.md][file-contribute]
189
335
  [license]: LICENSE
190
336
  [file-contribute]: CONTRIBUTING.md
191
337
  [ptm]: https://github.com/phothinmg
338
+
339
+ <!-- Need to update version -->
340
+
341
+ [sb_img]: https://badge.socket.dev/npm/package/susee/1.5.2
342
+ [sb_url]: https://badge.socket.dev/npm/package/susee/1.5.2
343
+
344
+ <!-- -->
345
+
346
+ [codecov_img]: https://codecov.io/gh/phothinmg/susee/graph/badge.svg?token=6240Y3L0V1
347
+ [codecov_url]: https://codecov.io/gh/phothinmg/susee
348
+ [nodei_img]: https://nodei.co/npm/susee.svg?color=red
349
+ [nodei_url]: https://nodei.co/npm/susee/
350
+ [npm_v_img]: https://img.shields.io/npm/v/susee
351
+ [npm_v_url]: https://www.npmjs.com/package/susee
352
+ [license_img]: https://img.shields.io/npm/l/susee
353
+ [publish_npm]: https://github.com/phothinmg/susee/actions/workflows/npm-publish.yml
354
+ [publish_npm_svg]: https://github.com/phothinmg/susee/actions/workflows/npm-publish.yml/badge.svg?event=release
355
+ [code_ql]: https://github.com/phothinmg/susee/actions/workflows/codeql.yml
356
+ [code_ql_svg]: https://github.com/phothinmg/susee/actions/workflows/codeql.yml/badge.svg
package/bin/susee ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ import("../dist/bin/index.mjs");
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import fs from"node:fs";import path from"node:path";import process from"node:process";import readline from"node:readline/promises";import tcolor from"@suseejs/color";import ts from"typescript";import{bundler}from"@suseejs/bundler";import{files}from"@suseejs/files";import{getCompilerOptions}from"@suseejs/tsoptions";import{suseeCompiler}from"@suseejs/compiler";import{suseeTerser}from"@suseejs/terser-plugin";const __jsonModule__package={name:"susee",version:"1.5.3",description:"TypeScript-first bundler for library packages",type:"module",main:"dist/index.cjs",types:"dist/index.d.cts",module:"dist/index.mjs",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},bin:{susee:"bin/susee"},scripts:{build:"tsx build.ts",lint:"biome check src --write",fmt:"biome format --write",test:"tsx --test __tests__/test-suites/**/*.test.ts",coverage:"tsx __tests__/lcov/index.ts","hooks:install":"bash scripts/install-hooks.sh","lint:test":"biome check tests --write",commit:"bash scripts/commit.sh","v:patch":"npm version patch --no-git-tag-version","v:minor":"npm version minor --no-git-tag-version","v:major":"npm version major --no-git-tag-version","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","docs:preview":"vitepress preview docs"},keywords:["bundler","susee","suseejs"],author:{name:"Pho Thin Mg",email:"phothinmg@disroot.org",url:"https://phothinmg.github.io/"},license:"Apache-2.0",files:["package.json","README.md","LICENSE","dist/**/*","bin/**/*"],publishConfig:{provenance:!0,access:"public"},repository:{url:"git+https://github.com/phothinmg/susee.git",type:"git"},homepage:"https://github.com/phothinmg/susee#readme",bugs:{url:"https://github.com/phothinmg/susee/issues"},dependencies:{"@suseejs/bundler":"^0.0.4","@suseejs/color":"^0.0.4","@suseejs/compiler":"^0.0.4","@suseejs/files":"^0.0.4","@suseejs/terser-plugin":"^0.0.4","@suseejs/tsoptions":"^0.0.4","@suseejs/type":"^0.0.4","@suseejs/utilities":"^0.0.4",typescript:"^6.0.2"},devDependencies:{"@biomejs/biome":"^2.4.12","@suseejs/banner-text-plugin":"^0.0.4","@types/node":"^25.6.0",tsx:"^4.21.0",vitepress:"^2.0.0-alpha.17","vitepress-plugin-group-icons":"^1.7.5"}},getConfigPath=()=>{const e=["susee.config.ts","susee.config.js","susee.config.mjs"];let t;for(const s of e){const e=ts.sys.resolvePath(s);if(ts.sys.fileExists(e)){t=e;break}}return t};function checkEntries(e){e.length<1&&(console.error(tcolor.magenta("No entry found in susee.config file or build options, at least one entry required")),ts.sys.exit(1));const t={},s=[];for(const i of e){const e=i.exportPath;t[e]?s.push(`"${e}"`):t[e]=!0}s.length>0&&(console.error(tcolor.magenta(`Duplicate export paths/path (${s.join(",")}) found in your susee.config file or build options , that will error for bundled output`)),ts.sys.exit(1));for(const t of e)ts.sys.fileExists(ts.sys.resolvePath(t.entry))||(console.error(tcolor.magenta(`Entry file ${t.entry} dose not exists.`)),ts.sys.exit(1))}function generateBuildOptions(e){const t=e.outDir??"dist",s=[];checkEntries(e.entryPoints);for(const i of e.entryPoints){const e=i.entry,o=i.exportPath,n=i.tsconfigFilePath??void 0,a=i.format?[...new Set(i.format)]:["esm"],r=i.warning??!1,l=i.renameDuplicates??!0,c=i.plugins??[],p="."===i.exportPath?t:`${t}${i.exportPath.slice(1)}`;s.push({entry:e,exportPath:o,format:a,tsconfigFilePath:n,rename:l,plugins:c,warning:r,outputDirectoryPath:p})}return{buildEntryPoints:s,updatePackage:e.allowUpdatePackageJson??!1,outDir:t}}async function finalSuseeConfig(){const e=getConfigPath();if(e){return generateBuildOptions((await import(e)).default)}}class Compiler{_files;_object;constructor(e){this._object=e,this._files={commonjs:void 0,commonjsTypes:void 0,esm:void 0,esmTypes:void 0,main:void 0,module:void 0,types:void 0}}_update(){return this._object.updatePackage}async _commonjs(e){const t="."===e.exportPath,s=getCompilerOptions(e.tsconfigFilePath).commonjs(e.outputDirectoryPath),i=await bundler(e.entry,e.plugins,e.warning,e.rename),o=suseeCompiler({sourceCode:i,fileName:e.entry,compilerOptions:s});let n=o.code;const a=files.joinPath(o.out_dir,`${o.file_name}.cjs`),r=files.joinPath(o.out_dir,`${o.file_name}.d.cts`),l=files.joinPath(o.out_dir,`${o.file_name}.cjs.map`);if(n=n.replace(new RegExp(`${o.file_name}.js.map`,"gm"),`${o.file_name}.cjs.map`),e.plugins.length>0)for(const t of e.plugins){const s="function"==typeof t?t():t;"post-process"===s.type&&(n=s.async?await s.func(n,e.entry):s.func(n,e.entry))}this._update()&&(this._files.commonjs=a,o.dts&&(this._files.commonjsTypes=r),t&&e.format.includes("commonjs")&&(this._files.commonjs&&(this._files.main=this._files.commonjs),this._files.commonjsTypes&&(this._files.types=this._files.commonjsTypes))),await files.writeFile(a,n),o.dts&&await files.writeFile(r,o.dts),o.map&&await files.writeFile(l,o.map)}async _esm(e){const t="."===e.exportPath,s=getCompilerOptions(e.tsconfigFilePath).esm(e.outputDirectoryPath),i=await bundler(e.entry,e.plugins,e.warning,e.rename),o=suseeCompiler({sourceCode:i,fileName:e.entry,compilerOptions:s});let n=o.code;const a=files.joinPath(o.out_dir,`${o.file_name}.mjs`),r=files.joinPath(o.out_dir,`${o.file_name}.d.mts`),l=files.joinPath(o.out_dir,`${o.file_name}.mjs.map`);if(n=n.replace(new RegExp(`${o.file_name}.js.map`,"gm"),`${o.file_name}.mjs.map`),e.plugins.length>0)for(const t of e.plugins){const s="function"==typeof t?t():t;"post-process"===s.type&&(n=s.async?await s.func(n,e.entry):s.func(n,e.entry))}this._update()&&(this._files.esm=a,o.dts&&(this._files.esmTypes=r),t&&this._files.esm&&(this._files.module=this._files.esm)),await files.writeFile(a,n),o.dts&&await files.writeFile(r,o.dts),o.map&&await files.writeFile(l,o.map)}async compile(){await files.clearFolder(this._object.outDir);for(const e of this._object.buildEntryPoints)for(const t of e.format)switch(t){case"commonjs":await this._commonjs(e),this._update()&&files.writePackageJson(this._files,e.exportPath);break;case"esm":await this._esm(e),this._update()&&files.writePackageJson(this._files,e.exportPath)}}}async function cliBuild(){console.time(tcolor.cyan("[Build] "));const e=await finalSuseeConfig();e||(console.error(tcolor.magenta('No susee.config file ("susee.config.ts", "susee.config.js", "susee.config.mjs") found')),ts.sys.exit(1));const t=new Compiler(e);await t.compile(),console.timeEnd(tcolor.cyan("[Build] "))}function fail(e){console.error(`${tcolor.magenta("[Error]")} : ${tcolor.gray(e)}`),process.exit(1)}function isFile(e){return[".js",".ts",".mts",".mjs",".cjs",".cts"].includes(path.extname(e))}function isEmptyObject(e){return"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length}function parseBooleanFlag(e,t){return"true"===t||"false"!==t&&void fail(`Type of ${e} must be boolean.`)}function parseArgs(e){const t={entry:""};for(let s=0;s<e.length;s+=1){const i=e[s];if(0===s&&!i.startsWith("--")&&isFile(i)){t.entry=i;continue}const[o,n]=i.split("=",2),a=e[s+1],r=n??a;switch(o){case"--entry":r&&!r.startsWith("--")||fail("Entry point required."),""!==t.entry&&isFile(t.entry)&&fail("Entry point already exists."),t.entry=r,void 0===n&&(s+=1);break;case"--outdir":r&&!r.startsWith("--")||fail("Output directory required."),t.outDir=r,void 0===n&&(s+=1);break;case"--format":"cjs"!==r&&"commonjs"!==r&&"esm"!==r&&fail("Format must be cjs, commonjs, or esm."),t.format="cjs"===r?"commonjs":r,void 0===n&&(s+=1);break;case"--tsconfig":r&&!r.startsWith("--")||fail("Tsconfig path required."),t.tsconfig=r,void 0===n&&(s+=1);break;case"--rename":void 0!==n?t.rename=parseBooleanFlag("rename",n):"true"===a||"false"===a?(t.rename=parseBooleanFlag("rename",a),s+=1):t.rename=!0;break;case"--allow-update":void 0!==n?t.allowUpdate=parseBooleanFlag("allow update",n):"true"===a||"false"===a?(t.allowUpdate=parseBooleanFlag("allow update",a),s+=1):t.allowUpdate=!0;break;case"--minify":void 0!==n?t.minify=parseBooleanFlag("minify",n):"true"===a||"false"===a?(t.minify=parseBooleanFlag("minify",a),s+=1):t.minify=!0;break;case"--warning":void 0!==n?t.warning=parseBooleanFlag("warning",n):"true"===a||"false"===a?(t.warning=parseBooleanFlag("warning",a),s+=1):t.warning=!0}}return(isEmptyObject(t)||""===t.entry)&&fail("Entry point required"),t}function getDefaultOptions(e){return{entry:e.entry,outDir:e.outDir??"dist",format:e.format??"esm",tsconfig:e.tsconfig??void 0,rename:e.rename??!0,allowUpdate:e.allowUpdate??!1,minify:e.minify??!1,warning:e.warning??!1,plugins:[]}}class CliCompiler{_files;_update;constructor(){this._files={commonjs:void 0,commonjsTypes:void 0,esm:void 0,esmTypes:void 0,main:void 0,module:void 0,types:void 0},this._update=!1}async _commonjs(e){this._update=e.allowUpdate;const t=getCompilerOptions(e.tsconfig).commonjs(e.outDir),s=await bundler(e.entry,e.plugins,e.warning,e.rename),i=suseeCompiler({sourceCode:s,fileName:e.entry,compilerOptions:t});let o=i.code;const n=files.joinPath(i.out_dir,`${i.file_name}.cjs`),a=files.joinPath(i.out_dir,`${i.file_name}.d.cts`),r=files.joinPath(i.out_dir,`${i.file_name}.cjs.map`);if(o=o.replace(new RegExp(`${i.file_name}.js.map`,"gm"),`${i.file_name}.cjs.map`),e.minify&&(e.plugins=[suseeTerser,...e.plugins],e.plugins=[...new Set(e.plugins)]),e.plugins.length>0)for(const t of e.plugins){const s="function"==typeof t?t():t;"post-process"===s.type&&(o=s.async?await s.func(o,e.entry):s.func(o,e.entry))}this._update&&(this._files.commonjs=n,i.dts&&(this._files.commonjsTypes=a),e.format.includes("commonjs")&&(this._files.commonjs&&(this._files.main=this._files.commonjs),this._files.commonjsTypes&&(this._files.types=this._files.commonjsTypes))),await files.writeFile(n,o),i.dts&&await files.writeFile(a,i.dts),i.map&&await files.writeFile(r,i.map)}async _esm(e){this._update=e.allowUpdate;const t=getCompilerOptions(e.tsconfig).esm(e.outDir),s=await bundler(e.entry,e.plugins,e.warning,e.rename),i=suseeCompiler({sourceCode:s,fileName:e.entry,compilerOptions:t});let o=i.code;const n=files.joinPath(i.out_dir,`${i.file_name}.mjs`),a=files.joinPath(i.out_dir,`${i.file_name}.d.mts`),r=files.joinPath(i.out_dir,`${i.file_name}.mjs.map`);if(o=o.replace(new RegExp(`${i.file_name}.js.map`,"gm"),`${i.file_name}.mjs.map`),e.minify&&(e.plugins=[suseeTerser,...e.plugins],e.plugins=[...new Set(e.plugins)]),e.plugins.length>0)for(const t of e.plugins){const s="function"==typeof t?t():t;"post-process"===s.type&&(o=s.async?await s.func(o,e.entry):s.func(o,e.entry))}this._update&&(this._files.esm=n,i.dts&&(this._files.esmTypes=a),this._files.esm&&(this._files.module=this._files.esm)),await files.writeFile(n,o),i.dts&&await files.writeFile(a,i.dts),i.map&&await files.writeFile(r,i.map)}async compile(e){switch(await files.clearFolder(e.outDir),e.format){case"commonjs":await this._commonjs(e),this._update&&files.writePackageJson(this._files,".");break;case"esm":await this._esm(e),this._update&&files.writePackageJson(this._files,".")}}}const cliCompiler=new CliCompiler;function printHelp(){console.log("Susee CLI.\n\nUsage:\n susee Build using susee.config.{ts,js,mjs}\n susee init Generate susee.config.{ts,js,mjs}\n susee --help Show this message\n susee build <entry> [options] Build from a single entry file\n\nOptions:\n --entry <path> Entry file (optional if provided as positional <entry>)\n --outdir <path> Output directory\n --format <cjs|commonjs|esm> Output module format\n --tsconfig <path> Custom tsconfig path\n --rename[=true|false] Enable/disable renaming\n --allow-update[=true|false] Enable/disable dependency update\n --minify[=true|false] Enable/disable minification\n\nExamples:\n susee build src/index.ts --outdir dist\n susee build src/index.ts --format commonjs\n susee build --entry src/index.ts --format esm --minify\n \n")}const tsFileText='\nimport type { SuSeeConfig } from "susee";\n\nconst config: SuSeeConfig = {\n // Array of entry point objects.\n // ----------------------------\n entryPoints: [\n // You can add more entry points for different export paths.\n // NOTE: duplicate export paths are not allowed.\n // --------------------------------------------\n {\n // (required) Entry file path.\n entry: "src/index.ts", // replace with your entry file\n // (required) Export path for this entry.\n exportPath: ".", // "." stands for the main export path and can be set to "./foo", "./bar", etc.\n // (optional) Output module formats ["commonjs"] or ["esm", "commonjs"], default: ["esm"].\n // Uncomment the following line to edit.\n //format: ["esm"],\n // (optional) Rename duplicate declarations, default: true.\n // Uncomment the following line to edit.\n //renameDuplicates: true,\n // (optional) Custom tsconfig.json path, default: undefined.\n // Uncomment the following line to edit.\n //tsconfigFilePath: undefined,\n // (optional) Array of susee plugins, default: [].\n // Uncomment the following line to edit.\n //plugins: [],\n // (optional) Warning messages, if it true and warning message exist(1), default: false.\n // Uncomment the following line to edit.\n //warning: false,\n },\n ],\n // NOTE: the following options apply to all entry points.\n // ----------------------------------------------------------\n // (optional) Output directory, default: dist.\n // Uncomment the following line to edit.\n //outDir: "dist",\n // (optional) Allow susee to update your package.json, default: false.\n // Uncomment the following line to edit.\n //allowUpdatePackageJson: false,\n};\n\nexport default config;\n'.trim(),jsFileText='\n/**\n * @type {import("susee").SuSeeConfig}\n */\nconst config = {\n // Array of entry point objects.\n // ----------------------------\n entryPoints: [\n // You can add more entry points for different export paths.\n // NOTE: duplicate export paths are not allowed.\n // --------------------------------------------\n {\n // (required) Entry file path.\n entry: "src/index.ts", // replace with your entry file\n // (required) Export path for this entry.\n exportPath: ".", // "." stands for the main export path and can be set to "./foo", "./bar", etc.\n // (optional) Output module formats ["commonjs"] or ["esm", "commonjs"], default: ["esm"].\n // Uncomment the following line to edit.\n //format: ["esm"],\n // (optional) Rename duplicate declarations, default: true.\n // Uncomment the following line to edit.\n //renameDuplicates: true,\n // (optional) Custom tsconfig.json path, default: undefined.\n // Uncomment the following line to edit.\n //tsconfigFilePath: undefined,\n // (optional) Array of susee plugins, default: [].\n // Uncomment the following line to edit.\n //plugins: [],\n // (optional) Warning messages, if it true and warning message exist(1), default: false.\n // Uncomment the following line to edit.\n //warning: false,\n },\n ],\n // NOTE: the following options apply to all entry points.\n // ----------------------------------------------------------\n // (optional) Output directory, default: dist.\n // Uncomment the following line to edit.\n //outDir: "dist",\n // (optional) Allow susee to update your package.json, default: false.\n // Uncomment the following line to edit.\n //allowUpdatePackageJson: false,\n};\n\nexport default config;\n'.trim();async function getPackageType(){const e=path.resolve(process.cwd(),"package.json"),t=await fs.promises.readFile(e,"utf8");JSON.parse(t);return"module"===__jsonModule__package.type?"esm":"commonjs"}async function cliInit(){const e=readline.createInterface({input:process.stdin,output:process.stdout});console.log(`${tcolor.gray("┌")} ${tcolor.green("Welcome to Susee!")}`),console.log(""),console.log(`${tcolor.gray("│")}`);const t=await e.question(`${tcolor.cyan("◇")} Is TypeScript Project(y/n) : `),s=!("y"!==t&&"Y"!==t&&""!==t);e.close();let i="",o="";if(s)i="susee.config.ts",o=tsFileText;else{o=jsFileText;switch(await getPackageType()){case"commonjs":i="susee.config.mjs";break;case"esm":i="susee.config.js"}}const n=path.resolve(process.cwd(),i);fs.existsSync(n)&&await fs.promises.unlink(n),await fs.promises.writeFile(n,o),console.log(""),console.log(`${tcolor.gray("│")}`),console.log(""),console.info(`${tcolor.gray("└")} Done! Susee config file ${tcolor.cyan(i)} is created at project root`)}async function suseeCliBuild(){const e=process.argv.slice(2);if(0===e.length)await cliBuild();else if(1===e.length)"--version"!==e[0]&&"-v"!==e[0]||console.log(tcolor.cyan(`susee v${__jsonModule__package.version}`)),"--help"!==e[0]&&"-h"!==e[0]||printHelp(),"init"===e[0]&&await cliInit(),"build"===e[0]&&printHelp();else if(e.length>1&&"build"===e[0]&&("--help"===e[1]||"-h"===e[1]))printHelp();else if(e.length>1&&"build"===e[0]){const t=getDefaultOptions(parseArgs(e.slice(1)));await cliCompiler.compile(t)}else console.error("Unknown CLI usage"),process.exit(1)}suseeCliBuild().catch(e=>{console.error(e),process.exit(1)});
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;A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