@rebasepro/cli 0.32.0 → 0.33.1

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.
Files changed (29) hide show
  1. package/dist/{build-BfdT-AUR.js → build-E5hfEWKj.js} +13 -2
  2. package/dist/build-E5hfEWKj.js.map +1 -0
  3. package/dist/{cloud-MqnyPnmX.js → cloud-DNJyUU0T.js} +310 -120
  4. package/dist/cloud-DNJyUU0T.js.map +1 -0
  5. package/dist/codemod/collections-to-tables/customization.d.ts +5 -0
  6. package/dist/{command-D9g46gg9.js → command-Bks5xkrQ.js} +22 -3
  7. package/dist/command-Bks5xkrQ.js.map +1 -0
  8. package/dist/commands/cloud/env.d.ts +11 -1
  9. package/dist/commands/cloud/service-key.d.ts +33 -1
  10. package/dist/{doctor-2Jlau0Rm.js → doctor-FaBObSlb.js} +21 -3
  11. package/dist/doctor-FaBObSlb.js.map +1 -0
  12. package/dist/doctor-environment.d.ts +9 -0
  13. package/dist/index.es.js +9 -9
  14. package/dist/legacy-layout-DI2VeQSV.js +36 -0
  15. package/dist/legacy-layout-DI2VeQSV.js.map +1 -0
  16. package/dist/{logs-CIgfLBsu.js → logs-DpuMukJe.js} +2 -2
  17. package/dist/{logs-CIgfLBsu.js.map → logs-DpuMukJe.js.map} +1 -1
  18. package/dist/{migrate-Cx8-Y4TG.js → migrate-CSY9ZDKy.js} +3 -3
  19. package/dist/{migrate-Cx8-Y4TG.js.map → migrate-CSY9ZDKy.js.map} +1 -1
  20. package/dist/{upgrade-DhpUFb6p.js → upgrade-ZASvgxWM.js} +38 -6
  21. package/dist/{upgrade-DhpUFb6p.js.map → upgrade-ZASvgxWM.js.map} +1 -1
  22. package/dist/utils/legacy-layout.d.ts +22 -0
  23. package/package.json +10 -10
  24. package/templates/overlays/baas/backend/package.json +3 -1
  25. package/templates/template/backend/package.json +3 -1
  26. package/dist/build-BfdT-AUR.js.map +0 -1
  27. package/dist/cloud-MqnyPnmX.js.map +0 -1
  28. package/dist/command-D9g46gg9.js.map +0 -1
  29. package/dist/doctor-2Jlau0Rm.js.map +0 -1
@@ -5,6 +5,11 @@ import type { CollectionEntry, PlanContext } from "./plan-context.js";
5
5
  import type { TableName } from "./backend.js";
6
6
  /** The keys whose string value is a component path (the Vite plugin's `LAZY_COMPONENT_KEYS`). */
7
7
  export declare const COMPONENT_KEYS: Set<string>;
8
+ /**
9
+ * Said of every component the migration turns from a path into an import. One
10
+ * sentence for all of them, so the notes group into one line.
11
+ */
12
+ export declare const IMPORTED_COMPONENT_REMARK: string;
8
13
  /** Parse a lift note's key (`content[text].images[]`) into legacy literal segments. */
