@takodotid/circuit 1.0.0-rc.1 → 1.0.0-rc.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.
package/README.md CHANGED
@@ -88,9 +88,9 @@ In the editor, `"10g-49"` is an error, `10g-49 is not a port of CE6855-48S6Q-HI`
88
88
 
89
89
  ## Start
90
90
 
91
- 1. Install Circuit:
92
- - Linux and macOS: `curl -fsSL https://circuit.tako.id/install | sh`
93
- - Windows, in PowerShell: `irm https://circuit.tako.id/install.ps1 | iex`
91
+ 1. Install Circuit. Circuit v1 is a release candidate, so its installers come from its GitHub release until circuit.tako.id serves v1:
92
+ - Linux and macOS: `curl -fsSL https://github.com/takodotid/circuit/releases/download/v1.0.0-rc.2/install | sh`
93
+ - Windows, in PowerShell: `irm https://github.com/takodotid/circuit/releases/download/v1.0.0-rc.2/install.ps1 | iex`
94
94
  2. Start a project: `circuit new network`. Open its folder in VS Code. Add a site in `circuit.ts`, then write each device in `sites/<site>/<device>.ts`.
95
95
  3. Run `circuit`. It opens a menu, or runs a command straight away, such as `circuit validate`.
96
96
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takodotid/circuit",
3
- "version": "1.0.0-rc.1",
3
+ "version": "1.0.0-rc.2",
4
4
  "description": "Declarative, vendor-neutral network configuration: describe each device in TypeScript, and Circuit makes the device match. One binary, nothing to install.",
5
5
  "homepage": "https://circuit.tako.id",
6
6
  "bugs": {
package/src/cli/app.ts CHANGED
@@ -42,11 +42,15 @@ export class App {
42
42
  App.removeFromWindowsPath(folder);
43
43
  spawnSync("reg", ["delete", App.UNINSTALL_KEY, "/f"], { stdio: "ignore" });
44
44
 
45
- // Windows does not let a running program delete itself, so a separate process deletes it once this one has ended.
46
- spawn("cmd", ["/c", `ping -n 3 127.0.0.1 >nul & del /f /q "${binary}" & del /f /q "${binary}.old" & rmdir "${folder}"`], {
45
+ // Windows does not let a running program delete itself, so a separate process deletes it once this one has ended: it tries
46
+ // again until the file goes, for about ten seconds. Only cmd's own commands: a program it started, such as ping to wait,
47
+ // would open a console window. The line goes to cmd as written; quoted the usual way, cmd can't read the paths.
48
+ const remove = `del /f /q "${binary}" "${binary}.old" 2>nul & if not exist "${binary}" (rmdir "${folder}" 2>nul & exit)`;
49
+ spawn("cmd", ["/d", "/c", `for /l %i in (1,1,10000) do @(${remove})`], {
47
50
  detached: true,
48
51
  stdio: "ignore",
49
52
  windowsHide: true,
53
+ windowsVerbatimArguments: true,
50
54
  }).unref();
51
55
  } else {
52
56
  rmSync(binary, { force: true });
package/src/cli/index.ts CHANGED
@@ -27,6 +27,8 @@ class Cli {
27
27
  const command = argv[0];
28
28
  // The process that keeps remembered secrets, started after a yes to remembering them.
29
29
  if (command === SecretsAgent.COMMAND) return SecretsAgent.serve();
30
+ // This binary's own version and nothing else: no update, no project's version. The installers read it to learn which Circuit is installed.
31
+ if (command === "--version" || command === "-V") return console.log(VERSION);
30
32
  Releases.tidy();
31
33
  OnePassword.waiting = (message) => Ui.blocked(message);
32
34
 
@@ -344,7 +344,7 @@ export class Releases {
344
344
  static async updateApp(confirmed: boolean): Promise<string | undefined> {
345
345
  const binary =
346
346
  Releases.binary() ?? Ui.fail("This Circuit runs from its sources. Update it where it came from, such as with git pull.");
347
- const target = await Releases.pick(VERSION, confirmed, "Circuit");
347
+ const target = await Releases.pick(VERSION, confirmed, "The app");
348
348
  if (!target) return undefined;
349
349
 
350
350
  Releases.replace(binary, await Ui.step(`Downloading Circuit ${target}`, () => Releases.fetchBinary(target)));
@@ -1,2 +1,2 @@
1
1
  /** This Circuit's version, the same as package.json's. */
2
- export const VERSION = "1.0.0-rc.1";
2
+ export const VERSION = "1.0.0-rc.2";