ignotum 0.0.17 → 0.0.18

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/bin.mjs CHANGED
@@ -30914,7 +30914,7 @@ var IdGenerator = class IdGenerator extends Context.Service()("@ignotum/shared/i
30914
30914
  };
30915
30915
  //#endregion
30916
30916
  //#region package.json
30917
- var version$1 = "0.0.17";
30917
+ var version$1 = "0.0.18";
30918
30918
  //#endregion
30919
30919
  //#region ../shared/dist/routing/pattern.js
30920
30920
  var RoutingDefinitionError = class extends Schema.TaggedError()("RoutingDefinitionError", {
@@ -31274,6 +31274,12 @@ const generate = Effect.fn("Codegen.generate")(function* (appDirectory) {
31274
31274
  };
31275
31275
  });
31276
31276
  //#endregion
31277
+ //#region src/cli/path.ts
31278
+ const PathContainment = { contains(path, directory, child) {
31279
+ const relative = path.relative(directory, child);
31280
+ return relative === "" || !path.isAbsolute(relative) && relative !== ".." && !relative.startsWith(`..${path.sep}`);
31281
+ } };
31282
+ //#endregion
31277
31283
  //#region src/cli/route-static.ts
31278
31284
  var InvalidRouteSource = class extends Schema.TaggedError()("InvalidRouteSource", {
31279
31285
  path: Schema.String,
@@ -31346,7 +31352,7 @@ const createRouteExtractor = Effect.fn("Routes.createExtractor")(function* (appD
31346
31352
  source: ""
31347
31353
  }, { start: 0 }, "module", detail);
31348
31354
  const real = yield* fs.realPath(file).pipe(Effect.mapError(() => fail("Cannot read source module.")));
31349
- if (!real.startsWith(`${appDirectory}/`) || real.startsWith(`${appDirectory}/server/`) || !/\.(ts|tsx)$/.test(real) || real.endsWith(".d.ts")) return yield* fail("Static configuration must come from TypeScript app modules outside server/.");
31355
+ if (!PathContainment.contains(path, appDirectory, real) || PathContainment.contains(path, path.join(appDirectory, "server"), real) || !/\.(ts|tsx)$/.test(real) || real.endsWith(".d.ts")) return yield* fail("Static configuration must come from TypeScript app modules outside server/.");
31350
31356
  dependencies.add(real);
31351
31357
  const cached = modules.get(real);
31352
31358
  if (cached !== void 0) return cached;
@@ -31694,7 +31700,7 @@ const discoverClientRoutes = Effect.fn("Routes.discoverClientRoutes")(function*
31694
31700
  const seen = /* @__PURE__ */ new Set();
31695
31701
  const visit = Effect.fn("Routes.visitDirectory")(function* (directory) {
31696
31702
  const real = yield* fs.realPath(directory).pipe(Effect.mapError(() => diagnostic(directory, "Cannot read route directory.")));
31697
- if (real !== clientDirectory && !real.startsWith(`${clientDirectory}/`)) return yield* diagnostic(directory, "Route trees cannot escape client/ through symlinks.");
31703
+ if (!PathContainment.contains(path, clientDirectory, real)) return yield* diagnostic(directory, "Route trees cannot escape client/ through symlinks.");
31698
31704
  if (seen.has(real)) return yield* diagnostic(directory, "Repeated or cyclic route directory.");
31699
31705
  seen.add(real);
31700
31706
  const entries = yield* fs.readDirectory(directory).pipe(Effect.mapError(() => diagnostic(directory, "Cannot read route directory.")));
@@ -48025,7 +48031,7 @@ const dev = Command.make("dev", {
48025
48031
  })));
48026
48032
  })).pipe(Command.withDescription("Run the local Ignotum development server."), Command.withSubcommands([devDatabase]));
48027
48033
  const deploy = Command.make("deploy", {
48028
- resume: Flag.boolean("resume").pipe(Flag.withDescription("Resume the saved upload or activation.")),
48034
+ resume: Flag.boolean("resume").pipe(Flag.withDescription("Resume the saved upload or activation."), Flag.withDefault(false)),
48029
48035
  app: Flag.string("app").pipe(Flag.withDescription("Create or link this app slug on the first deploy."), Flag.withSchema(AppSlug), Flag.optional)
48030
48036
  }, Effect.fn("deploy")(function* ({ app, resume }) {
48031
48037
  const path = yield* Path$1.Path;