@boon4681/giri 0.0.2-alpha-3 → 0.0.2-alpha-5

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
@@ -729,20 +729,13 @@ function resolveAliasTarget(cwd, target, capture = "") {
729
729
  }
730
730
  function matchAlias(request, key) {
731
731
  if (key.includes("*")) {
732
- const [prefix2, suffix = ""] = key.split("*");
733
- if (request.startsWith(prefix2) && request.endsWith(suffix)) {
734
- return request.slice(prefix2.length, request.length - suffix.length);
732
+ const [prefix, suffix = ""] = key.split("*");
733
+ if (request.startsWith(prefix) && request.endsWith(suffix)) {
734
+ return request.slice(prefix.length, request.length - suffix.length);
735
735
  }
736
736
  return void 0;
737
737
  }
738
- if (request === key) {
739
- return "";
740
- }
741
- const prefix = `${key}/`;
742
- if (request.startsWith(prefix)) {
743
- return request.slice(prefix.length);
744
- }
745
- return void 0;
738
+ return request === key ? "" : void 0;
746
739
  }
747
740
  function resolveAliasRequest(request, alias, cwd) {
748
741
  for (const [key, value] of Object.entries(alias ?? {})) {
@@ -2052,12 +2045,13 @@ async function serveProject(config, flags) {
2052
2045
  `synced ${initial.routes.length} route${initial.routes.length === 1 ? "" : "s"} ${muted(`at ${initial.paths.outDir}`)}`,
2053
2046
  "sync"
2054
2047
  );
2048
+ const closers = [];
2049
+ closers.push(registerAliasResolver(cfg.alias, initial.paths.cwd));
2055
2050
  const lifecycle = await loadLifecycle();
2056
2051
  const services = await runInit(lifecycle);
2057
2052
  let current = await buildGiriApp(cfg, { services });
2058
2053
  const port = flags.port ?? cfg.server?.port ?? 3e3;
2059
2054
  const hostname = flags.hostname ?? cfg.server?.hostname;
2060
- const closers = [];
2061
2055
  if (flags.watch) {
2062
2056
  const srcDir = (0, import_node_path15.resolve)(current.paths.routesDir, "..");
2063
2057
  if ((0, import_node_fs9.existsSync)(srcDir)) {