@rebasepro/cli 0.31.0 → 0.33.0

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 (196) hide show
  1. package/dist/{agent-setup-DqAcoDcn.js → agent-setup-Cg_zBWoW.js} +3 -3
  2. package/dist/{agent-setup-DqAcoDcn.js.map → agent-setup-Cg_zBWoW.js.map} +1 -1
  3. package/dist/api-TbmW33D7.js +275 -0
  4. package/dist/api-TbmW33D7.js.map +1 -0
  5. package/dist/{api-keys-eIUjMqWn.js → api-keys-fPQ55DCm.js} +151 -158
  6. package/dist/api-keys-fPQ55DCm.js.map +1 -0
  7. package/dist/{apps-DExO4PEl.js → apps-DBTRoOeP.js} +18 -13
  8. package/dist/apps-DBTRoOeP.js.map +1 -0
  9. package/dist/{args-CaCcrYE1.js → args-DHyrshtI.js} +3 -132
  10. package/dist/args-DHyrshtI.js.map +1 -0
  11. package/dist/{atlas-dev-database-DOCKk6ht.js → atlas-dev-database-D6h65f2x.js} +3 -3
  12. package/dist/{atlas-dev-database-DOCKk6ht.js.map → atlas-dev-database-D6h65f2x.js.map} +1 -1
  13. package/dist/{auth-ofQETpM5.js → auth-BpyYLEFY.js} +93 -12
  14. package/dist/auth-BpyYLEFY.js.map +1 -0
  15. package/dist/auth-session-B6aT0Dyj.js +371 -0
  16. package/dist/auth-session-B6aT0Dyj.js.map +1 -0
  17. package/dist/{backend-guard-C0mVkXBw.js → backend-guard-Cf8eMK_f.js} +2 -2
  18. package/dist/{backend-guard-C0mVkXBw.js.map → backend-guard-Cf8eMK_f.js.map} +1 -1
  19. package/dist/{branch-pointer-DMPyvZoK.js → branch-pointer-BJOF2Ubv.js} +1 -1
  20. package/dist/{build-CA5R07tw.js → build-E5hfEWKj.js} +23 -10
  21. package/dist/build-E5hfEWKj.js.map +1 -0
  22. package/dist/{bundle-DgILeA5b.js → bundle-CIiKGrte.js} +78 -12
  23. package/dist/bundle-CIiKGrte.js.map +1 -0
  24. package/dist/bundle.d.ts +31 -1
  25. package/dist/{cloud-CYMk92iG.js → cloud-DNJyUU0T.js} +1715 -1516
  26. package/dist/cloud-DNJyUU0T.js.map +1 -0
  27. package/dist/{cms-directories-BK3vcswg.js → cms-directories-BaV-Is9a.js} +2 -2
  28. package/dist/{cms-directories-BK3vcswg.js.map → cms-directories-BaV-Is9a.js.map} +1 -1
  29. package/dist/codemod/collections-to-tables/backend.d.ts +0 -2
  30. package/dist/codemod/collections-to-tables/customization.d.ts +7 -1
  31. package/dist/codemod/collections-to-tables/modules.d.ts +32 -0
  32. package/dist/codemod/collections-to-tables/plan-context.d.ts +7 -1
  33. package/dist/{command-D5lhW_-B.js → command-Bks5xkrQ.js} +89 -44
  34. package/dist/command-Bks5xkrQ.js.map +1 -0
  35. package/dist/commands/api-keys.d.ts +89 -52
  36. package/dist/commands/api.d.ts +114 -0
  37. package/dist/commands/auth-session.d.ts +94 -0
  38. package/dist/commands/auth.d.ts +1 -1
  39. package/dist/commands/cloud/alerts.d.ts +29 -0
  40. package/dist/commands/cloud/context.d.ts +8 -0
  41. package/dist/commands/cloud/debug.d.ts +16 -1
  42. package/dist/commands/cloud/deploy-hooks.d.ts +19 -0
  43. package/dist/commands/cloud/deploy.d.ts +25 -0
  44. package/dist/commands/cloud/env.d.ts +12 -1
  45. package/dist/commands/cloud/index.d.ts +5 -0
  46. package/dist/commands/cloud/maintenance.d.ts +26 -1
  47. package/dist/commands/cloud/not-served.d.ts +27 -0
  48. package/dist/commands/cloud/orgs.d.ts +5 -0
  49. package/dist/commands/cloud/resources.d.ts +82 -2
  50. package/dist/commands/cloud/runtime-logs.d.ts +57 -0
  51. package/dist/commands/cloud/service-key.d.ts +33 -1
  52. package/dist/commands/cloud/settings.d.ts +3 -0
  53. package/dist/commands/cron.d.ts +68 -0
  54. package/dist/commands/data.d.ts +197 -0
  55. package/dist/commands/functions.d.ts +38 -0
  56. package/dist/commands/logs.d.ts +22 -0
  57. package/dist/commands/rls.d.ts +31 -0
  58. package/dist/commands/schema-reconcile.d.ts +2 -1
  59. package/dist/commands/schema-show.d.ts +38 -0
  60. package/dist/commands/storage-objects.d.ts +88 -0
  61. package/dist/commands/storage.d.ts +18 -2
  62. package/dist/commands/users.d.ts +147 -0
  63. package/dist/{consent-BXLIrMl8.js → consent-UV6ObCME.js} +2 -2
  64. package/dist/{consent-BXLIrMl8.js.map → consent-UV6ObCME.js.map} +1 -1
  65. package/dist/{console-DjThnr3f.js → console-BVoYOLAO.js} +6 -6
  66. package/dist/{console-DjThnr3f.js.map → console-BVoYOLAO.js.map} +1 -1
  67. package/dist/{context--JwaHaZp.js → context-BOMEoKxn.js} +80 -9
  68. package/dist/{context--JwaHaZp.js.map → context-BOMEoKxn.js.map} +1 -1
  69. package/dist/cron-CpUsQ739.js +298 -0
  70. package/dist/cron-CpUsQ739.js.map +1 -0
  71. package/dist/cron-ZRXsla0v.js +259 -0
  72. package/dist/cron-ZRXsla0v.js.map +1 -0
  73. package/dist/{daemon-w30PsdwV.js → daemon-D5gdG7gx.js} +3 -3
  74. package/dist/{daemon-w30PsdwV.js.map → daemon-D5gdG7gx.js.map} +1 -1
  75. package/dist/{daemon-entry-zOC1revO.js → daemon-entry--ummUJnk.js} +2 -2
  76. package/dist/{daemon-entry-zOC1revO.js.map → daemon-entry--ummUJnk.js.map} +1 -1
  77. package/dist/data-BJ9AZFUC.js +947 -0
  78. package/dist/data-BJ9AZFUC.js.map +1 -0
  79. package/dist/{db-Bz2RFGJj.js → db-D_iF4E-v.js} +38 -34
  80. package/dist/{db-Bz2RFGJj.js.map → db-D_iF4E-v.js.map} +1 -1
  81. package/dist/debug-nNbbxAeo.js +1114 -0
  82. package/dist/debug-nNbbxAeo.js.map +1 -0
  83. package/dist/{derive-C3ezmY-p.js → derive-Mky_u59_.js} +3 -3
  84. package/dist/{derive-C3ezmY-p.js.map → derive-Mky_u59_.js.map} +1 -1
  85. package/dist/{dev-D8TxrE_I.js → dev-bj6dEeSQ.js} +13 -13
  86. package/dist/{dev-D8TxrE_I.js.map → dev-bj6dEeSQ.js.map} +1 -1
  87. package/dist/dev-db/pull.d.ts +13 -3
  88. package/dist/{dev-preflight-DjvcV6SK.js → dev-preflight-BMOf2N6r.js} +2 -2
  89. package/dist/{dev-preflight-DjvcV6SK.js.map → dev-preflight-BMOf2N6r.js.map} +1 -1
  90. package/dist/{dev-server-BLxCbQEP.js → dev-server-2XHSHM_q.js} +2 -2
  91. package/dist/{dev-server-BLxCbQEP.js.map → dev-server-2XHSHM_q.js.map} +1 -1
  92. package/dist/{doctor-Du-mSxoE.js → doctor-FaBObSlb.js} +29 -10
  93. package/dist/doctor-FaBObSlb.js.map +1 -0
  94. package/dist/doctor-environment.d.ts +9 -0
  95. package/dist/{eject-Bhzd6hgb.js → eject-DK_M9kor.js} +4 -4
  96. package/dist/{eject-Bhzd6hgb.js.map → eject-DK_M9kor.js.map} +1 -1
  97. package/dist/{fold-static-CKewnAPX.js → fold-static-2t3UUX4z.js} +10 -6
  98. package/dist/fold-static-2t3UUX4z.js.map +1 -0
  99. package/dist/fold-static.d.ts +7 -0
  100. package/dist/functions-B4JR6EZL.js +120 -0
  101. package/dist/functions-B4JR6EZL.js.map +1 -0
  102. package/dist/{generate-view-CTOluXvH.js → generate-view-BMaLQm8H.js} +5 -5
  103. package/dist/{generate-view-CTOluXvH.js.map → generate-view-BMaLQm8H.js.map} +1 -1
  104. package/dist/{generate_sdk-De-aLC1L.js → generate_sdk-ByD-gTsK.js} +7 -7
  105. package/dist/{generate_sdk-De-aLC1L.js.map → generate_sdk-ByD-gTsK.js.map} +1 -1
  106. package/dist/index.es.js +123 -47
  107. package/dist/index.es.js.map +1 -1
  108. package/dist/{init-Dtl-IcXf.js → init-DHCe5mJ5.js} +59 -11
  109. package/dist/init-DHCe5mJ5.js.map +1 -0
  110. package/dist/{invoked-command-CG_rIa_o.js → invoked-command-FBeIBS8o.js} +2 -2
  111. package/dist/{invoked-command-CG_rIa_o.js.map → invoked-command-FBeIBS8o.js.map} +1 -1
  112. package/dist/last-dev-database-CBVkEUEl.js +2 -0
  113. package/dist/legacy-layout-DI2VeQSV.js +36 -0
  114. package/dist/legacy-layout-DI2VeQSV.js.map +1 -0
  115. package/dist/logs-DpuMukJe.js +192 -0
  116. package/dist/logs-DpuMukJe.js.map +1 -0
  117. package/dist/{manifest-C3uLDrrJ.js → manifest-RjqxfCpb.js} +114 -5
  118. package/dist/manifest-RjqxfCpb.js.map +1 -0
  119. package/dist/{migrate-VrKoi3nB.js → migrate-CSY9ZDKy.js} +5 -4
  120. package/dist/{migrate-VrKoi3nB.js.map → migrate-CSY9ZDKy.js.map} +1 -1
  121. package/dist/{normalize-imports-DwxqEMYq.js → normalize-imports-P86NVfpo.js} +3 -3
  122. package/dist/{normalize-imports-DwxqEMYq.js.map → normalize-imports-P86NVfpo.js.map} +1 -1
  123. package/dist/{path-flags-7O5uPBcQ.js → path-flags-ekLdkbra.js} +3 -3
  124. package/dist/{path-flags-7O5uPBcQ.js.map → path-flags-ekLdkbra.js.map} +1 -1
  125. package/dist/{prepare-Ccxspoj-.js → prepare-BaJe0Zik.js} +4 -4
  126. package/dist/{prepare-Ccxspoj-.js.map → prepare-BaJe0Zik.js.map} +1 -1
  127. package/dist/{project-CLcF5i8c.js → project-DALmhb5R.js} +2 -2
  128. package/dist/{project-CLcF5i8c.js.map → project-DALmhb5R.js.map} +1 -1
  129. package/dist/project-command-Cl9EZzjr.js +662 -0
  130. package/dist/project-command-Cl9EZzjr.js.map +1 -0
  131. package/dist/{project-schema-CsSOG2gE.js → project-schema-Dm6Jk0Y_.js} +4 -2
  132. package/dist/{project-schema-CsSOG2gE.js.map → project-schema-Dm6Jk0Y_.js.map} +1 -1
  133. package/dist/{pull-BMuiUyjb.js → pull-CTIsST6T.js} +66 -5
  134. package/dist/pull-CTIsST6T.js.map +1 -0
  135. package/dist/resolve-C36px9tR.js +2 -0
  136. package/dist/{resources-Dpfs2y8P.js → resources-Db3USuPO.js} +5 -5
  137. package/dist/{resources-Dpfs2y8P.js.map → resources-Db3USuPO.js.map} +1 -1
  138. package/dist/rls-BxrQ0P50.js +133 -0
  139. package/dist/rls-BxrQ0P50.js.map +1 -0
  140. package/dist/{schema-Dv6nHkb0.js → schema-_FzZEoB8.js} +54 -40
  141. package/dist/schema-_FzZEoB8.js.map +1 -0
  142. package/dist/{schema-dir-Cd1kvYbf.js → schema-dir-ChcYfWjP.js} +2 -2
  143. package/dist/{schema-dir-Cd1kvYbf.js.map → schema-dir-ChcYfWjP.js.map} +1 -1
  144. package/dist/schema-reconcile-DV14XY4o.js +2 -0
  145. package/dist/schema-show-h72UJ9zH.js +127 -0
  146. package/dist/schema-show-h72UJ9zH.js.map +1 -0
  147. package/dist/{skills-CXjA9TWw.js → skills-DQ2bZGkj.js} +6 -5
  148. package/dist/{skills-CXjA9TWw.js.map → skills-DQ2bZGkj.js.map} +1 -1
  149. package/dist/star-nudge.d.ts +28 -0
  150. package/dist/{start-Bwbtt2W5.js → start-Cjx4W0bJ.js} +7 -7
  151. package/dist/{start-Bwbtt2W5.js.map → start-Cjx4W0bJ.js.map} +1 -1
  152. package/dist/{status-BTgTWzlQ.js → status-CDBk25VO.js} +9 -9
  153. package/dist/{status-BTgTWzlQ.js.map → status-CDBk25VO.js.map} +1 -1
  154. package/dist/{storage-iTqj5-Av.js → storage-Clc8dLG8.js} +79 -36
  155. package/dist/storage-Clc8dLG8.js.map +1 -0
  156. package/dist/storage-objects-CfRKlTDe.js +279 -0
  157. package/dist/storage-objects-CfRKlTDe.js.map +1 -0
  158. package/dist/{telemetry-BP_1Cl9r.js → telemetry-DZU2-NCm.js} +5 -4
  159. package/dist/{telemetry-BP_1Cl9r.js.map → telemetry-DZU2-NCm.js.map} +1 -1
  160. package/dist/{telemetry-M3HjlyhZ.js → telemetry-EVtASbKb.js} +2 -2
  161. package/dist/{telemetry-M3HjlyhZ.js.map → telemetry-EVtASbKb.js.map} +1 -1
  162. package/dist/unknown-command-DnZ2uhGs.js +139 -0
  163. package/dist/unknown-command-DnZ2uhGs.js.map +1 -0
  164. package/dist/{upgrade-oZzJ13jM.js → upgrade-ZASvgxWM.js} +41 -9
  165. package/dist/{upgrade-oZzJ13jM.js.map → upgrade-ZASvgxWM.js.map} +1 -1
  166. package/dist/users-5PkqBY6R.js +561 -0
  167. package/dist/users-5PkqBY6R.js.map +1 -0
  168. package/dist/utils/legacy-layout.d.ts +22 -0
  169. package/dist/utils/project-command.d.ts +38 -0
  170. package/dist/utils/project-target.d.ts +193 -0
  171. package/dist/{verify-BkUVGLqo.js → verify-BdeqNb-V.js} +138 -12
  172. package/dist/verify-BdeqNb-V.js.map +1 -0
  173. package/dist/{version-Buyyo1ut.js → version-ONIeo7jl.js} +7 -2
  174. package/dist/{version-Buyyo1ut.js.map → version-ONIeo7jl.js.map} +1 -1
  175. package/package.json +10 -10
  176. package/templates/overlays/baas/backend/package.json +3 -1
  177. package/templates/template/backend/package.json +3 -1
  178. package/dist/api-keys-eIUjMqWn.js.map +0 -1
  179. package/dist/apps-DExO4PEl.js.map +0 -1
  180. package/dist/args-CaCcrYE1.js.map +0 -1
  181. package/dist/auth-ofQETpM5.js.map +0 -1
  182. package/dist/build-CA5R07tw.js.map +0 -1
  183. package/dist/bundle-DgILeA5b.js.map +0 -1
  184. package/dist/cloud-CYMk92iG.js.map +0 -1
  185. package/dist/command-D5lhW_-B.js.map +0 -1
  186. package/dist/doctor-Du-mSxoE.js.map +0 -1
  187. package/dist/fold-static-CKewnAPX.js.map +0 -1
  188. package/dist/init-Dtl-IcXf.js.map +0 -1
  189. package/dist/last-dev-database-Dc8cP01o.js +0 -2
  190. package/dist/manifest-C3uLDrrJ.js.map +0 -1
  191. package/dist/pull-BMuiUyjb.js.map +0 -1
  192. package/dist/resolve-BY7bSFRT.js +0 -2
  193. package/dist/schema-Dv6nHkb0.js.map +0 -1
  194. package/dist/schema-reconcile-CjxLaRHB.js +0 -2
  195. package/dist/storage-iTqj5-Av.js.map +0 -1
  196. package/dist/verify-BkUVGLqo.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { b as loadManifest } from "./manifest-C3uLDrrJ.js";