9
14
  export declare function noteKeySegments(key: string): {
10
15
  literal: PathSegment[];
@@ -2639,6 +2639,11 @@ var COMPONENT_KEYS = /* @__PURE__ */ new Set([
2639
2639
  "Filter",
2640
2640
  "Component"
2641
2641
  ]);
2642
+ /**
2643
+ * Said of every component the migration turns from a path into an import. One
2644
+ * sentence for all of them, so the notes group into one line.
2645
+ */
2646
+ var IMPORTED_COMPONENT_REMARK = "is imported now rather than loaded by path, so the admin's type check reads it against its slot's props (`FieldPreviewProps` for a Preview, `FieldProps` for a Field): a component that types `customProps` as its own props type fails `tsc` until it takes `unknown` and narrows it inside.";
2642
2647
  function isPlainObject(value) {
2643
2648
  if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
2644
2649
  const proto = Object.getPrototypeOf(value);
@@ -2920,7 +2925,9 @@ function printable(plan, builder, value, segments, label, attributed = false) {
2920
2925
  return new RawSource(memberFunctionText(plan.ast, member));
2921
2926
  }
2922
2927
  if (typeof value === "string" && COMPONENT_KEYS.has(String(segments[segments.length - 1])) && (value.startsWith("./") || value.startsWith("../"))) try {
2923
- return importComponent(plan, builder, value, "default", componentWriter(builder.entry, value));
2928
+ const imported = importComponent(plan, builder, value, "default", componentWriter(builder.entry, value));
2929
+ note(plan, builder.entry, `${label} ${IMPORTED_COMPONENT_REMARK}`);
2930
+ return imported;
2924
2931
  } catch (error) {
2925
2932
  refuse(plan, builder.entry, error instanceof Error ? error.message : String(error), { key: segments.join(".") });
2926
2933
  builder.failed = true;
@@ -8071,7 +8078,8 @@ function planFrontendWiring(plan, frontendDir, hasExternal) {
8071
8078
  const text = appText;
8072
8079
  const importCount = text.split(SCAFFOLD_COLLECTIONS_IMPORT).length - 1;
8073
8080
  const propCount = text.split(SCAFFOLD_COLLECTIONS_PROP).length - 1;
8074
- if (importCount === 1 && propCount === 1 && !/\bcollections\b/.test(text.replace(SCAFFOLD_COLLECTIONS_IMPORT, "").replace(SCAFFOLD_COLLECTIONS_PROP, ""))) {
8081
+ const rest = withoutComments(text.replace(SCAFFOLD_COLLECTIONS_IMPORT, "").replace(SCAFFOLD_COLLECTIONS_PROP, ""));
8082
+ if (importCount === 1 && propCount === 1 && !/\bcollections\b/.test(rest)) {
8075
8083
  const propLine = text.split("\n").find((line) => line.includes(SCAFFOLD_COLLECTIONS_PROP)) ?? "";
8076
8084
  const indent = /^[ \t]*/.exec(propLine)?.[0] ?? "";
8077
8085
  planFile(plan, appFile, text.replace(SCAFFOLD_COLLECTIONS_IMPORT, importLine).replace(SCAFFOLD_COLLECTIONS_PROP, props.join(`\n${indent}`)), "App.tsx (mount the customizations)");
@@ -8095,6 +8103,17 @@ function planFrontendWiring(plan, frontendDir, hasExternal) {
8095
8103
  });
8096
8104
  }
8097
8105
  }
8106
+ /**
8107
+ * A TSX source with its `//` and block comments blanked out.
8108
+ *
8109
+ * For one question only — does a word still occur in the code — so it may be
8110
+ * coarse: a `//` inside a string (a URL) cuts the rest of that line, which can
8111
+ * only hide a use on a line that also holds a URL, and the rewrite it guards is
8112
+ * checked by the build that follows.
8113
+ */
8114
+ function withoutComments(text) {
8115
+ return text.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/(^|[^:"'`])\/\/[^\n]*/g, "$1");
8116
+ }
8098
8117
  /** The frontend's own .ts/.tsx sources (no declaration files, no node_modules, not the generated cms/). */
8099
8118
  function frontendSourceFiles(dir) {
8100
8119
  if (!fs.existsSync(dir)) return [];
@@ -10007,4 +10026,4 @@ async function runSdkCalls(flags, dir, aliases) {
10007
10026
  //#endregion
10008
10027
  export { printCollectionsToTablesHelp, printSdkCallsHelp, runCollectionsToTables, runSdkCalls };
10009
10028
 
10010
- //# sourceMappingURL=command-D9g46gg9.js.map
10029
+ //# sourceMappingURL=command-Bks5xkrQ.js.map