-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip: implicit src * add more tests * spec change & more tests * all tests for JS are now passed * refactor config * minify by filename convention * wip rewrite * rename parsedConfig -> context * fix typo * more test * wip: build command and expand context module more * wip * build bundle and files * add tsconfig tests * set declaration=true as default * wip: types entries * added failing tests for typescript * types entry for conditional exports * fix broken tests * validate types entry extension * validate types entry format * validate types entry order * entry tests all passed * warn if module for dts isn't determined * update browserslist * entries on different rootDir, outDir * fix context parsing * allow rootDir=outDir in TypeScript project * refactor * Node v16 requirement * build script * format messages * support bin entry * state: self-hosting binary * prepare major release
- Loading branch information
Showing
47 changed files
with
6,461 additions
and
1,570 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"nanobundle": major | ||
--- | ||
|
||
v1 features | ||
|
||
- support multiple entries | ||
- support nested conditional exports | ||
- source inference from rootDir and outDir | ||
- enable tree-shaking by default | ||
- pretty reporter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
.yarn/** linguist-vendored | ||
.yarn/releases/* binary linguist-vendored | ||
|
||
*.typegen.ts linguist-generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
node_modules/ | ||
coverage/ | ||
|
||
/bin.mjs | ||
/bin.min.mjs | ||
|
||
.yarn/* | ||
!.yarn/patches | ||
|
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import esbuild from 'esbuild'; | ||
import manifest from './package.json' assert { type: 'json' }; | ||
|
||
esbuild.build({ | ||
entryPoints: ['src/bin.ts'], | ||
outfile: 'bin.min.mjs', | ||
bundle: true, | ||
write: true, | ||
treeShaking: true, | ||
sourcemap: false, | ||
minify: true, | ||
format: 'esm', | ||
platform: 'node', | ||
target: ['node16'], | ||
external: Object.keys(manifest.dependencies), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Vitest Snapshot v1 | ||
|
||
exports[`parseConfig > flags > rootDir=outDir 1`] = `"Directory rootDir(.) and outDir(.) are conflict! Please specify different directory for one of them."`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Vitest Snapshot v1 | ||
|
||
exports[`parseConfig > flags > rootDir=outDir is not allowed without TypeScript 1`] = ` | ||
"\\"rootDir\\" (.) and \\"outDir\\" (.) are conflict! | ||
Please specify different directory for one of them." | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Vitest Snapshot v1 | ||
|
||
exports[`getEntriesFromContext > bin entry only accepts js 1`] = `"Only JavaScript files are allowed for bin entry."`; | ||
|
||
exports[`getEntriesFromContext > throw if "main" and "module" is on conflict 1`] = ` | ||
"Hint: Did you forgot to set \\"type\\" to 'module' for ESM-first approach? | ||
" | ||
`; | ||
|
||
exports[`getEntriesFromContext - in TypeScript project > types entry does not accept nesting 1`] = ` | ||
"\\"types\\" entry must be .d.ts file and cannot be nested! | ||
" | ||
`; | ||
|
||
exports[`getEntriesFromContext - in TypeScript project > types entry must has .d.ts extension 1`] = `"Only .d.ts or .d.cts or .d.mts allowed for \\"types\\" entry."`; | ||
|
||
exports[`getEntriesFromContext - in TypeScript project > types entry must occur first in conditional exports 1`] = ` | ||
"\\"types\\" entry must occur first in conditional exports for correct type resolution. | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.