1
+ import { b as loadManifest } from "./manifest-RjqxfCpb.js";
2
2
  import fs from "fs";
3
3
  import path from "path";
4
4
  //#region src/utils/cms-directories.ts
@@ -30,4 +30,4 @@ function cmsDirectories(projectRoot) {
30
30
  //#endregion
31
31
  export { cmsDirectories as t };
32
32
 
33
- //# sourceMappingURL=cms-directories-BK3vcswg.js.map
33
+ //# sourceMappingURL=cms-directories-BaV-Is9a.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cms-directories-BK3vcswg.js","names":[],"sources":["../src/utils/cms-directories.ts"],"sourcesContent":["/**\n * Where a project keeps its table customizations.\n *\n * Its own module, outside `commands/`: the bundler reads it too, and nothing\n * under `commands/` may sit on the CLI's startup import graph\n * (`cli-startup-imports.test.ts`).\n */\nimport fs from \"fs\";\nimport path from \"path\";\nimport { loadManifest } from \"../manifest\";\n\n/**\n * The directories that hold the project's table customizations: `src/cms` of\n * each static app `rebase.json` declares, and `frontend/src/cms`, the layout\n * `rebase init` writes. Only those that exist; none for a headless project.\n */\nexport function cmsDirectories(projectRoot: string): string[] {\n const roots = new Set<string>([\"frontend\"]);\n try {\n const { manifest } = loadManifest(projectRoot);\n for (const app of Object.values(manifest.apps)) {\n if (app.type === \"static\" && typeof app.root === \"string\") roots.add(app.root);\n }\n } catch {\n // No rebase.json, or one another command reports: the conventional layout.\n }\n const out: string[] = [];\n for (const root of roots) {\n const dir = path.resolve(projectRoot, root, \"src\", \"cms\");\n if (fs.existsSync(dir) && fs.statSync(dir).isDirectory() && !out.includes(dir)) out.push(dir);\n }\n return out;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAgB,eAAe,aAA+B;CAC1D,MAAM,wBAAQ,IAAI,IAAY,CAAC,UAAU,CAAC;CAC1C,IAAI;EACA,MAAM,EAAE,aAAa,aAAa,WAAW;EAC7C,KAAK,MAAM,OAAO,OAAO,OAAO,SAAS,IAAI,GACzC,IAAI,IAAI,SAAS,YAAY,OAAO,IAAI,SAAS,UAAU,MAAM,IAAI,IAAI,IAAI;CAErF,QAAQ,CAER;CACA,MAAM,MAAgB,CAAC;CACvB,KAAK,MAAM,QAAQ,OAAO;EACtB,MAAM,MAAM,KAAK,QAAQ,aAAa,MAAM,OAAO,KAAK;EACxD,IAAI,GAAG,WAAW,GAAG,KAAK,GAAG,SAAS,GAAG,CAAC,CAAC,YAAY,KAAK,CAAC,IAAI,SAAS,GAAG,GAAG,IAAI,KAAK,GAAG;CAChG;CACA,OAAO;AACX"}
1
+ {"version":3,"file":"cms-directories-BaV-Is9a.js","names":[],"sources":["../src/utils/cms-directories.ts"],"sourcesContent":["/**\n * Where a project keeps its table customizations.\n *\n * Its own module, outside `commands/`: the bundler reads it too, and nothing\n * under `commands/` may sit on the CLI's startup import graph\n * (`cli-startup-imports.test.ts`).\n */\nimport fs from \"fs\";\nimport path from \"path\";\nimport { loadManifest } from \"../manifest\";\n\n/**\n * The directories that hold the project's table customizations: `src/cms` of\n * each static app `rebase.json` declares, and `frontend/src/cms`, the layout\n * `rebase init` writes. Only those that exist; none for a headless project.\n */\nexport function cmsDirectories(projectRoot: string): string[] {\n const roots = new Set<string>([\"frontend\"]);\n try {\n const { manifest } = loadManifest(projectRoot);\n for (const app of Object.values(manifest.apps)) {\n if (app.type === \"static\" && typeof app.root === \"string\") roots.add(app.root);\n }\n } catch {\n // No rebase.json, or one another command reports: the conventional layout.\n }\n const out: string[] = [];\n for (const root of roots) {\n const dir = path.resolve(projectRoot, root, \"src\", \"cms\");\n if (fs.existsSync(dir) && fs.statSync(dir).isDirectory() && !out.includes(dir)) out.push(dir);\n }\n return out;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAgB,eAAe,aAA+B;CAC1D,MAAM,wBAAQ,IAAI,IAAY,CAAC,UAAU,CAAC;CAC1C,IAAI;EACA,MAAM,EAAE,aAAa,aAAa,WAAW;EAC7C,KAAK,MAAM,OAAO,OAAO,OAAO,SAAS,IAAI,GACzC,IAAI,IAAI,SAAS,YAAY,OAAO,IAAI,SAAS,UAAU,MAAM,IAAI,IAAI,IAAI;CAErF,QAAQ,CAER;CACA,MAAM,MAAgB,CAAC;CACvB,KAAK,MAAM,QAAQ,OAAO;EACtB,MAAM,MAAM,KAAK,QAAQ,aAAa,MAAM,OAAO,KAAK;EACxD,IAAI,GAAG,WAAW,GAAG,KAAK,GAAG,SAAS,GAAG,CAAC,CAAC,YAAY,KAAK,CAAC,IAAI,SAAS,GAAG,GAAG,IAAI,KAAK,GAAG;CAChG;CACA,OAAO;AACX"}
@@ -34,5 +34,3 @@ export interface BackendPlanInput {
34
34
  export declare function nameTables(entries: readonly CollectionEntry[], defs: readonly (AnyTableDef | AnyViewDef)[], schemaDir: string): Map<string, TableName>;
35
35
  /** Plan the backend schema modules. */
36
36
  export declare function planBackend(plan: PlanContext, input: BackendPlanInput, names: Map<string, TableName>): void;
37
- /** The relative module path of a table, from a file in another directory. */
38
- export declare function tableImportPath(fromFile: string, table: TableName): string;
@@ -1,9 +1,15 @@
1
1
  import type { LegacyEnumValues, LiftNote } from "@rebasepro/common/migrate";
2
2
  import type { PathSegment } from "./ast.js";
3
+ import { type GeneratedSpecifierStyle } from "./modules.js";
3
4
  import type { CollectionEntry, PlanContext } from "./plan-context.js";
4
5
  import type { TableName } from "./backend.js";
5
6
  /** The keys whose string value is a component path (the Vite plugin's `LAZY_COMPONENT_KEYS`). */
6
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;
7
13
  /** Parse a lift note's key (`content[text].images[]`) into legacy literal segments. */
8
14
  export declare function noteKeySegments(key: string): {
9
15
  literal: PathSegment[];
@@ -44,4 +50,4 @@ export declare function printCmsIndex(cmsDir: string, customizations: readonly {
44
50
  }[], external: readonly {
45
51
  identifier: string;
46
52
  file: string;
47
- }[]): string;
53
+ }[], style: GeneratedSpecifierStyle): string;
@@ -1,3 +1,4 @@
1
+ import type { SourceFile } from "ts-morph";
1
2
  import type { AstContext, ImportUse } from "./ast.js";
2
3
  /** Which side of the split a file lives on. */
3
4
  export type Side = "backend" | "frontend";
@@ -18,6 +19,37 @@ export interface ResolvedSpecifier {
18
19
  export declare function resolveRelative(fromFile: string, specifier: string): ResolvedSpecifier;
19
20
  /** A relative specifier from `fromFile` to `target`, written in `style`. */
20
21
  export declare function writeSpecifier(fromFile: string, target: string, style: SpecifierStyle): string;
22
+ /**
23
+ * How the relative imports the codemod writes itself end — the schema index,
24
+ * a table's import of a related table, a customization's type import of its
25
+ * table: `"js"` (`./users.js`) or `"extensionless"` (`./users`).
26
+ *
27
+ * A project whose backend is built with a plain `tsc` (NodeNext) and run on
28
+ * Node needs `"js"`: Node's ESM loader resolves no relative import without
29
+ * its extension. `rebase build` and tsx resolve either spelling.
30
+ */
31
+ export type GeneratedSpecifierStyle = "js" | "extensionless";
32
+ /**
33
+ * The {@link GeneratedSpecifierStyle} of a project, from the module specifiers
34
+ * its legacy collection sources write (the collection files and the
35
+ * collections index): `"js"` when more of their relative specifiers end in
36
+ * a JavaScript extension (`./users.js`) than in none (`./users`, `../lib`);
37
+ * `"extensionless"`, the house style, otherwise — a tie, or no relative
38
+ * import at all. A specifier with another extension (`./labels.json`,
39
+ * `./users.schema`) says nothing either way.
40
+ *
41
+ * @param specifiers every module specifier the sources import or re-export from, package names included
42
+ */
43
+ export declare function projectSpecifierStyle(specifiers: readonly string[]): GeneratedSpecifierStyle;
44
+ /** The module specifiers a file imports and re-exports from, as written. */
45
+ export declare function writtenSpecifiers(sourceFile: SourceFile): string[];
46
+ /**
47
+ * The relative specifier of an import the codemod writes, from `fromFile` to
48
+ * the module `target`, in the project's {@link GeneratedSpecifierStyle}: for
49
+ * `users.ts`, `./users` or `./users.js`. A JavaScript target keeps its own
50
+ * extension in either style.
51
+ */
52
+ export declare function generatedSpecifier(fromFile: string, target: string, style: GeneratedSpecifierStyle): string;
21
53
  /** One helper module copied out of `config/`. */
22
54
  export interface HelperCopy {
23
55
  /** Where it was, absolute. */
@@ -1,7 +1,7 @@
1
1
  import type { SourceFile } from "ts-morph";
2
2
  import type { LegacyCollectionConfig } from "@rebasepro/common/migrate";
3
3
  import type { AstContext, CollectionSite } from "./ast.js";
4
- import type { Relocator } from "./modules.js";
4
+ import type { GeneratedSpecifierStyle, Relocator } from "./modules.js";
5
5
  import type { SplitConstant } from "./split-constants.js";
6
6
  import type { ManualStep, Note, Refusal } from "./types.js";
7
7
  /** One legacy collection with everything the planners read about it. */
@@ -22,6 +22,12 @@ export interface PlanContext {
22
22
  root: string;
23
23
  ast: AstContext;
24
24
  relocator: Relocator;
25
+ /**
26
+ * How every relative import the run writes itself ends (`./users` or
27
+ * `./users.js`): as the legacy collection sources write theirs, decided
28
+ * once from them (`projectSpecifierStyle`).
29
+ */
30
+ specifierStyle: GeneratedSpecifierStyle;
25
31
  /** The frontend app's root directory, absolute, when the project has one. */
26
32
  frontendDir?: string;
27
33
  /** Planned files: absolute path → content. */
@@ -1,6 +1,6 @@
1
1
  import { t as createSchemaModuleImporter } from "./import-schema-module-Df67TIWj.js";
2
- import { o as isAgentKey, t as AGENTS } from "./skills-CXjA9TWw.js";
3
- import { r as BACKEND_GUARD_SNIPPET, t as BACKEND_GUARD_EXPORT } from "./backend-guard-C0mVkXBw.js";
2
+ import { o as isAgentKey, t as AGENTS } from "./skills-DQ2bZGkj.js";
3
+ import { r as BACKEND_GUARD_SNIPPET, t as BACKEND_GUARD_EXPORT } from "./backend-guard-Cf8eMK_f.js";
4
4
  import chalk from "chalk";
5
5
  import { isViewDef, resolveResourceRefs } from "@rebasepro/types";
6
6
  import { createRequire } from "node:module";
@@ -831,6 +831,45 @@ function writeSpecifier(fromFile, target, style) {
831
831
  return relative;
832
832
  }
833
833
  /**
834
+ * The {@link GeneratedSpecifierStyle} of a project, from the module specifiers
835
+ * its legacy collection sources write (the collection files and the
836
+ * collections index): `"js"` when more of their relative specifiers end in
837
+ * a JavaScript extension (`./users.js`) than in none (`./users`, `../lib`);
838
+ * `"extensionless"`, the house style, otherwise — a tie, or no relative
839
+ * import at all. A specifier with another extension (`./labels.json`,
840
+ * `./users.schema`) says nothing either way.
841
+ *
842
+ * @param specifiers every module specifier the sources import or re-export from, package names included
843
+ */
844
+ function projectSpecifierStyle(specifiers) {
845
+ let withExtension = 0;
846
+ let without = 0;
847
+ for (const specifier of specifiers) {
848
+ if (!/^\.\.?(\/|$)/.test(specifier)) continue;
849
+ const last = specifier.split("/").pop() ?? "";
850
+ if (/\.[mc]?jsx?$/.test(last)) withExtension++;
851
+ else if (last === "" || last === "." || last === ".." || !last.includes(".")) without++;
852
+ }
853
+ return withExtension > without ? "js" : "extensionless";
854
+ }
855
+ /** The module specifiers a file imports and re-exports from, as written. */
856
+ function writtenSpecifiers(sourceFile) {
857
+ return [...sourceFile.getImportDeclarations().map((declaration) => declaration.getModuleSpecifierValue()), ...sourceFile.getExportDeclarations().flatMap((declaration) => declaration.getModuleSpecifierValue() ?? [])];
858
+ }
859
+ /**
860
+ * The relative specifier of an import the codemod writes, from `fromFile` to
861
+ * the module `target`, in the project's {@link GeneratedSpecifierStyle}: for
862
+ * `users.ts`, `./users` or `./users.js`. A JavaScript target keeps its own
863
+ * extension in either style.
864
+ */
865
+ function generatedSpecifier(fromFile, target, style) {
866
+ const typescript = /\.(tsx?|mts)$/.exec(target);
867
+ let relative = toPosix(path.relative(path.dirname(fromFile), typescript ? target.slice(0, -typescript[0].length) : target));
868
+ if (!relative.startsWith("../")) relative = `./${relative}`;
869
+ if (style === "extensionless" || !typescript) return relative;
870
+ return `${relative}${typescript[1] === "mts" ? ".mjs" : ".js"}`;
871
+ }
872
+ /**
834
873
  * Moves specifiers and collects the helper copies they need. One per run, so
835
874
  * a helper used by several files is copied once per side.
836
875
  */
@@ -1543,11 +1582,11 @@ function planBackend(plan, input, names) {
1543
1582
  });
1544
1583
  const ordered = [...input.order.map((slug) => names.get(slug)).filter((value) => value !== void 0)];
1545
1584
  for (const name of names.values()) if (!ordered.includes(name)) ordered.push(name);
1546
- const index = printIndexModule(ordered.map((name) => ({
1585
+ const indexFile = path.join(schemaDir, "index.ts");
1586
+ planFile(plan, indexFile, printIndexModule(ordered.map((name) => ({
1547
1587
  identifier: name.identifier,
1548
- importPath: `./${path.basename(name.file, ".ts")}`
1549
- })), lift.defaultRls !== void 0 ? { defaultRls: lift.defaultRls } : {});
1550
- planFile(plan, path.join(schemaDir, "index.ts"), index, "the schema index");
1588
+ importPath: generatedSpecifier(indexFile, name.file, plan.specifierStyle)
1589
+ })), lift.defaultRls !== void 0 ? { defaultRls: lift.defaultRls } : {}), "the schema index");
1551
1590
  }
1552
1591
  function planTableModule(plan, entry, def, name, names) {
1553
1592
  const collection = entry.collection;
@@ -1677,7 +1716,7 @@ function planTableModule(plan, entry, def, name, names) {
1677
1716
  if (!found) throw new RelocationError(entry.file, `a relation points at "${target.slug}", which is not a collection file in ${relativeToRoot(plan, path.dirname(entry.file))}. Move that collection into the directory (or drop the relation) and run the codemod again.`);
1678
1717
  return {
1679
1718
  identifier: found.identifier,
1680
- importPath: `./${path.basename(found.file, ".ts")}`,
1719
+ importPath: generatedSpecifier(name.file, found.file, plan.specifierStyle),
1681
1720
  table: found.table,
1682
1721
  kind: found.kind === "view" ? "view" : "table"
1683
1722
  };
@@ -1767,12 +1806,6 @@ function fileHeader(plan, entry) {
1767
1806
  if (!first || !plan.ast.tsm.Node.isImportDeclaration(first)) return [];
1768
1807
  return leadingComments(first);
1769
1808
  }
1770
- /** The relative module path of a table, from a file in another directory. */
1771
- function tableImportPath(fromFile, table) {
1772
- let relative = toPosix(path.relative(path.dirname(fromFile), table.file.replace(/\.ts$/, "")));
1773
- if (!relative.startsWith(".")) relative = `./${relative}`;
1774
- return relative;
1775
- }
1776
1809
  //#endregion
1777
1810
  //#region src/codemod/collections-to-tables/vocabulary.ts
1778
1811
  /** A collection's `admin` keys → `customizeTable` options. */
@@ -2524,11 +2557,6 @@ async function findSplitConstants(plan, entries, importModule, cmsDir) {
2524
2557
  function printedIds(constant) {
2525
2558
  return `[${constant.ids.map((id) => typeof id === "string" ? printStringLiteral(id) : String(id)).join(", ")}]`;
2526
2559
  }
2527
- function specifierFrom(fromFile, target) {
2528
- let relative = toPosix(path.relative(path.dirname(fromFile), target.replace(/\.(tsx?|mts)$/, "")));
2529
- if (!relative.startsWith(".")) relative = `./${relative}`;
2530
- return relative;
2531
- }
2532
2560
  /** Insert an import line after a module's import block. */
2533
2561
  function addImport(content, line) {
2534
2562
  if (content.includes(line)) return content;
@@ -2555,7 +2583,7 @@ function planSplitConstants(plan, constants, tableFiles) {
2555
2583
  ].join("\n"));
2556
2584
  planFile(plan, group[0].backendFile, `${backend.join("\n\n")}\n`, `values of ${legacy}`);
2557
2585
  const frontendFile = group[0].frontendFile;
2558
- if (frontendFile) planFile(plan, frontendFile, `${`import type { ${group.map((constant) => constant.typeName).join(", ")} } from ${JSON.stringify(specifierFrom(frontendFile, group[0].backendFile))};`}\n\n${group.map((constant) => [
2586
+ if (frontendFile) planFile(plan, frontendFile, `${`import type { ${group.map((constant) => constant.typeName).join(", ")} } from ${JSON.stringify(generatedSpecifier(frontendFile, group[0].backendFile, plan.specifierStyle))};`}\n\n${group.map((constant) => [
2559
2587
  `/** What the panel calls each value of \`${constant.legacyName}\` (${legacy}); the values are the backend's. */`,
2560
2588
  `export const ${constant.labelsName}: Record<${constant.typeName}, string> = {`,
2561
2589
  Object.entries(constant.labels).map(([id, label]) => ` ${/^[A-Za-z_$][\w$]*$/.test(id) ? id : JSON.stringify(id)}: ${printStringLiteral(label)}`).join(",\n"),
@@ -2570,7 +2598,7 @@ function planSplitConstants(plan, constants, tableFiles) {
2570
2598
  const printed = printedIds(constant);
2571
2599
  if (!content.includes(printed)) continue;
2572
2600
  content = content.split(printed).join(constant.valuesName);
2573
- content = addImport(content, `import { ${constant.valuesName} } from ${JSON.stringify(specifierFrom(tableFile, constant.backendFile))};`);
2601
+ content = addImport(content, `import { ${constant.valuesName} } from ${JSON.stringify(generatedSpecifier(tableFile, constant.backendFile, plan.specifierStyle))};`);
2574
2602
  }
2575
2603
  if (content !== planned.content) plan.files.set(tableFile, {
2576
2604
  ...planned,
@@ -2611,6 +2639,11 @@ var COMPONENT_KEYS = /* @__PURE__ */ new Set([
2611
2639
  "Filter",
2612
2640
  "Component"
2613
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.";
2614
2647
  function isPlainObject(value) {
2615
2648
  if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
2616
2649
  const proto = Object.getPrototypeOf(value);
@@ -2892,7 +2925,9 @@ function printable(plan, builder, value, segments, label, attributed = false) {
2892
2925
  return new RawSource(memberFunctionText(plan.ast, member));
2893
2926
  }
2894
2927
  if (typeof value === "string" && COMPONENT_KEYS.has(String(segments[segments.length - 1])) && (value.startsWith("./") || value.startsWith("../"))) try {
2895
- 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;
2896
2931
  } catch (error) {
2897
2932
  refuse(plan, builder.entry, error instanceof Error ? error.message : String(error), { key: segments.join(".") });
2898
2933
  builder.failed = true;
@@ -3087,8 +3122,7 @@ function applyFieldNote(plan, builder, item, fields) {
3087
3122
  case "enum": {
3088
3123
  const constant = constantForEnum(plan.splitConstants ?? [], builder.entry.file, item.value);
3089
3124
  if (constant?.frontendFile) {
3090
- let specifier = toPosix(path.relative(path.dirname(builder.file), constant.frontendFile.replace(/\.tsx?$/, "")));
3091
- if (!specifier.startsWith(".")) specifier = `./${specifier}`;
3125
+ const specifier = generatedSpecifier(builder.file, constant.frontendFile, plan.specifierStyle);
3092
3126
  builder.libImports.set(specifier, /* @__PURE__ */ new Set([...builder.libImports.get(specifier) ?? [], constant.labelsName]));
3093
3127
  target.enumLabels = new RawSource(constant.labelsName);
3094
3128
  return;
@@ -3409,7 +3443,7 @@ function printModule(plan, builder, options) {
3409
3443
  const componentLines = [...builder.componentImports].map(([local, { specifier, imported }]) => imported === "default" ? `import ${local} from ${JSON.stringify(specifier)};` : `import { ${imported === local ? local : `${imported} as ${local}`} } from ${JSON.stringify(specifier)};`);
3410
3444
  const imports = [
3411
3445
  `import { customizeTable } from "@rebasepro/cms";`,
3412
- `import type { ${name.identifier} } from ${JSON.stringify(tableImportPath(file, name))};`,
3446
+ `import type { ${name.identifier} } from ${JSON.stringify(generatedSpecifier(file, name.file, plan.specifierStyle))};`,
3413
3447
  ...componentLines,
3414
3448
  ...[...builder.libImports].map(([specifier, imported]) => `import { ${[...imported].join(", ")} } from ${JSON.stringify(specifier)};`),
3415
3449
  ...carriedImports
@@ -3454,12 +3488,10 @@ function brandAdditionalFieldKeys(options) {
3454
3488
  return branded;
3455
3489
  }
3456
3490
  /** `frontend/src/cms/index.ts`: the customizations in navigation order, and the external collections. */
3457
- function printCmsIndex(cmsDir, customizations, external) {
3491
+ function printCmsIndex(cmsDir, customizations, external, style) {
3458
3492
  const lines = [];
3459
- const specifier = (file) => {
3460
- const relative = toPosix(path.relative(cmsDir, file.replace(/\.tsx?$/, "")));
3461
- return JSON.stringify(relative.startsWith(".") ? relative : `./${relative}`);
3462
- };
3493
+ const indexFile = path.join(cmsDir, "index.ts");
3494
+ const specifier = (file) => JSON.stringify(generatedSpecifier(indexFile, file, style));
3463
3495
  for (const module of customizations) lines.push(`import { ${module.identifier} } from ${specifier(module.file)};`);
3464
3496
  for (const module of external) lines.push(`import ${module.identifier} from ${specifier(module.file)};`);
3465
3497
  if (lines.length > 0) lines.push("");
@@ -8024,7 +8056,7 @@ function planFrontendWiring(plan, frontendDir, hasExternal) {
8024
8056
  const mountsUiConfig = /\buiConfig\s*=/.test(appText);
8025
8057
  if (!fs.existsSync(uiConfigFile) && !plan.files.has(uiConfigFile)) planFile(plan, uiConfigFile, UI_CONFIG_CONTENT, "ui-config.json (the collection editor's presentation file)");
8026
8058
  const wireUiConfig = !mountsUiConfig;
8027
- const importLine = `import { ${names} } from "./cms";${wireUiConfig ? `\n${UI_CONFIG_IMPORT}` : ""}`;
8059
+ const importLine = `import { ${names} } from "${plan.specifierStyle === "js" ? "./cms/index.js" : "./cms"}";${wireUiConfig ? `\n${UI_CONFIG_IMPORT}` : ""}`;
8028
8060
  const props = [
8029
8061
  "tableCustomizations={tableCustomizations}",
8030
8062
  ...hasExternal ? ["externalCollections={externalCollections}"] : [],
@@ -8046,7 +8078,8 @@ function planFrontendWiring(plan, frontendDir, hasExternal) {
8046
8078
  const text = appText;
8047
8079
  const importCount = text.split(SCAFFOLD_COLLECTIONS_IMPORT).length - 1;
8048
8080
  const propCount = text.split(SCAFFOLD_COLLECTIONS_PROP).length - 1;
8049
- 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)) {
8050
8083
  const propLine = text.split("\n").find((line) => line.includes(SCAFFOLD_COLLECTIONS_PROP)) ?? "";
8051
8084
  const indent = /^[ \t]*/.exec(propLine)?.[0] ?? "";
8052
8085
  planFile(plan, appFile, text.replace(SCAFFOLD_COLLECTIONS_IMPORT, importLine).replace(SCAFFOLD_COLLECTIONS_PROP, props.join(`\n${indent}`)), "App.tsx (mount the customizations)");
@@ -8070,6 +8103,17 @@ function planFrontendWiring(plan, frontendDir, hasExternal) {
8070
8103
  });
8071
8104
  }
8072
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
+ }
8073
8117
  /** The frontend's own .ts/.tsx sources (no declaration files, no node_modules, not the generated cms/). */
8074
8118
  function frontendSourceFiles(dir) {
8075
8119
  if (!fs.existsSync(dir)) return [];
@@ -9076,16 +9120,6 @@ async function migrateWithShims(options, shimDir) {
9076
9120
  backend: path.join(root, "backend", "lib"),
9077
9121
  frontend: cmsDir ? path.join(cmsDir, "lib") : path.join(root, "frontend", "src", "cms", "lib")
9078
9122
  });
9079
- const plan = {
9080
- root,
9081
- ast,
9082
- relocator,
9083
- ...frontendDir ? { frontendDir } : {},
9084
- files: /* @__PURE__ */ new Map(),
9085
- refusals: report.refusals,
9086
- notes: report.notes,
9087
- manualSteps: report.manualSteps
9088
- };
9089
9123
  const entries = legacy.collections.map(({ collection, file }) => {
9090
9124
  const sourceFile = addSourceFile(ast, file, fs.readFileSync(file, "utf8"));
9091
9125
  const site = findCollectionSite(ast, sourceFile);
@@ -9096,6 +9130,18 @@ async function migrateWithShims(options, shimDir) {
9096
9130
  ...site.node ? { site: site.node } : { siteProblem: site.reason }
9097
9131
  };
9098
9132
  });
9133
+ const legacyIndexFile = ["index.ts", "index.js"].map((file) => path.join(legacy.collectionsDir, file)).find((file) => fs.existsSync(file));
9134
+ const plan = {
9135
+ root,
9136
+ ast,
9137
+ relocator,
9138
+ specifierStyle: projectSpecifierStyle([...entries.flatMap((entry) => writtenSpecifiers(entry.sourceFile)), ...legacyIndexFile ? writtenSpecifiers(addSourceFile(ast, legacyIndexFile, fs.readFileSync(legacyIndexFile, "utf8"))) : []]),
9139
+ ...frontendDir ? { frontendDir } : {},
9140
+ files: /* @__PURE__ */ new Map(),
9141
+ refusals: report.refusals,
9142
+ notes: report.notes,
9143
+ manualSteps: report.manualSteps
9144
+ };
9099
9145
  for (const entry of entries) {
9100
9146
  if (!entry.site?.binding) continue;
9101
9147
  for (const [assigned, { statement }] of postDeclarationAssignments(ast, entry.sourceFile, entry.site.binding)) note(plan, entry, `\`${entry.site.binding}.${assigned}\` is assigned after the declaration; the evaluated value is what was carried.`, statement.getStartLineNumber());
@@ -9264,11 +9310,10 @@ async function migrateWithShims(options, shimDir) {
9264
9310
  file: relativeToRoot(plan, legacy.collectionsDir)
9265
9311
  });
9266
9312
  if (cmsDir && frontendDir) {
9267
- if (customizationModules.length > 0 || external.length > 0) planFile(plan, path.join(cmsDir, "index.ts"), printCmsIndex(cmsDir, customizationModules, external), "the CMS index");
9313
+ if (customizationModules.length > 0 || external.length > 0) planFile(plan, path.join(cmsDir, "index.ts"), printCmsIndex(cmsDir, customizationModules, external, plan.specifierStyle), "the CMS index");
9268
9314
  planFrontendWiring(plan, frontendDir, external.length > 0);
9269
9315
  }
9270
9316
  planStaticAppGuards(plan, frontendDir);
9271
- const legacyIndexFile = ["index.ts", "index.js"].map((file) => path.join(legacy.collectionsDir, file)).find((file) => fs.existsSync(file));
9272
9317
  const schemaIndex = plan.files.get(path.join(schemaDir, "index.ts"));
9273
9318
  if (legacyIndexFile && schemaIndex) {
9274
9319
  const cmsIndexPath = cmsDir ? path.join(cmsDir, "index.ts") : void 0;
@@ -9981,4 +10026,4 @@ async function runSdkCalls(flags, dir, aliases) {
9981
10026
  //#endregion
9982
10027
  export { printCollectionsToTablesHelp, printSdkCallsHelp, runCollectionsToTables, runSdkCalls };
9983
10028
 
9984
- //# sourceMappingURL=command-D5lhW_-B.js.map
10029
+ //# sourceMappingURL=command-Bks5xkrQ.js.map