bunup 0.8.41 → 0.8.42

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,284 +0,0 @@
1
- import {
2
- filterBunupBunPlugins,
3
- filterBunupPlugins,
4
- report,
5
- runPluginBuildDoneHooks,
6
- runPluginBuildStartHooks
7
- } from "./plugins/index.js";
8
- import {
9
- loadPackageJson
10
- } from "./chunk-gh7z7s46.js";
11
- import {
12
- BunupBuildError,
13
- cleanOutDir,
14
- cleanPath,
15
- ensureArray,
16
- getDefaultDtsExtention,
17
- getDefaultOutputExtension,
18
- getFilesFromGlobs,
19
- getPackageDeps,
20
- getShortFilePath,
21
- logger,
22
- setSilent
23
- } from "./chunk-c1eyecm3.js";
24
-
25
- // src/build.ts
26
- import path from "path";
27
- import { generateDts, logIsolatedDeclarationErrors } from "bun-dts";
28
- import pc from "picocolors";
29
-
30
- // src/plugins/internal/use-client.ts
31
- function useClient() {
32
- return {
33
- type: "bunup",
34
- name: "use-client",
35
- hooks: {
36
- onBuildDone: async ({ output }) => {
37
- for (const file of output.files) {
38
- let text = await Bun.file(file.fullPath).text();
39
- const hasUseClient = text.split(`
40
- `).some((line) => line.trim().startsWith(`"use client";`));
41
- if (hasUseClient) {
42
- text = text.replaceAll(`"use client";`, "");
43
- text = `"use client";
44
- ${text}`;
45
- }
46
- await Bun.write(file.fullPath, text);
47
- }
48
- }
49
- }
50
- };
51
- }
52
-
53
- // src/options.ts
54
- var DEFAULT_OPTIONS = {
55
- entry: [],
56
- format: ["cjs"],
57
- outDir: "dist",
58
- target: "node",
59
- clean: true
60
- };
61
- function createBuildOptions(partialOptions) {
62
- const options = {
63
- ...DEFAULT_OPTIONS,
64
- ...partialOptions
65
- };
66
- return {
67
- ...options,
68
- plugins: [
69
- ...options.plugins?.filter((p) => p.name !== "report") ?? [],
70
- useClient(),
71
- report()
72
- ]
73
- };
74
- }
75
- function getResolvedMinify(options) {
76
- const { minify, minifyWhitespace, minifyIdentifiers, minifySyntax } = options;
77
- const defaultValue = minify === true;
78
- return {
79
- whitespace: minifyWhitespace ?? defaultValue,
80
- identifiers: minifyIdentifiers ?? defaultValue,
81
- syntax: minifySyntax ?? defaultValue
82
- };
83
- }
84
- function getResolvedBytecode(bytecode, format) {
85
- return format === "cjs" ? bytecode : undefined;
86
- }
87
- function getResolvedSourcemap(sourcemap) {
88
- if (sourcemap === true) {
89
- return "inline";
90
- }
91
- return typeof sourcemap === "string" ? sourcemap : undefined;
92
- }
93
- function getResolvedDefine(define, env) {
94
- return {
95
- ...typeof env === "object" && Object.keys(env).reduce((acc, key) => {
96
- const value = JSON.stringify(env[key]);
97
- acc[`process.env.${key}`] = value;
98
- acc[`import.meta.env.${key}`] = value;
99
- return acc;
100
- }, {}),
101
- ...define
102
- };
103
- }
104
- function getResolvedSplitting(splitting, format) {
105
- return splitting === undefined ? format === "esm" : splitting;
106
- }
107
- function getResolvedDtsSplitting(splitting) {
108
- return splitting ?? true;
109
- }
110
- var DEFAULT_ENTRY_NAMING = "[dir]/[name].[ext]";
111
- function getResolvedNaming(fmt, packageType) {
112
- const replaceExt = (pattern) => pattern.replace(".[ext]", getDefaultOutputExtension(fmt, packageType));
113
- return replaceExt(DEFAULT_ENTRY_NAMING);
114
- }
115
- function getResolvedEnv(env) {
116
- return typeof env === "string" ? env : undefined;
117
- }
118
-
119
- // src/helpers/external.ts
120
- function getPackageDepsPatterns(packageJson) {
121
- return getPackageDeps(packageJson).map((dep) => new RegExp(`^${dep}($|\\/|\\\\)`));
122
- }
123
- function matchesPattern(path, pattern) {
124
- return typeof pattern === "string" ? pattern === path : pattern.test(path);
125
- }
126
- function isExternal(path, options, packageJson) {
127
- const packageDepsPatterns = getPackageDepsPatterns(packageJson);
128
- const matchesExternalPattern = packageDepsPatterns.some((pattern) => pattern.test(path)) || options.external?.some((pattern) => matchesPattern(path, pattern));
129
- const isExcludedFromExternal = options.noExternal?.some((pattern) => matchesPattern(path, pattern));
130
- return matchesExternalPattern && !isExcludedFromExternal;
131
- }
132
-
133
- // src/plugins/internal/external-option.ts
134
- function externalOptionPlugin(options, packageJson) {
135
- return {
136
- name: "bunup:external-option-plugin",
137
- setup(build) {
138
- build.onResolve({ filter: /.*/ }, (args) => {
139
- const importPath = args.path;
140
- if (isExternal(importPath, options, packageJson)) {
141
- return {
142
- path: importPath,
143
- external: true
144
- };
145
- }
146
- return null;
147
- });
148
- }
149
- };
150
- }
151
-
152
- // src/build.ts
153
- async function build(partialOptions, rootDir = process.cwd()) {
154
- const buildOutput = {
155
- files: []
156
- };
157
- const options = createBuildOptions(partialOptions);
158
- if (!options.entry || options.entry.length === 0 || !options.outDir) {
159
- throw new BunupBuildError("Nothing to build. Please make sure you have provided a proper bunup configuration or cli arguments.");
160
- }
161
- if (options.clean) {
162
- cleanOutDir(rootDir, options.outDir);
163
- }
164
- setSilent(options.silent);
165
- const packageJson = await loadPackageJson(rootDir);
166
- if (packageJson.data && packageJson.path) {
167
- logger.info(`Using ${getShortFilePath(packageJson.path, 2)}`, {
168
- muted: true,
169
- identifier: options.name,
170
- once: `${packageJson.path}:${options.name}`
171
- });
172
- }
173
- const bunupPlugins = filterBunupPlugins(options.plugins);
174
- await runPluginBuildStartHooks(bunupPlugins, options);
175
- const packageType = packageJson.data?.type;
176
- const plugins = [
177
- externalOptionPlugin(options, packageJson.data),
178
- ...filterBunupBunPlugins(options.plugins).map((p) => p.plugin)
179
- ];
180
- const entrypoints = await getFilesFromGlobs(ensureArray(options.entry), rootDir);
181
- if (!entrypoints.length) {
182
- throw new BunupBuildError("The entrypoints you provided do not exist. Please make sure the entrypoints point to valid files.");
183
- }
184
- const buildPromises = options.format.flatMap(async (fmt) => {
185
- const result = await Bun.build({
186
- entrypoints: entrypoints.map((file) => `${rootDir}/${file}`),
187
- format: fmt,
188
- naming: getResolvedNaming(fmt, packageType),
189
- splitting: getResolvedSplitting(options.splitting, fmt),
190
- bytecode: getResolvedBytecode(options.bytecode, fmt),
191
- define: getResolvedDefine(options.define, options.env),
192
- minify: getResolvedMinify(options),
193
- outdir: `${rootDir}/${options.outDir}`,
194
- target: options.target,
195
- sourcemap: getResolvedSourcemap(options.sourcemap),
196
- loader: options.loader,
197
- drop: options.drop,
198
- banner: options.banner,
199
- footer: options.footer,
200
- publicPath: options.publicPath,
201
- env: getResolvedEnv(options.env),
202
- ignoreDCEAnnotations: options.ignoreDCEAnnotations,
203
- emitDCEAnnotations: options.emitDCEAnnotations,
204
- throw: false,
205
- plugins
206
- });
207
- for (const log of result.logs) {
208
- if (log.level === "error") {
209
- throw new BunupBuildError(log.message);
210
- }
211
- if (log.level === "warning")
212
- logger.warn(log.message);
213
- else if (log.level === "info")
214
- logger.info(log.message);
215
- }
216
- for (const file of result.outputs) {
217
- const relativePathToRootDir = getRelativePathToRootDir(file.path, rootDir);
218
- const relativePathToOutputDir = getRelativePathToOutputDir(relativePathToRootDir, options.outDir);
219
- if (file.kind === "entry-point") {
220
- logger.success(`${pc.dim(options.outDir)}/${relativePathToOutputDir}`, {
221
- identifier: options.name
222
- });
223
- }
224
- buildOutput.files.push({
225
- fullPath: file.path,
226
- relativePathToRootDir,
227
- relativePathToOutputDir,
228
- dts: false,
229
- format: fmt,
230
- kind: file.kind
231
- });
232
- }
233
- });
234
- await Promise.all(buildPromises);
235
- if (options.dts) {
236
- const { entry, splitting, ...dtsOptions } = typeof options.dts === "object" ? options.dts : {};
237
- const dtsResult = await generateDts(ensureArray(entry ?? entrypoints), {
238
- cwd: rootDir,
239
- preferredTsConfigPath: options.preferredTsconfigPath,
240
- splitting: getResolvedDtsSplitting(splitting),
241
- ...dtsOptions
242
- });
243
- if (dtsResult.errors.length) {
244
- logIsolatedDeclarationErrors(dtsResult.errors, {
245
- shouldExit: true
246
- });
247
- }
248
- for (const fmt of options.format) {
249
- for (const file of dtsResult.files) {
250
- const dtsExtension = getDefaultDtsExtention(fmt, packageType);
251
- const relativePathToOutputDir = cleanPath(`${file.pathInfo.outputPathWithoutExtension}${dtsExtension}`);
252
- const relativePathToRootDir = cleanPath(`${options.outDir}/${relativePathToOutputDir}`);
253
- logger.success(`${pc.dim(options.outDir)}/${relativePathToOutputDir}`, {
254
- identifier: options.name
255
- });
256
- const fullPath = path.join(rootDir, relativePathToRootDir);
257
- await Bun.write(fullPath, file.dts);
258
- buildOutput.files.push({
259
- fullPath,
260
- relativePathToRootDir,
261
- relativePathToOutputDir,
262
- dts: true,
263
- format: fmt,
264
- kind: file.kind
265
- });
266
- }
267
- }
268
- }
269
- await runPluginBuildDoneHooks(bunupPlugins, options, buildOutput, {
270
- packageJson,
271
- rootDir
272
- });
273
- if (options.onSuccess) {
274
- await options.onSuccess(options);
275
- }
276
- }
277
- function getRelativePathToRootDir(filePath, rootDir) {
278
- return cleanPath(filePath).replace(`${cleanPath(rootDir)}/`, "");
279
- }
280
- function getRelativePathToOutputDir(relativePathToRootDir, outDir) {
281
- return cleanPath(relativePathToRootDir).replace(`${cleanPath(outDir)}/`, "");
282
- }
283
-
284
- export { createBuildOptions, build };
@@ -1,355 +0,0 @@
1
- // @bun
2
- import {
3
- loadPackageJson
4
- } from "./chunk-gh7z7s46.js";
5
- import {
6
- displayBunupGradientArt
7
- } from "./chunk-a7j07gk7.js";
8
- import {
9
- formatListWithAnd
10
- } from "./chunk-c1eyecm3.js";
11
-
12
- // src/cli/init.ts
13
- import fs from "fs";
14
- import path from "path";
15
- import {
16
- confirm,
17
- intro,
18
- log,
19
- multiselect,
20
- outro,
21
- select,
22
- tasks,
23
- text
24
- } from "@clack/prompts";
25
- import pc from "picocolors";
26
- import { exec } from "tinyexec";
27
- async function init() {
28
- displayBunupGradientArt();
29
- intro(pc.bgCyan(pc.black(" Initialize bunup in an existing project ")));
30
- const { path: packageJsonPath } = await loadPackageJson();
31
- if (!packageJsonPath) {
32
- log.error("package.json not found");
33
- process.exit(1);
34
- }
35
- const shouldSetupWorkspace = await promptForWorkspace();
36
- if (shouldSetupWorkspace) {
37
- await initializeWorkspace(packageJsonPath);
38
- } else {
39
- await initializeSinglePackage(packageJsonPath);
40
- }
41
- await tasks([
42
- {
43
- title: "Installing bunup",
44
- task: async () => {
45
- await installBunup();
46
- return "Bunup installed";
47
- }
48
- }
49
- ]);
50
- showSuccessOutro(shouldSetupWorkspace);
51
- }
52
- async function promptForWorkspace() {
53
- return await confirm({
54
- message: "Do you want to setup a Bunup workspace? (for building multiple packages with one command)",
55
- initialValue: false
56
- });
57
- }
58
- async function initializeWorkspace(packageJsonPath) {
59
- const workspacePackages = await collectWorkspacePackages();
60
- const configMethod = await selectWorkspaceConfigurationMethod();
61
- await generateWorkspaceConfiguration(configMethod, workspacePackages);
62
- await handleWorkspaceBuildScripts(packageJsonPath);
63
- }
64
- async function initializeSinglePackage(packageJsonPath) {
65
- const entryFiles = await collectEntryFiles();
66
- const outputFormats = await selectOutputFormats();
67
- const shouldGenerateDts = await promptForTypeScriptDeclarations(entryFiles);
68
- const configMethod = await selectConfigurationMethod();
69
- await generateConfiguration(configMethod, entryFiles, outputFormats, shouldGenerateDts, packageJsonPath);
70
- await handleBuildScripts(packageJsonPath, entryFiles, outputFormats, shouldGenerateDts, configMethod);
71
- }
72
- async function collectWorkspacePackages() {
73
- const packages = [];
74
- while (true) {
75
- const packageName = await text({
76
- message: packages.length > 0 ? "Enter the next package name:" : "Enter the first package name:",
77
- placeholder: "core",
78
- validate: (value) => {
79
- if (!value)
80
- return "Package name is required";
81
- if (packages.some((pkg) => pkg.name === value))
82
- return "Package name already exists";
83
- }
84
- });
85
- const packageRoot = await text({
86
- message: `Enter the root directory for "${packageName}":`,
87
- placeholder: `packages/${packageName}`,
88
- defaultValue: `packages/${packageName}`,
89
- validate: (value) => {
90
- if (!value)
91
- return "Package root is required";
92
- if (!fs.existsSync(value))
93
- return "Package root directory does not exist";
94
- if (!fs.statSync(value).isDirectory())
95
- return "Package root must be a directory";
96
- }
97
- });
98
- const entryFiles = await collectEntryFilesForPackage(packageRoot, packageName);
99
- const outputFormats = await selectOutputFormats();
100
- const shouldGenerateDts = await promptForTypeScriptDeclarations(entryFiles);
101
- packages.push({
102
- name: packageName,
103
- root: packageRoot,
104
- entryFiles,
105
- outputFormats,
106
- shouldGenerateDts
107
- });
108
- const shouldAddMore = await confirm({
109
- message: "Do you want to add another package?",
110
- initialValue: true
111
- });
112
- if (!shouldAddMore)
113
- break;
114
- }
115
- return packages;
116
- }
117
- async function collectEntryFilesForPackage(packageRoot, packageName) {
118
- const entryFiles = [];
119
- while (true) {
120
- const entryFile = await text({
121
- message: entryFiles.length > 0 ? `Where is the next entry file for "${packageName}"? (relative to ${packageRoot})` : `Where is the entry file for "${packageName}"? (relative to ${packageRoot})`,
122
- placeholder: "src/index.ts",
123
- defaultValue: "src/index.ts",
124
- validate: (value) => {
125
- if (!value)
126
- return "Entry file is required";
127
- const fullPath = path.join(packageRoot, value);
128
- if (!fs.existsSync(fullPath))
129
- return `Entry file does not exist at ${fullPath}`;
130
- if (!fs.statSync(fullPath).isFile())
131
- return "Entry file must be a file";
132
- if (entryFiles.includes(value))
133
- return "You have already added this entry file";
134
- }
135
- });
136
- entryFiles.push(entryFile);
137
- const shouldAddMore = await confirm({
138
- message: "Do you want to add another entry file for this package?",
139
- initialValue: false
140
- });
141
- if (!shouldAddMore)
142
- break;
143
- }
144
- return entryFiles;
145
- }
146
- async function collectEntryFiles() {
147
- const entryFiles = [];
148
- while (true) {
149
- const entryFile = await text({
150
- message: entryFiles.length > 0 ? "Where is your next entry file?" : "Where is your entry file?",
151
- placeholder: "src/index.ts",
152
- defaultValue: "src/index.ts",
153
- validate: (value) => {
154
- if (!value)
155
- return "Entry file is required";
156
- if (!fs.existsSync(value))
157
- return "Entry file does not exist";
158
- if (!fs.statSync(value).isFile())
159
- return "Entry file must be a file";
160
- if (entryFiles.includes(value))
161
- return "You have already added this entry file";
162
- }
163
- });
164
- entryFiles.push(entryFile);
165
- const shouldAddMore = await confirm({
166
- message: "Do you want to add another entry file?",
167
- initialValue: false
168
- });
169
- if (!shouldAddMore)
170
- break;
171
- }
172
- return entryFiles;
173
- }
174
- async function selectOutputFormats() {
175
- return await multiselect({
176
- message: "Select the output formats",
177
- options: [
178
- { value: "esm", label: "ESM (.mjs)" },
179
- { value: "cjs", label: "CommonJS (.cjs)" },
180
- { value: "iife", label: "IIFE (.global.js)" }
181
- ],
182
- initialValues: ["esm", "cjs"]
183
- });
184
- }
185
- async function promptForTypeScriptDeclarations(entryFiles) {
186
- const hasTypeScriptFiles = entryFiles.some((file) => file.endsWith(".ts") || file.endsWith(".tsx"));
187
- if (!hasTypeScriptFiles)
188
- return false;
189
- return await confirm({
190
- message: "Generate TypeScript declarations?",
191
- initialValue: true
192
- });
193
- }
194
- async function selectWorkspaceConfigurationMethod() {
195
- return await select({
196
- message: "How would you like to configure your workspace?",
197
- options: [
198
- { value: "ts", label: "bunup.config.ts", hint: "Recommended" },
199
- { value: "js", label: "bunup.config.js" }
200
- ],
201
- initialValue: "ts"
202
- });
203
- }
204
- async function selectConfigurationMethod() {
205
- return await select({
206
- message: "How would you like to configure Bunup?",
207
- options: [
208
- { value: "ts", label: "bunup.config.ts", hint: "Recommended" },
209
- { value: "js", label: "bunup.config.js" },
210
- { value: "json", label: 'package.json "bunup" property' },
211
- {
212
- value: "none",
213
- label: "No config file",
214
- hint: "Configure via CLI only"
215
- }
216
- ],
217
- initialValue: "ts"
218
- });
219
- }
220
- async function generateWorkspaceConfiguration(configMethod, workspacePackages) {
221
- const configContent = createWorkspaceConfigFileContent(workspacePackages);
222
- await Bun.write(`bunup.config.${configMethod}`, configContent);
223
- }
224
- async function generateConfiguration(configMethod, entryFiles, outputFormats, shouldGenerateDts, packageJsonPath) {
225
- if (configMethod === "none") {
226
- log.info("If you need more control (such as adding plugins or customizing output), you can always create a config file later.");
227
- return;
228
- }
229
- if (configMethod === "ts" || configMethod === "js") {
230
- await Bun.write(`bunup.config.${configMethod}`, createConfigFileContent(entryFiles, outputFormats, shouldGenerateDts));
231
- } else if (configMethod === "json") {
232
- const { data: packageJsonConfig } = await loadPackageJson();
233
- const updatedConfig = {
234
- ...packageJsonConfig,
235
- bunup: createPackageJsonConfig(entryFiles, outputFormats, shouldGenerateDts)
236
- };
237
- await Bun.write(packageJsonPath, JSON.stringify(updatedConfig, null, 2));
238
- }
239
- }
240
- async function handleWorkspaceBuildScripts(packageJsonPath) {
241
- const { data: packageJsonConfig } = await loadPackageJson();
242
- const existingScripts = packageJsonConfig?.scripts ?? {};
243
- const newScripts = createWorkspaceBuildScripts();
244
- const conflictingScripts = Object.keys(newScripts).filter((script) => existingScripts[script]);
245
- if (conflictingScripts.length > 0) {
246
- const shouldOverride = await confirm({
247
- message: `The ${formatListWithAnd(conflictingScripts)} ${conflictingScripts.length > 1 ? "scripts already exist" : "script already exists"} in package.json. Override ${conflictingScripts.length > 1 ? "them" : "it"}?`,
248
- initialValue: true
249
- });
250
- if (!shouldOverride) {
251
- log.info("Skipped adding build scripts to avoid conflicts.");
252
- return;
253
- }
254
- }
255
- const updatedConfig = {
256
- ...packageJsonConfig,
257
- scripts: { ...existingScripts, ...newScripts }
258
- };
259
- await Bun.write(packageJsonPath, JSON.stringify(updatedConfig, null, 2));
260
- }
261
- async function handleBuildScripts(packageJsonPath, entryFiles, outputFormats, shouldGenerateDts, configMethod) {
262
- const { data: packageJsonConfig } = await loadPackageJson();
263
- const existingScripts = packageJsonConfig?.scripts ?? {};
264
- const newScripts = createBuildScripts(entryFiles, outputFormats, shouldGenerateDts, configMethod);
265
- const conflictingScripts = Object.keys(newScripts).filter((script) => existingScripts[script]);
266
- if (conflictingScripts.length > 0) {
267
- const shouldOverride = await confirm({
268
- message: `The ${formatListWithAnd(conflictingScripts)} ${conflictingScripts.length > 1 ? "scripts already exist" : "script already exists"} in package.json. Override ${conflictingScripts.length > 1 ? "them" : "it"}?`,
269
- initialValue: true
270
- });
271
- if (!shouldOverride) {
272
- log.info("Skipped adding build scripts to avoid conflicts.");
273
- return;
274
- }
275
- }
276
- const updatedConfig = {
277
- ...packageJsonConfig,
278
- scripts: { ...existingScripts, ...newScripts }
279
- };
280
- await Bun.write(packageJsonPath, JSON.stringify(updatedConfig, null, 2));
281
- }
282
- function createWorkspaceConfigFileContent(workspacePackages) {
283
- const packagesConfig = workspacePackages.map((pkg) => {
284
- return ` {
285
- name: '${pkg.name}',
286
- root: '${pkg.root}',
287
- config: {
288
- entry: [${pkg.entryFiles.map((file) => `'${file}'`).join(", ")}],
289
- format: [${pkg.outputFormats.map((format) => `'${format}'`).join(", ")}],${pkg.shouldGenerateDts ? `
290
- dts: true,` : ""}
291
- },
292
- }`;
293
- }).join(`,
294
- `);
295
- return `import { defineWorkspace } from 'bunup'
296
-
297
- export default defineWorkspace([
298
- ${packagesConfig}
299
- ])
300
- `;
301
- }
302
- function createConfigFileContent(entryFiles, outputFormats, shouldGenerateDts) {
303
- return `import { defineConfig } from 'bunup'
304
-
305
- export default defineConfig({
306
- entry: [${entryFiles.map((file) => `'${file}'`).join(", ")}],
307
- format: [${outputFormats.map((format) => `'${format}'`).join(", ")}],${shouldGenerateDts ? `
308
- dts: true,` : ""}
309
- })
310
- `;
311
- }
312
- function createPackageJsonConfig(entryFiles, outputFormats, shouldGenerateDts) {
313
- return {
314
- entry: entryFiles,
315
- format: outputFormats,
316
- ...shouldGenerateDts && { dts: true }
317
- };
318
- }
319
- function createWorkspaceBuildScripts() {
320
- return {
321
- build: "bunup",
322
- dev: "bunup --watch"
323
- };
324
- }
325
- function createBuildScripts(entryFiles, outputFormats, shouldGenerateDts, configMethod) {
326
- const cliOptions = configMethod === "none" ? ` ${entryFiles.join(" ")} --format ${outputFormats.join(",")}${shouldGenerateDts ? " --dts" : ""}` : "";
327
- return {
328
- build: `bunup${cliOptions}`,
329
- dev: `bunup${cliOptions} --watch`
330
- };
331
- }
332
- function showSuccessOutro(isWorkspace) {
333
- const buildCommand = isWorkspace ? `${pc.cyan("bun run build")} - Build all packages in your workspace` : `${pc.cyan("bun run build")} - Build your library`;
334
- const devCommand = isWorkspace ? `${pc.cyan("bun run dev")} - Start development mode (watches all packages)` : `${pc.cyan("bun run dev")} - Start development mode`;
335
- const filterCommand = isWorkspace ? `${pc.cyan("bunup --filter core,utils")} - Build specific packages` : "";
336
- outro(`
337
- ${pc.green("\u2728 Bunup initialized successfully! \u2728")}
338
-
339
- ${buildCommand}
340
- ${devCommand}${isWorkspace ? `
341
- ${filterCommand}` : ""}
342
-
343
- ${pc.dim("Learn more:")} ${pc.underline("https://bunup.dev/docs")}
344
-
345
- ${pc.yellow("Happy building!")} \uD83D\uDE80
346
- `);
347
- }
348
- async function installBunup() {
349
- await exec("bun add -d bunup", [], {
350
- nodeOptions: { shell: true, stdio: "pipe" }
351
- });
352
- }
353
- export {
354
- init
355
- };
@@ -1,25 +0,0 @@
1
- import {
2
- logger
3
- } from "./chunk-c1eyecm3.js";
4
-
5
- // src/cli/utils.ts
6
- import pc from "picocolors";
7
- function displayBunupGradientArt() {
8
- const art = `
9
- \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557
10
- \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557
11
- \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D
12
- \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D
13
- \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551
14
- \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D
15
- `.trim();
16
- const lines = art.split(`
17
- `);
18
- logger.space();
19
- for (const line of lines) {
20
- console.log(pc.cyan(line));
21
- }
22
- logger.space();
23
- }
24
-
25
- export { displayBunupGradientArt };