svelte-bundle 0.4.0-beta.0 → 0.4.0-beta.2

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.
Files changed (2) hide show
  1. package/dist/cli.js +30 -6
  2. package/package.json +4 -6
package/dist/cli.js CHANGED
@@ -3009,6 +3009,15 @@ async function runCreatePrompts(nameArg, pmArg) {
3009
3009
  ],
3010
3010
  required: false
3011
3011
  }));
3012
+ const buildFlags = assertNotCancelled(await pe({
3013
+ message: "Customize the build command: (space to toggle, enter to confirm)",
3014
+ options: [
3015
+ { value: "hydrate", label: "--hydrate", hint: "SSR pre-rendering for SEO-friendly output" },
3016
+ { value: "inline-assets", label: "--inline-assets", hint: "embed binary assets as base64 data URIs" },
3017
+ { value: "mode-development", label: "--mode development", hint: "build in development mode instead of production" }
3018
+ ],
3019
+ required: false
3020
+ }));
3012
3021
  const git = assertNotCancelled(await me({
3013
3022
  message: "Initialize a git repository?",
3014
3023
  initialValue: true
@@ -3022,6 +3031,7 @@ async function runCreatePrompts(nameArg, pmArg) {
3022
3031
  name,
3023
3032
  packageManager,
3024
3033
  features,
3034
+ buildFlags,
3025
3035
  git,
3026
3036
  install
3027
3037
  };
@@ -3116,6 +3126,8 @@ var logger = {
3116
3126
  console.log(import_picocolors4.default.dim(" →") + " " + msg);
3117
3127
  }
3118
3128
  };
3129
+ // package.json
3130
+ var version = "0.4.0-beta.2";
3119
3131
 
3120
3132
  // src/commands/create/scaffold.ts
3121
3133
  var TEMPLATE_VARS = {
@@ -3261,6 +3273,15 @@ test('has title', async ({ page }) => {
3261
3273
  ]
3262
3274
  }
3263
3275
  };
3276
+ var BUILD_FLAG_ARGS = {
3277
+ hydrate: "--hydrate",
3278
+ "inline-assets": "--inline-assets",
3279
+ "mode-development": "--mode development"
3280
+ };
3281
+ function buildScript(flags) {
3282
+ const args = flags.map((f3) => BUILD_FLAG_ARGS[f3]);
3283
+ return args.length > 0 ? `svelte-bundle build ${args.join(" ")}` : "svelte-bundle build";
3284
+ }
3264
3285
  function buildPackageJson(ctx) {
3265
3286
  const pkg = {
3266
3287
  name: ctx.name,
@@ -3269,7 +3290,7 @@ function buildPackageJson(ctx) {
3269
3290
  type: "module",
3270
3291
  scripts: {
3271
3292
  dev: "vite",
3272
- build: "vite build",
3293
+ build: buildScript(ctx.buildFlags),
3273
3294
  preview: "vite preview",
3274
3295
  "type-check": "tsc --noEmit"
3275
3296
  },
@@ -3277,7 +3298,8 @@ function buildPackageJson(ctx) {
3277
3298
  "@sveltejs/vite-plugin-svelte": "^5.0.0",
3278
3299
  svelte: "^5.0.0",
3279
3300
  typescript: "^5.0.0",
3280
- vite: "^6.0.0"
3301
+ vite: "^6.0.0",
3302
+ "svelte-bundle": `^${version}`
3281
3303
  }
3282
3304
  };
3283
3305
  for (const feature of ctx.features) {
@@ -3297,7 +3319,10 @@ function buildPackageJson(ctx) {
3297
3319
  }
3298
3320
  function buildViteConfig(ctx) {
3299
3321
  const hasTailwind = ctx.features.includes("tailwind");
3300
- const imports = ["import { defineConfig } from 'vite';", "import { svelte } from '@sveltejs/vite-plugin-svelte';"];
3322
+ const imports = [
3323
+ "import { defineConfig } from 'vite';",
3324
+ "import { svelte } from '@sveltejs/vite-plugin-svelte';"
3325
+ ];
3301
3326
  if (hasTailwind) {
3302
3327
  imports.push("import tailwindcss from '@tailwindcss/vite';");
3303
3328
  }
@@ -3310,7 +3335,6 @@ export default defineConfig({
3310
3335
  esbuild: {
3311
3336
  // Strip all legal/license comments (e.g. from lucide-svelte) from JS and CSS
3312
3337
  legalComments: 'none',
3313
- comments: false,
3314
3338
  },
3315
3339
  });
3316
3340
  `;
@@ -3736,8 +3760,8 @@ var buildCommand = defineCommand({
3736
3760
  var main = defineCommand({
3737
3761
  meta: {
3738
3762
  name: "svelte-bundle",
3739
- version: "0.2.0",
3740
- description: "Scaffold and bundle Svelte components with Vite"
3763
+ version,
3764
+ description: "Scaffold and bundle a svelte project into a single html file with Vite."
3741
3765
  },
3742
3766
  subCommands: {
3743
3767
  create: createCommand,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-bundle",
3
- "version": "0.4.0-beta.0",
3
+ "version": "0.4.0-beta.2",
4
4
  "description": "A powerful CLI for scaffolding and bundling Svelte components",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,17 +22,15 @@
22
22
  "release": "release-it",
23
23
  "prepare": "husky"
24
24
  },
25
- "dependencies": {
26
- "@clack/prompts": "^0.9.1",
27
- "citty": "^0.1.6",
28
- "picocolors": "^1.1.1"
29
- },
30
25
  "devDependencies": {
26
+ "@clack/prompts": "^0.9.1",
31
27
  "@commitlint/cli": "^20.4.3",
32
28
  "@commitlint/config-conventional": "^20.4.3",
33
29
  "@release-it/conventional-changelog": "^10.0.5",
34
30
  "@types/bun": "latest",
31
+ "citty": "^0.1.6",
35
32
  "husky": "^9.1.7",
33
+ "picocolors": "^1.1.1",
36
34
  "release-it": "^19.2.4",
37
35
  "typescript": "^5"
38
36
  }