bunup 0.8.7 → 0.8.9
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/dist/cli.js +9 -5
- package/dist/index.cjs +2 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/dist/plugins.cjs +34 -1
- package/dist/plugins.d.cts +9 -1
- package/dist/plugins.d.ts +9 -1
- package/dist/plugins.js +34 -1
- package/package.json +99 -99
package/dist/cli.js
CHANGED
|
@@ -517,9 +517,7 @@ async function newProject() {
|
|
|
517
517
|
if (useMonorepo && monorepoFirstPackageName) {
|
|
518
518
|
await replaceInFile({
|
|
519
519
|
files: path5.join(projectPath, "**/*"),
|
|
520
|
-
from: [
|
|
521
|
-
new RegExp(MONOREPO_FIRST_PACKAGE_NAME_PLACEHOLDER, "g")
|
|
522
|
-
],
|
|
520
|
+
from: [new RegExp(MONOREPO_FIRST_PACKAGE_NAME_PLACEHOLDER, "g")],
|
|
523
521
|
to: [monorepoFirstPackageName],
|
|
524
522
|
ignore: ["node_modules", "dist", "bun.lock"]
|
|
525
523
|
});
|
|
@@ -553,6 +551,11 @@ var init_new = __esm(() => {
|
|
|
553
551
|
name: "Typescript Library",
|
|
554
552
|
dir: "ts-lib",
|
|
555
553
|
monorepoDir: "ts-lib-monorepo"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
defaultName: "my-react-lib",
|
|
557
|
+
name: "React Library",
|
|
558
|
+
dir: "react-lib"
|
|
556
559
|
}
|
|
557
560
|
];
|
|
558
561
|
});
|
|
@@ -560,7 +563,7 @@ var init_new = __esm(() => {
|
|
|
560
563
|
// src/cli/index.ts
|
|
561
564
|
import { exec } from "tinyexec";
|
|
562
565
|
// package.json
|
|
563
|
-
var version = "0.8.
|
|
566
|
+
var version = "0.8.9";
|
|
564
567
|
|
|
565
568
|
// src/cli/index.ts
|
|
566
569
|
init_errors();
|
|
@@ -1136,7 +1139,8 @@ async function build(partialOptions, rootDir = process.cwd()) {
|
|
|
1136
1139
|
await Promise.all(dtsPromises);
|
|
1137
1140
|
}
|
|
1138
1141
|
await runPluginBuildDoneHooks(bunupPlugins, options, buildOutput, {
|
|
1139
|
-
packageJson
|
|
1142
|
+
packageJson,
|
|
1143
|
+
rootDir
|
|
1140
1144
|
});
|
|
1141
1145
|
if (options.onSuccess) {
|
|
1142
1146
|
await options.onSuccess(options);
|
package/dist/index.cjs
CHANGED
|
@@ -668,7 +668,8 @@ async function build(partialOptions, rootDir = process.cwd()) {
|
|
|
668
668
|
await Promise.all(dtsPromises);
|
|
669
669
|
}
|
|
670
670
|
await runPluginBuildDoneHooks(bunupPlugins, options, buildOutput, {
|
|
671
|
-
packageJson
|
|
671
|
+
packageJson,
|
|
672
|
+
rootDir
|
|
672
673
|
});
|
|
673
674
|
if (options.onSuccess) {
|
|
674
675
|
await options.onSuccess(options);
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -635,7 +635,8 @@ async function build(partialOptions, rootDir = process.cwd()) {
|
|
|
635
635
|
await Promise.all(dtsPromises);
|
|
636
636
|
}
|
|
637
637
|
await runPluginBuildDoneHooks(bunupPlugins, options, buildOutput, {
|
|
638
|
-
packageJson
|
|
638
|
+
packageJson,
|
|
639
|
+
rootDir
|
|
639
640
|
});
|
|
640
641
|
if (options.onSuccess) {
|
|
641
642
|
await options.onSuccess(options);
|
package/dist/plugins.cjs
CHANGED
|
@@ -118,7 +118,8 @@ __export(exports_built_in, {
|
|
|
118
118
|
report: () => report,
|
|
119
119
|
injectStyles: () => injectStyles,
|
|
120
120
|
filterJsDtsFiles: () => filterJsDtsFiles,
|
|
121
|
-
exports: () => exports2
|
|
121
|
+
exports: () => exports2,
|
|
122
|
+
copy: () => copy
|
|
122
123
|
});
|
|
123
124
|
module.exports = __toCommonJS(exports_built_in);
|
|
124
125
|
|
|
@@ -635,4 +636,36 @@ function injectStyles(options) {
|
|
|
635
636
|
}
|
|
636
637
|
};
|
|
637
638
|
}
|
|
639
|
+
// src/plugins/built-in/productivity/copy.ts
|
|
640
|
+
var import_promises = require("fs/promises");
|
|
641
|
+
var import_node_path3 = require("path");
|
|
642
|
+
function copy(patterns, outDir) {
|
|
643
|
+
return {
|
|
644
|
+
type: "bunup",
|
|
645
|
+
name: "copy",
|
|
646
|
+
hooks: {
|
|
647
|
+
onBuildDone: async ({ options, meta }) => {
|
|
648
|
+
const targetDir = outDir || options.outDir;
|
|
649
|
+
const baseDir = meta.rootDir;
|
|
650
|
+
for (const pattern of patterns) {
|
|
651
|
+
let globPattern = pattern;
|
|
652
|
+
if (!pattern.includes("*") && !pattern.includes("?")) {
|
|
653
|
+
try {
|
|
654
|
+
const stats = await import_promises.stat(`${baseDir}/${pattern}`);
|
|
655
|
+
if (stats.isDirectory()) {
|
|
656
|
+
globPattern = `${pattern}/**/*`;
|
|
657
|
+
}
|
|
658
|
+
} catch {}
|
|
659
|
+
}
|
|
660
|
+
const glob = new Bun.Glob(globPattern);
|
|
661
|
+
for await (const file of glob.scan(baseDir)) {
|
|
662
|
+
const targetPath = `${targetDir}/${file}`;
|
|
663
|
+
await import_promises.mkdir(import_node_path3.dirname(targetPath), { recursive: true });
|
|
664
|
+
await Bun.write(targetPath, Bun.file(`${baseDir}/${file}`));
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
}
|
|
638
671
|
})
|
package/dist/plugins.d.cts
CHANGED
|
@@ -306,6 +306,8 @@ type BunupBunPlugin = {
|
|
|
306
306
|
type BuildMeta = {
|
|
307
307
|
/** The package.json file */
|
|
308
308
|
packageJson: PackageJson
|
|
309
|
+
/** The root directory of the build */
|
|
310
|
+
rootDir: string
|
|
309
311
|
};
|
|
310
312
|
type BuildOutputFile = {
|
|
311
313
|
/** Path to the generated file */
|
|
@@ -410,4 +412,10 @@ type InjectStylesPluginOptions = Pick<import("lightningcss").TransformOptions<im
|
|
|
410
412
|
* @see https://bunup.dev/docs/plugins/css#injectstyles
|
|
411
413
|
*/
|
|
412
414
|
declare function injectStyles(options?: InjectStylesPluginOptions): Plugin;
|
|
413
|
-
|
|
415
|
+
/**
|
|
416
|
+
* A plugin that copies files and directories to the output directory.
|
|
417
|
+
*
|
|
418
|
+
* @see https://bunup.dev/docs/plugins/productivity#copy
|
|
419
|
+
*/
|
|
420
|
+
declare function copy(patterns: string[], outDir?: string): BunupPlugin;
|
|
421
|
+
export { shims, report, injectStyles, filterJsDtsFiles, exports, copy };
|
package/dist/plugins.d.ts
CHANGED
|
@@ -306,6 +306,8 @@ type BunupBunPlugin = {
|
|
|
306
306
|
type BuildMeta = {
|
|
307
307
|
/** The package.json file */
|
|
308
308
|
packageJson: PackageJson
|
|
309
|
+
/** The root directory of the build */
|
|
310
|
+
rootDir: string
|
|
309
311
|
};
|
|
310
312
|
type BuildOutputFile = {
|
|
311
313
|
/** Path to the generated file */
|
|
@@ -410,4 +412,10 @@ type InjectStylesPluginOptions = Pick<import("lightningcss").TransformOptions<im
|
|
|
410
412
|
* @see https://bunup.dev/docs/plugins/css#injectstyles
|
|
411
413
|
*/
|
|
412
414
|
declare function injectStyles(options?: InjectStylesPluginOptions): Plugin;
|
|
413
|
-
|
|
415
|
+
/**
|
|
416
|
+
* A plugin that copies files and directories to the output directory.
|
|
417
|
+
*
|
|
418
|
+
* @see https://bunup.dev/docs/plugins/productivity#copy
|
|
419
|
+
*/
|
|
420
|
+
declare function copy(patterns: string[], outDir?: string): BunupPlugin;
|
|
421
|
+
export { shims, report, injectStyles, filterJsDtsFiles, exports, copy };
|
package/dist/plugins.js
CHANGED
|
@@ -600,10 +600,43 @@ function injectStyles(options) {
|
|
|
600
600
|
}
|
|
601
601
|
};
|
|
602
602
|
}
|
|
603
|
+
// src/plugins/built-in/productivity/copy.ts
|
|
604
|
+
import { mkdir, stat } from "fs/promises";
|
|
605
|
+
import { dirname } from "path";
|
|
606
|
+
function copy(patterns, outDir) {
|
|
607
|
+
return {
|
|
608
|
+
type: "bunup",
|
|
609
|
+
name: "copy",
|
|
610
|
+
hooks: {
|
|
611
|
+
onBuildDone: async ({ options, meta }) => {
|
|
612
|
+
const targetDir = outDir || options.outDir;
|
|
613
|
+
const baseDir = meta.rootDir;
|
|
614
|
+
for (const pattern of patterns) {
|
|
615
|
+
let globPattern = pattern;
|
|
616
|
+
if (!pattern.includes("*") && !pattern.includes("?")) {
|
|
617
|
+
try {
|
|
618
|
+
const stats = await stat(`${baseDir}/${pattern}`);
|
|
619
|
+
if (stats.isDirectory()) {
|
|
620
|
+
globPattern = `${pattern}/**/*`;
|
|
621
|
+
}
|
|
622
|
+
} catch {}
|
|
623
|
+
}
|
|
624
|
+
const glob = new Bun.Glob(globPattern);
|
|
625
|
+
for await (const file of glob.scan(baseDir)) {
|
|
626
|
+
const targetPath = `${targetDir}/${file}`;
|
|
627
|
+
await mkdir(dirname(targetPath), { recursive: true });
|
|
628
|
+
await Bun.write(targetPath, Bun.file(`${baseDir}/${file}`));
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
}
|
|
603
635
|
export {
|
|
604
636
|
shims,
|
|
605
637
|
report,
|
|
606
638
|
injectStyles,
|
|
607
639
|
filterJsDtsFiles,
|
|
608
|
-
exports
|
|
640
|
+
exports,
|
|
641
|
+
copy
|
|
609
642
|
};
|
package/package.json
CHANGED
|
@@ -1,101 +1,101 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
2
|
+
"name": "bunup",
|
|
3
|
+
"description": "⚡ A blazing-fast build tool for your libraries built with Bun.",
|
|
4
|
+
"version": "0.8.9",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"bin"
|
|
9
|
+
],
|
|
10
|
+
"module": "./dist/index.js",
|
|
11
|
+
"main": "./dist/index.cjs",
|
|
12
|
+
"types": "./dist/index.d.cts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"require": "./dist/index.cjs",
|
|
17
|
+
"types": "./dist/index.d.cts"
|
|
18
|
+
},
|
|
19
|
+
"./plugins": {
|
|
20
|
+
"import": "./dist/plugins.js",
|
|
21
|
+
"require": "./dist/plugins.cjs",
|
|
22
|
+
"types": "./dist/plugins.d.cts"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"author": "Arshad Yaseen <m@arshadyaseen.com> (https://arshadyaseen.com)",
|
|
27
|
+
"maintainers": [
|
|
28
|
+
{
|
|
29
|
+
"name": "Arshad Yaseen",
|
|
30
|
+
"email": "m@arshadyaseen.com",
|
|
31
|
+
"url": "https://arshadyaseen.com"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/arshad-yaseen/bunup.git"
|
|
37
|
+
},
|
|
38
|
+
"funding": "https://github.com/sponsors/arshad-yaseen",
|
|
39
|
+
"homepage": "https://bunup.dev",
|
|
40
|
+
"keywords": [
|
|
41
|
+
"bun",
|
|
42
|
+
"bunup",
|
|
43
|
+
"bun-bundler"
|
|
44
|
+
],
|
|
45
|
+
"bin": {
|
|
46
|
+
"bunup": "bin/bunup.mjs"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@clack/prompts": "^0.10.1",
|
|
50
|
+
"bun-dts": "^0.1.28",
|
|
51
|
+
"chokidar": "^4.0.3",
|
|
52
|
+
"coffi": "^0.1.29",
|
|
53
|
+
"giget": "^2.0.0",
|
|
54
|
+
"replace-in-file": "^8.3.0",
|
|
55
|
+
"tinyexec": "^1.0.1"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@biomejs/biome": "^1.9.4",
|
|
59
|
+
"@types/bun": "^1.2.5",
|
|
60
|
+
"bumpp": "^10.1.0",
|
|
61
|
+
"husky": "^9.1.7",
|
|
62
|
+
"lint-staged": "^15.5.1",
|
|
63
|
+
"typescript": "^5.8.3"
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"typescript": ">=4.5.0",
|
|
67
|
+
"lightningcss": ">=1.17.0"
|
|
68
|
+
},
|
|
69
|
+
"peerDependenciesMeta": {
|
|
70
|
+
"typescript": {
|
|
71
|
+
"optional": true
|
|
72
|
+
},
|
|
73
|
+
"lightningcss": {
|
|
74
|
+
"optional": true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"scripts": {
|
|
78
|
+
"build": "bunx bunup@latest",
|
|
79
|
+
"build:docs": "bun run --cwd docs build",
|
|
80
|
+
"dev": "bunx bunup@latest --watch",
|
|
81
|
+
"dev:docs": "bun run --cwd docs dev",
|
|
82
|
+
"format": "biome format .",
|
|
83
|
+
"format:fix": "biome format --write .",
|
|
84
|
+
"lint": "biome check .",
|
|
85
|
+
"lint:fix": "biome check --write .",
|
|
86
|
+
"prepare": "husky",
|
|
87
|
+
"test": "bun test",
|
|
88
|
+
"test-build": "bun run --cwd tests build",
|
|
89
|
+
"tsc": "tsc --noEmit",
|
|
90
|
+
"publish:ci": "bun publish --access public --no-git-checks",
|
|
91
|
+
"release": "bumpp"
|
|
92
|
+
},
|
|
93
|
+
"lint-staged": {
|
|
94
|
+
"*": "bun run format:fix && git add .",
|
|
95
|
+
"src/**/*.(m|c)?(j|t)s": "bun run tsc"
|
|
96
|
+
},
|
|
97
|
+
"workspaces": [
|
|
98
|
+
"docs",
|
|
99
|
+
"tests"
|
|
100
|
+
]
|
|
101
101
|
}
|