create-windy 0.6.1 → 0.6.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/dist/cli.js CHANGED
@@ -33,7 +33,7 @@ var __toESM = (mod, isNodeMode, target) => {
33
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34
34
  var __require = import.meta.require;
35
35
 
36
- // ../../node_modules/.bun/cli-width@4.1.0/node_modules/cli-width/index.js
36
+ // ../../node_modules/cli-width/index.js
37
37
  var require_cli_width = __commonJS((exports, module2) => {
38
38
  module2.exports = cliWidth;
39
39
  function normalizeOpts(options) {
@@ -73,7 +73,7 @@ var require_cli_width = __commonJS((exports, module2) => {
73
73
  }
74
74
  });
75
75
 
76
- // ../../node_modules/.bun/mute-stream@3.0.0/node_modules/mute-stream/lib/index.js
76
+ // ../../node_modules/mute-stream/lib/index.js
77
77
  var require_lib = __commonJS((exports, module2) => {
78
78
  var Stream = __require("stream");
79
79
 
@@ -2832,6 +2832,14 @@ var openSearchComposeService = ` opensearch:
2832
2832
 
2833
2833
  `;
2834
2834
 
2835
+ // src/runtime-profile-compose-build.ts
2836
+ var starterServerBuild = ` build:
2837
+ context: .
2838
+ dockerfile: apps/server/Dockerfile
2839
+ args:
2840
+ WINDY_DEBIAN_MIRROR: \${WINDY_DEBIAN_MIRROR:-http://mirrors.aliyun.com/debian}
2841
+ WINDY_DEBIAN_SECURITY_MIRROR: \${WINDY_DEBIAN_SECURITY_MIRROR:-http://mirrors.aliyun.com/debian-security}`;
2842
+
2835
2843
  // src/runtime-profile-files.ts
2836
2844
  var starterComposeBase = `services:
2837
2845
  postgres:
@@ -2851,9 +2859,7 @@ var starterComposeBase = `services:
2851
2859
  retries: 5
2852
2860
 
2853
2861
  migrate:
2854
- build:
2855
- context: .
2856
- dockerfile: apps/server/Dockerfile
2862
+ ${starterServerBuild}
2857
2863
  command: ["bun", "run", "db:migrate"]
2858
2864
  environment:
2859
2865
  DATABASE_URL: postgresql://windy:\${POSTGRES_PASSWORD}@postgres:5432/windy
@@ -2864,9 +2870,7 @@ var starterComposeBase = `services:
2864
2870
  condition: service_healthy
2865
2871
 
2866
2872
  server:
2867
- build:
2868
- context: .
2869
- dockerfile: apps/server/Dockerfile
2873
+ ${starterServerBuild}
2870
2874
  command: ["bun", "run", "--cwd", "apps/server", "dev"]
2871
2875
  environment:
2872
2876
  NODE_ENV: development
@@ -2942,9 +2946,7 @@ __OPTIONAL_VOLUMES__
2942
2946
  `;
2943
2947
  var agentComposeService = ` tool-sandbox-init:
2944
2948
  profiles: ["agent"]
2945
- build:
2946
- context: .
2947
- dockerfile: apps/server/Dockerfile
2949
+ ${starterServerBuild}
2948
2950
  user: "0:0"
2949
2951
  command:
2950
2952
  [
@@ -2965,9 +2967,7 @@ var agentComposeService = ` tool-sandbox-init:
2965
2967
 
2966
2968
  tool-sandbox:
2967
2969
  profiles: ["agent"]
2968
- build:
2969
- context: .
2970
- dockerfile: apps/server/Dockerfile
2970
+ ${starterServerBuild}
2971
2971
  command: ["bun", "run", "apps/server/src/agent/sandbox-worker.ts"]
2972
2972
  environment:
2973
2973
  TOOL_SANDBOX_SOCKET: /run/windy-tool-sandbox/worker.sock
@@ -3554,6 +3554,10 @@ var defaultLintStaged = {
3554
3554
  "*.{css,html,json,jsonc,less,md,mdx,scss,yaml,yml}": "oxfmt --write",
3555
3555
  "*.{cjs,cts,js,jsx,mjs,mts,ts,tsx,vue}": ["oxfmt --write", "oxlint"]
3556
3556
  };
3557
+ var migrationCliDependencies = {
3558
+ "drizzle-orm": "^0.45.2",
3559
+ pg: "^8.22.0"
3560
+ };
3557
3561
  function createStarterPackage(source, projectName, includeOxc = true, projectLicense = "UNLICENSED", selectedModules = [], generatorVersion) {
3558
3562
  const { "lint-staged": sourceLintStaged, ...sourceWithoutLintStaged } = source;
3559
3563
  const devDependencies = { ...source.devDependencies };
@@ -3613,6 +3617,7 @@ function createStarterPackage(source, projectName, includeOxc = true, projectLic
3613
3617
  test: "bun test && bun run --cwd apps/web test"
3614
3618
  },
3615
3619
  devDependencies: {
3620
+ ...migrationCliDependencies,
3616
3621
  ...devDependencies,
3617
3622
  ...generatorVersion ? { "create-windy": generatorVersion } : {}
3618
3623
  }
@@ -4224,7 +4229,7 @@ function isMissing6(error) {
4224
4229
  import { createInterface as createInterface2 } from "readline/promises";
4225
4230
  import { stdin, stdout } from "process";
4226
4231
 
4227
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/key.js
4232
+ // ../../node_modules/@inquirer/core/dist/lib/key.js
4228
4233
  var keybindings = ["emacs", "vim"];
4229
4234
  var keybindingLookup = new Set(keybindings);
4230
4235
  function isKeybinding(value) {
@@ -4241,7 +4246,7 @@ var isDownKey = (key, keybindings2 = []) => key.name === "down" || keybindings2.
4241
4246
  var isSpaceKey = (key) => key.name === "space";
4242
4247
  var isNumberKey = (key) => "1234567890".includes(key.name);
4243
4248
  var isEnterKey = (key) => key.name === "enter" || key.name === "return";
4244
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/errors.js
4249
+ // ../../node_modules/@inquirer/core/dist/lib/errors.js
4245
4250
  class AbortPromptError extends Error {
4246
4251
  name = "AbortPromptError";
4247
4252
  message = "Prompt was aborted";
@@ -4267,10 +4272,10 @@ class HookError extends Error {
4267
4272
  class ValidationError extends Error {
4268
4273
  name = "ValidationError";
4269
4274
  }
4270
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/use-state.js
4275
+ // ../../node_modules/@inquirer/core/dist/lib/use-state.js
4271
4276
  import { AsyncResource as AsyncResource2 } from "async_hooks";
4272
4277
 
4273
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/hook-engine.js
4278
+ // ../../node_modules/@inquirer/core/dist/lib/hook-engine.js
4274
4279
  import { AsyncLocalStorage, AsyncResource } from "async_hooks";
4275
4280
  var hookStorage = new AsyncLocalStorage;
4276
4281
  function createStore(rl) {
@@ -4375,7 +4380,7 @@ var effectScheduler = {
4375
4380
  }
4376
4381
  };
4377
4382
 
4378
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/use-state.js
4383
+ // ../../node_modules/@inquirer/core/dist/lib/use-state.js
4379
4384
  function isFactory(value) {
4380
4385
  return typeof value === "function";
4381
4386
  }
@@ -4396,7 +4401,7 @@ function useState(defaultValue) {
4396
4401
  });
4397
4402
  }
4398
4403
 
4399
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/use-effect.js
4404
+ // ../../node_modules/@inquirer/core/dist/lib/use-effect.js
4400
4405
  function useEffect(cb, depArray) {
4401
4406
  withPointer((pointer) => {
4402
4407
  const oldDeps = pointer.get();
@@ -4408,10 +4413,10 @@ function useEffect(cb, depArray) {
4408
4413
  });
4409
4414
  }
4410
4415
 
4411
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/theme.js
4416
+ // ../../node_modules/@inquirer/core/dist/lib/theme.js
4412
4417
  import { styleText } from "util";
4413
4418
 
4414
- // ../../node_modules/.bun/@inquirer+figures@2.0.7/node_modules/@inquirer/figures/dist/index.js
4419
+ // ../../node_modules/@inquirer/figures/dist/index.js
4415
4420
  import process2 from "process";
4416
4421
  function isUnicodeSupported() {
4417
4422
  if (!process2.platform.startsWith("win")) {
@@ -4700,7 +4705,7 @@ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
4700
4705
  var dist_default = figures;
4701
4706
  var replacements = Object.entries(specialMainSymbols);
4702
4707
 
4703
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/theme.js
4708
+ // ../../node_modules/@inquirer/core/dist/lib/theme.js
4704
4709
  var defaultTheme = {
4705
4710
  prefix: {
4706
4711
  idle: styleText("blue", "?"),
@@ -4728,7 +4733,7 @@ function getDefaultTheme() {
4728
4733
  };
4729
4734
  }
4730
4735
 
4731
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/make-theme.js
4736
+ // ../../node_modules/@inquirer/core/dist/lib/make-theme.js
4732
4737
  function isPlainObject(value) {
4733
4738
  if (typeof value !== "object" || value === null)
4734
4739
  return false;
@@ -4756,7 +4761,7 @@ function makeTheme(...themes) {
4756
4761
  return deepMerge(...themesToMerge);
4757
4762
  }
4758
4763
 
4759
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/use-prefix.js
4764
+ // ../../node_modules/@inquirer/core/dist/lib/use-prefix.js
4760
4765
  function usePrefix({ status = "idle", theme }) {
4761
4766
  const [showLoader, setShowLoader] = useState(false);
4762
4767
  const [tick, setTick] = useState(0);
@@ -4786,7 +4791,7 @@ function usePrefix({ status = "idle", theme }) {
4786
4791
  const iconName = status === "loading" ? "idle" : status;
4787
4792
  return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
4788
4793
  }
4789
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/use-memo.js
4794
+ // ../../node_modules/@inquirer/core/dist/lib/use-memo.js
4790
4795
  function useMemo(fn, dependencies) {
4791
4796
  return withPointer((pointer) => {
4792
4797
  const prev = pointer.get();
@@ -4798,12 +4803,12 @@ function useMemo(fn, dependencies) {
4798
4803
  return prev.value;
4799
4804
  });
4800
4805
  }
4801
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/use-ref.js
4806
+ // ../../node_modules/@inquirer/core/dist/lib/use-ref.js
4802
4807
  function useRef(val) {
4803
4808
  return useState({ current: val })[0];
4804
4809
  }
4805
4810
 
4806
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/use-keypress.js
4811
+ // ../../node_modules/@inquirer/core/dist/lib/use-keypress.js
4807
4812
  function useKeypress(userHandler) {
4808
4813
  const signal = useRef(userHandler);
4809
4814
  signal.current = userHandler;
@@ -4821,10 +4826,10 @@ function useKeypress(userHandler) {
4821
4826
  };
4822
4827
  }, []);
4823
4828
  }
4824
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/utils.js
4829
+ // ../../node_modules/@inquirer/core/dist/lib/utils.js
4825
4830
  var import_cli_width = __toESM(require_cli_width(), 1);
4826
4831
 
4827
- // ../../node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
4832
+ // ../../node_modules/fast-string-truncated-width/dist/utils.js
4828
4833
  var getCodePointsLength = (() => {
4829
4834
  const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
4830
4835
  return (input) => {
@@ -4843,7 +4848,7 @@ var isWideNotCJKTNotEmoji = (x) => {
4843
4848
  return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
4844
4849
  };
4845
4850
 
4846
- // ../../node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
4851
+ // ../../node_modules/fast-string-truncated-width/dist/index.js
4847
4852
  var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
4848
4853
  var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
4849
4854
  var CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
@@ -4942,7 +4947,7 @@ var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {})
4942
4947
  };
4943
4948
  var dist_default2 = getStringTruncatedWidth;
4944
4949
 
4945
- // ../../node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
4950
+ // ../../node_modules/fast-string-width/dist/index.js
4946
4951
  var NO_TRUNCATION2 = {
4947
4952
  limit: Infinity,
4948
4953
  ellipsis: "",
@@ -4953,7 +4958,7 @@ var fastStringWidth = (input, options = {}) => {
4953
4958
  };
4954
4959
  var dist_default3 = fastStringWidth;
4955
4960
 
4956
- // ../../node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
4961
+ // ../../node_modules/fast-wrap-ansi/lib/main.js
4957
4962
  var ESC = "\x1B";
4958
4963
  var CSI = "\x9B";
4959
4964
  var END_CODE = 39;
@@ -5165,7 +5170,7 @@ function wrapAnsi(string, columns, options) {
5165
5170
  `);
5166
5171
  }
5167
5172
 
5168
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/utils.js
5173
+ // ../../node_modules/@inquirer/core/dist/lib/utils.js
5169
5174
  function breakLines(content, width) {
5170
5175
  return content.split(`
5171
5176
  `).flatMap((line) => wrapAnsi(line, width, { trim: false, wordWrap: false }).split(`
@@ -5176,7 +5181,7 @@ function readlineWidth() {
5176
5181
  return import_cli_width.default({ defaultWidth: 80, output: readline().output });
5177
5182
  }
5178
5183
 
5179
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
5184
+ // ../../node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
5180
5185
  function usePointerPosition({ active, renderedItems, pageSize, loop }) {
5181
5186
  const state = useRef({
5182
5187
  lastPointer: active,
@@ -5242,12 +5247,12 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
5242
5247
  return pageBuffer.filter((line) => typeof line === "string").join(`
5243
5248
  `);
5244
5249
  }
5245
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/create-prompt.js
5250
+ // ../../node_modules/@inquirer/core/dist/lib/create-prompt.js
5246
5251
  var import_mute_stream = __toESM(require_lib(), 1);
5247
5252
  import * as readline2 from "readline";
5248
5253
  import { AsyncResource as AsyncResource3 } from "async_hooks";
5249
5254
 
5250
- // ../../node_modules/.bun/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
5255
+ // ../../node_modules/signal-exit/dist/mjs/signals.js
5251
5256
  var signals = [];
5252
5257
  signals.push("SIGHUP", "SIGINT", "SIGTERM");
5253
5258
  if (process.platform !== "win32") {
@@ -5257,7 +5262,7 @@ if (process.platform === "linux") {
5257
5262
  signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
5258
5263
  }
5259
5264
 
5260
- // ../../node_modules/.bun/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
5265
+ // ../../node_modules/signal-exit/dist/mjs/index.js
5261
5266
  var processOk = (process3) => !!process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function";
5262
5267
  var kExitEmitter = Symbol.for("signal-exit emitter");
5263
5268
  var global = globalThis;
@@ -5455,10 +5460,10 @@ var {
5455
5460
  unload
5456
5461
  } = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback);
5457
5462
 
5458
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/screen-manager.js
5463
+ // ../../node_modules/@inquirer/core/dist/lib/screen-manager.js
5459
5464
  import { stripVTControlCharacters } from "util";
5460
5465
 
5461
- // ../../node_modules/.bun/@inquirer+ansi@2.0.7/node_modules/@inquirer/ansi/dist/index.js
5466
+ // ../../node_modules/@inquirer/ansi/dist/index.js
5462
5467
  var ESC2 = "\x1B[";
5463
5468
  var cursorLeft = ESC2 + "G";
5464
5469
  var cursorHide = ESC2 + "?25l";
@@ -5474,7 +5479,7 @@ var cursorTo = (x, y) => {
5474
5479
  var eraseLine = ESC2 + "2K";
5475
5480
  var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
5476
5481
 
5477
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/screen-manager.js
5482
+ // ../../node_modules/@inquirer/core/dist/lib/screen-manager.js
5478
5483
  var height = (content) => content.split(`
5479
5484
  `).length;
5480
5485
  var lastLine = (content) => content.split(`
@@ -5540,7 +5545,7 @@ class ScreenManager {
5540
5545
  }
5541
5546
  }
5542
5547
 
5543
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
5548
+ // ../../node_modules/@inquirer/core/dist/lib/promise-polyfill.js
5544
5549
  class PromisePolyfill extends Promise {
5545
5550
  static withResolver() {
5546
5551
  let resolve6;
@@ -5553,7 +5558,7 @@ class PromisePolyfill extends Promise {
5553
5558
  }
5554
5559
  }
5555
5560
 
5556
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/create-prompt.js
5561
+ // ../../node_modules/@inquirer/core/dist/lib/create-prompt.js
5557
5562
  import path from "path";
5558
5563
  var nativeSetImmediate = globalThis.setImmediate;
5559
5564
  function getCallSites() {
@@ -5664,7 +5669,7 @@ function createPrompt(view) {
5664
5669
  };
5665
5670
  return prompt;
5666
5671
  }
5667
- // ../../node_modules/.bun/@inquirer+core@11.2.1+7cb241fc07b679d9/node_modules/@inquirer/core/dist/lib/Separator.js
5672
+ // ../../node_modules/@inquirer/core/dist/lib/Separator.js
5668
5673
  import { styleText as styleText2 } from "util";
5669
5674
  class Separator {
5670
5675
  separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
@@ -5678,7 +5683,7 @@ class Separator {
5678
5683
  return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
5679
5684
  }
5680
5685
  }
5681
- // ../../node_modules/.bun/@inquirer+checkbox@5.2.1+7cb241fc07b679d9/node_modules/@inquirer/checkbox/dist/index.js
5686
+ // ../../node_modules/@inquirer/checkbox/dist/index.js
5682
5687
  import { styleText as styleText3 } from "util";
5683
5688
  var checkboxTheme = {
5684
5689
  icon: {
@@ -7752,6 +7757,16 @@ var recipes = [
7752
7757
  id: "starter-0.6.0-to-0.6.1",
7753
7758
  from: "0.6.0",
7754
7759
  to: "0.6.1"
7760
+ },
7761
+ {
7762
+ id: "starter-0.6.1-to-0.6.2",
7763
+ from: "0.6.1",
7764
+ to: "0.6.2"
7765
+ },
7766
+ {
7767
+ id: "starter-0.6.2-to-0.6.3",
7768
+ from: "0.6.2",
7769
+ to: "0.6.3"
7755
7770
  }
7756
7771
  ];
7757
7772
  function resolveRecipeChain(sourceVersion, targetVersion) {
@@ -10493,11 +10508,15 @@ function actionLabel(action) {
10493
10508
  }
10494
10509
 
10495
10510
  // src/update/cli.ts
10496
- async function runLifecycleCommand(args) {
10511
+ async function runLifecycleCommand(args, dependencies = {}) {
10497
10512
  const command = args[0];
10498
10513
  if (command !== "doctor" && command !== "update" && command !== "module" && command !== "sync-docker") {
10499
10514
  return false;
10500
10515
  }
10516
+ if (command === "update" && (args.includes("--help") || args.includes("-h"))) {
10517
+ (dependencies.log || console.log)(updateHelpText);
10518
+ return true;
10519
+ }
10501
10520
  const projectDirectory = resolve8(readValue3(args, "--cwd") || process.cwd());
10502
10521
  if (command === "module") {
10503
10522
  await runModuleLifecycleCommand(args.slice(1), projectDirectory);
@@ -10551,9 +10570,20 @@ async function runLifecycleCommand(args) {
10551
10570
  }
10552
10571
  return true;
10553
10572
  }
10554
- await runUpdate(args, projectDirectory);
10573
+ await (dependencies.runUpdate || runUpdate)(args, projectDirectory);
10555
10574
  return true;
10556
10575
  }
10576
+ var updateHelpText = `\u7528\u6CD5\uFF1Acreate-windy update [\u9009\u9879]
10577
+
10578
+ \u9009\u9879\uFF1A
10579
+ --check \u68C0\u67E5\u662F\u5426\u5B58\u5728\u53EF\u7528\u66F4\u65B0
10580
+ --dry-run \u751F\u6210\u8BA1\u5212\u4F46\u4E0D\u5199\u5165\u9879\u76EE\u6587\u4EF6
10581
+ --to <\u7248\u672C> \u66F4\u65B0\u5230\u6307\u5B9A\u7248\u672C
10582
+ --cwd <\u76EE\u5F55> \u6307\u5B9A\u9879\u76EE\u76EE\u5F55
10583
+ --skip-install \u66F4\u65B0\u65F6\u4E0D\u6267\u884C bun install
10584
+ --force \u5F3A\u5236\u91C7\u7528\u5E73\u53F0\u57FA\u7EBF\u53C2\u4E0E\u4E09\u65B9\u5408\u5E76
10585
+ -h, --help \u663E\u793A update \u5E2E\u52A9\u5E76\u9000\u51FA
10586
+ `;
10557
10587
  async function runUpdate(args, projectDirectory) {
10558
10588
  const template = await readTemplateMetadata(await resolveTemplateRoot());
10559
10589
  const requested = readValue3(args, "--to");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-windy",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "创建单组织、单租户、私有部署优先的 Windy 企业 Dashboard Starter",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "templateCommit": "a035c896c8821fe9a2f3ef3aca9d30b7ec1fb096",
4
- "generatorVersion": "0.6.1",
3
+ "templateCommit": "9dd151f4a0b95e2f7004aa34b97790b645e1bbb7",
4
+ "generatorVersion": "0.6.3",
5
5
  "modules": [
6
6
  {
7
7
  "name": "system",
@@ -1,2 +1,7 @@
1
1
  [workspace]
2
2
  packages = ["apps/*", "packages/*"]
3
+
4
+ # 生成项目的迁移 CLI 与原生模块在服务器和从 macOS 导入的 Linux 镜像中
5
+ # 都需要传统、可直接解析的 node_modules 布局。
6
+ [install]
7
+ linker = "hoisted"
@@ -1,6 +1,6 @@
1
1
  # syntax=docker/dockerfile:1
2
2
 
3
- FROM oven/bun:1.3.14-alpine AS deps
3
+ FROM oven/bun:1.3.14 AS deps
4
4
  WORKDIR /app
5
5
 
6
6
  COPY package.json bun.lock ./
@@ -23,12 +23,21 @@ COPY packages/server-sdk/package.json packages/server-sdk/package.json
23
23
  COPY packages/shared/package.json packages/shared/package.json
24
24
  COPY packages/storage/package.json packages/storage/package.json
25
25
  # windy-copy:deps end
26
- RUN --mount=type=cache,id=windy-bun-1.3.14,target=/root/.bun/install/cache,sharing=shared bun -e 'const child=Bun.spawn(["bun","install","--frozen-lockfile","--no-progress"],{stdin:"inherit",stdout:"inherit",stderr:"inherit"});const heartbeat=setInterval(()=>console.log("[windy] Bun 依赖安装仍在进行"),15000);const exitCode=await child.exited;clearInterval(heartbeat);process.exit(exitCode)'
26
+ RUN --mount=type=cache,id=windy-bun-1.3.14,target=/root/.bun/install/cache,sharing=shared bun -e 'const child=Bun.spawn(["bun","install","--frozen-lockfile","--no-progress","--backend=copyfile","--linker=hoisted","--ignore-scripts"],{stdin:"inherit",stdout:"inherit",stderr:"inherit"});const heartbeat=setInterval(()=>console.log("[windy] Bun 依赖安装仍在进行"),15000);const exitCode=await child.exited;clearInterval(heartbeat);process.exit(exitCode)' && bun --cwd apps/server -e 'await import("argon2")'
27
27
 
28
28
  FROM deps AS runner
29
29
  # @windy-module system.storage begin
30
- RUN apk add --no-cache libarchive=3.8.3-r0 libarchive-tools=3.8.3-r0 \
31
- && apk add --no-cache --virtual .windy-report-staging-build build-base=0.5-r3 libarchive-dev=3.8.3-r0
30
+ # The native archive helper needs a compiler. Avoid Alpine apk here: its source
31
+ # transfer can stall indefinitely under cross-architecture BuildKit emulation.
32
+ ARG WINDY_DEBIAN_MIRROR=http://deb.debian.org/debian
33
+ ARG WINDY_DEBIAN_SECURITY_MIRROR=http://deb.debian.org/debian-security
34
+ RUN set -eu; \
35
+ echo "$WINDY_DEBIAN_MIRROR" | grep -Eq '^https?://[A-Za-z0-9./:_-]+$'; \
36
+ echo "$WINDY_DEBIAN_SECURITY_MIRROR" | grep -Eq '^https?://[A-Za-z0-9./:_-]+$'; \
37
+ sed -i "s|http://deb.debian.org/debian-security|$WINDY_DEBIAN_SECURITY_MIRROR|g; s|http://deb.debian.org/debian|$WINDY_DEBIAN_MIRROR|g" /etc/apt/sources.list.d/debian.sources; \
38
+ if ! timeout --kill-after=5s 90s sh -c 'apt-get update -o Acquire::http::AllowRedirect=false -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 -o Acquire::Retries=0 && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes build-essential libarchive-dev libarchive-tools'; then \
39
+ echo "APT 包源不可用或 90 秒总时限已到:无法安装 report-staging 依赖" >&2; exit 70; \
40
+ fi
32
41
  # @windy-module system.storage end
33
42
  COPY drizzle.config.ts drizzle.config.ts
34
43
  COPY apps/server apps/server
@@ -40,7 +49,8 @@ RUN cc -std=c11 -O2 -Wall -Wextra -Werror \
40
49
  && strip /usr/local/bin/windy-report-archive-stream \
41
50
  && chown root:root /usr/local/bin/windy-report-archive-stream \
42
51
  && chmod 0555 /usr/local/bin/windy-report-archive-stream \
43
- && apk del .windy-report-staging-build
52
+ && apt-get purge --auto-remove --yes build-essential libarchive-dev \
53
+ && rm -rf /var/lib/apt/lists/*
44
54
  # @windy-module system.storage end
45
55
  COPY --chmod=0555 deploy/production/server-entrypoint.sh /usr/local/bin/windy-server-entrypoint
46
56
  RUN mkdir -p /app/data/audit /app/data/license && chown -R bun:bun /app/data
@@ -23,7 +23,7 @@ COPY packages/server-sdk/package.json packages/server-sdk/package.json
23
23
  COPY packages/shared/package.json packages/shared/package.json
24
24
  COPY packages/storage/package.json packages/storage/package.json
25
25
  # windy-copy:deps end
26
- RUN --mount=type=cache,id=windy-bun-1.3.14,target=/root/.bun/install/cache,sharing=shared bun -e 'const child=Bun.spawn(["bun","install","--frozen-lockfile","--no-progress"],{stdin:"inherit",stdout:"inherit",stderr:"inherit"});const heartbeat=setInterval(()=>console.log("[windy] Bun 依赖安装仍在进行"),15000);const exitCode=await child.exited;clearInterval(heartbeat);process.exit(exitCode)'
26
+ RUN --mount=type=cache,id=windy-bun-1.3.14,target=/root/.bun/install/cache,sharing=shared bun -e 'const child=Bun.spawn(["bun","install","--frozen-lockfile","--no-progress","--backend=copyfile","--linker=hoisted","--ignore-scripts"],{stdin:"inherit",stdout:"inherit",stderr:"inherit"});const heartbeat=setInterval(()=>console.log("[windy] Bun 依赖安装仍在进行"),15000);const exitCode=await child.exited;clearInterval(heartbeat);process.exit(exitCode)' && bun --cwd apps/server -e 'await import("argon2")'
27
27
 
28
28
  FROM deps AS build
29
29
  # windy-copy:build begin
@@ -19,6 +19,9 @@ services:
19
19
  build:
20
20
  context: .
21
21
  dockerfile: apps/server/Dockerfile
22
+ args:
23
+ WINDY_DEBIAN_MIRROR: ${WINDY_DEBIAN_MIRROR:-http://mirrors.aliyun.com/debian}
24
+ WINDY_DEBIAN_SECURITY_MIRROR: ${WINDY_DEBIAN_SECURITY_MIRROR:-http://mirrors.aliyun.com/debian-security}
22
25
  command: ["bun", "run", "db:migrate"]
23
26
  environment:
24
27
  DATABASE_URL: postgresql://windy:${POSTGRES_PASSWORD}@postgres:5432/windy
@@ -32,6 +35,9 @@ services:
32
35
  build:
33
36
  context: .
34
37
  dockerfile: apps/server/Dockerfile
38
+ args:
39
+ WINDY_DEBIAN_MIRROR: ${WINDY_DEBIAN_MIRROR:-http://mirrors.aliyun.com/debian}
40
+ WINDY_DEBIAN_SECURITY_MIRROR: ${WINDY_DEBIAN_SECURITY_MIRROR:-http://mirrors.aliyun.com/debian-security}
35
41
  command: ["bun", "run", "--cwd", "apps/server", "dev"]
36
42
  environment:
37
43
  NODE_ENV: development
@@ -100,6 +106,9 @@ services:
100
106
  build:
101
107
  context: .
102
108
  dockerfile: apps/server/Dockerfile
109
+ args:
110
+ WINDY_DEBIAN_MIRROR: ${WINDY_DEBIAN_MIRROR:-http://mirrors.aliyun.com/debian}
111
+ WINDY_DEBIAN_SECURITY_MIRROR: ${WINDY_DEBIAN_SECURITY_MIRROR:-http://mirrors.aliyun.com/debian-security}
103
112
  user: "0:0"
104
113
  command:
105
114
  [
@@ -123,6 +132,9 @@ services:
123
132
  build:
124
133
  context: .
125
134
  dockerfile: apps/server/Dockerfile
135
+ args:
136
+ WINDY_DEBIAN_MIRROR: ${WINDY_DEBIAN_MIRROR:-http://mirrors.aliyun.com/debian}
137
+ WINDY_DEBIAN_SECURITY_MIRROR: ${WINDY_DEBIAN_SECURITY_MIRROR:-http://mirrors.aliyun.com/debian-security}
126
138
  command: ["bun", "run", "apps/server/src/agent/sandbox-worker.ts"]
127
139
  environment:
128
140
  TOOL_SANDBOX_SOCKET: /run/windy-tool-sandbox/worker.sock
@@ -83,10 +83,12 @@
83
83
  "@types/bun": "^1.3.14",
84
84
  "@types/pg": "^8.20.0",
85
85
  "drizzle-kit": "^0.31.10",
86
+ "drizzle-orm": "^0.45.2",
86
87
  "husky": "^9.1.7",
87
88
  "lint-staged": "^17.1.1",
88
89
  "oxfmt": "^0.59.0",
89
90
  "oxlint": "^1.74.0",
91
+ "pg": "^8.22.0",
90
92
  "typescript": "5.9.3"
91
93
  },
92
94
  "dependencies": {}