@tailorkit/vite 0.1.0-beta.35 → 0.1.0-beta.36

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/builder.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { d as createTailorKitUploadManifest, f as tailorkitUploadManifestSchema, l as drizzleGenerateArguments, o as checkAppSchema, r as getClientSourceFiles, u as appDatabasePaths } from "./file-routes-QA78W6x5.mjs";
1
+ import { d as createTailorKitUploadManifest, f as tailorkitUploadManifestSchema, l as drizzleGenerateArguments, o as checkAppSchema, r as getClientSourceFiles, u as appDatabasePaths } from "./file-routes-7N97Zavb.mjs";
2
2
  import { loadTailorKitConfig } from "./config-loader.mjs";
3
3
  import { spawn } from "node:child_process";
4
4
  import { access } from "node:fs/promises";
@@ -187,6 +187,14 @@ const callScopes = (program) => {
187
187
  if (node.kind === "var") while (!target.functionScope && target.parent) target = target.parent;
188
188
  for (const declaration of node.declarations) bind(declaration.id, target);
189
189
  };
190
+ const visitFunction = (node, scope, visit) => {
191
+ if (node.type === "FunctionDeclaration") bind(node.id, scope);
192
+ const parameters = createScope(scope, true);
193
+ if (node.type !== "ArrowFunctionExpression") bind(node.id, parameters);
194
+ for (const parameter of node.params) bind(parameter, parameters);
195
+ for (const parameter of node.params) visit(parameter, parameters);
196
+ if (node.body) visit(node.body, createScope(parameters, true));
197
+ };
190
198
  const visit = (node, initialScope) => {
191
199
  let scope = initialScope;
192
200
  scopes.set(node, scope);
@@ -200,7 +208,7 @@ const callScopes = (program) => {
200
208
  case "FunctionDeclaration":
201
209
  case "FunctionExpression":
202
210
  case "ArrowFunctionExpression":
203
- visitFunction(node, scope);
211
+ visitFunction(node, scope, visit);
204
212
  return;
205
213
  case "ClassDeclaration":
206
214
  case "ClassExpression":
@@ -230,14 +238,6 @@ const callScopes = (program) => {
230
238
  }
231
239
  for (const child of childNodes(node)) visit(child, scope);
232
240
  };
233
- const visitFunction = (node, scope) => {
234
- if (node.type === "FunctionDeclaration") bind(node.id, scope);
235
- const parameters = createScope(scope, true);
236
- if (node.type !== "ArrowFunctionExpression") bind(node.id, parameters);
237
- for (const parameter of node.params) bind(parameter, parameters);
238
- for (const parameter of node.params) visit(parameter, parameters);
239
- if (node.body) visit(node.body, createScope(parameters, true));
240
- };
241
241
  visit(program, createScope(void 0, true));
242
242
  return scopes;
243
243
  };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as createDefineViewMatcher, c as getBuildEnvironment, d as createTailorKitUploadManifest, f as tailorkitUploadManifestSchema, i as inferFileView, n as fileRoutesPlugin, o as checkAppSchema, s as isMissingFile, t as createFileRouteEntry, u as appDatabasePaths } from "./file-routes-QA78W6x5.mjs";
1
+ import { a as createDefineViewMatcher, c as getBuildEnvironment, d as createTailorKitUploadManifest, f as tailorkitUploadManifestSchema, i as inferFileView, n as fileRoutesPlugin, o as checkAppSchema, s as isMissingFile, t as createFileRouteEntry, u as appDatabasePaths } from "./file-routes-7N97Zavb.mjs";
2
2
  import { loadTailorKitConfig } from "./config-loader.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import { z } from "zod";
@@ -162,6 +162,18 @@ const isFunction = (node) => [
162
162
  /** Lexical references, excluding property names and bindings local to a function/block. */
163
163
  const freeNames = (root) => {
164
164
  const references = /* @__PURE__ */ new Set();
165
+ const pattern = (node, scope, visit) => {
166
+ if (node.type === "AssignmentPattern") {
167
+ visit(node.right, scope);
168
+ pattern(node.left, scope, visit);
169
+ } else if (node.type === "ObjectPattern") for (const p of node.properties) if (p.type === "Property") {
170
+ if (p.computed) visit(p.key, scope);
171
+ pattern(p.value, scope, visit);
172
+ } else pattern(p.argument, scope, visit);
173
+ else if (node.type === "ArrayPattern") {
174
+ for (const element of node.elements) if (element) pattern(element, scope, visit);
175
+ } else if (node.type === "RestElement") pattern(node.argument, scope, visit);
176
+ };
165
177
  const visit = (node, parent) => {
166
178
  if (node.type === "Identifier") {
167
179
  if (!parent.has(node.name)) references.add(node.name);
@@ -184,7 +196,7 @@ const freeNames = (root) => {
184
196
  for (const child of children(body)) hoisted(child);
185
197
  };
186
198
  if (node.body) hoisted(node.body);
187
- for (const p of node.params) pattern(p, scope);
199
+ for (const p of node.params) pattern(p, scope, visit);
188
200
  if (node.body) visit(node.body, scope);
189
201
  return;
190
202
  }
@@ -194,7 +206,7 @@ const freeNames = (root) => {
194
206
  return;
195
207
  }
196
208
  if (node.type === "VariableDeclarator") {
197
- pattern(node.id, parent);
209
+ pattern(node.id, parent, visit);
198
210
  if (node.init) visit(node.init, parent);
199
211
  return;
200
212
  }
@@ -210,7 +222,7 @@ const freeNames = (root) => {
210
222
  }
211
223
  if (node.type === "CatchClause") {
212
224
  const scope = /* @__PURE__ */ new Set([...parent, ...boundNames(node.param)]);
213
- if (node.param) pattern(node.param, scope);
225
+ if (node.param) pattern(node.param, scope, visit);
214
226
  visit(node.body, scope);
215
227
  return;
216
228
  }
@@ -233,18 +245,6 @@ const freeNames = (root) => {
233
245
  if (node.type === "BreakStatement" || node.type === "ContinueStatement") return;
234
246
  for (const child of children(node)) visit(child, parent);
235
247
  };
236
- const pattern = (node, scope) => {
237
- if (node.type === "AssignmentPattern") {
238
- visit(node.right, scope);
239
- pattern(node.left, scope);
240
- } else if (node.type === "ObjectPattern") for (const p of node.properties) if (p.type === "Property") {
241
- if (p.computed) visit(p.key, scope);
242
- pattern(p.value, scope);
243
- } else pattern(p.argument, scope);
244
- else if (node.type === "ArrayPattern") {
245
- for (const element of node.elements) if (element) pattern(element, scope);
246
- } else if (node.type === "RestElement") pattern(node.argument, scope);
247
- };
248
248
  visit(root, /* @__PURE__ */ new Set());
249
249
  return references;
250
250
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailorkit/vite",
3
- "version": "0.1.0-beta.35",
3
+ "version": "0.1.0-beta.36",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,7 +43,7 @@
43
43
  "access": "public"
44
44
  },
45
45
  "dependencies": {
46
- "@tailorkit/app": "0.1.0-beta.35",
46
+ "@tailorkit/app": "0.1.0-beta.36",
47
47
  "cosmiconfig": "^10.0.1",
48
48
  "zod": "^4.6.5"
49
49
  },