@canonical/summon-application 0.38.0 → 0.42.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 (47) hide show
  1. package/README.md +23 -10
  2. package/dist/esm/application/react/index.js.map +1 -1
  3. package/dist/esm/application/react/templates/README.md.ejs +1 -1
  4. package/dist/esm/application/react/templates/package.json.ejs +1 -1
  5. package/dist/esm/application/react/templates/src/formatDocumentTitle.ts.ejs +1 -1
  6. package/dist/esm/application/react/templates/tsconfig.json.ejs +1 -13
  7. package/dist/esm/domain/index.js +13 -34
  8. package/dist/esm/domain/index.js.map +1 -1
  9. package/dist/esm/domain/templates/MainPage.tsx.ejs +12 -0
  10. package/dist/esm/domain/templates/routes.ts.ejs +11 -0
  11. package/dist/esm/index.js +2 -2
  12. package/dist/esm/index.js.map +1 -1
  13. package/dist/esm/page/index.js +182 -0
  14. package/dist/esm/page/index.js.map +1 -0
  15. package/dist/esm/page/templates/Page.tsx.ejs +11 -0
  16. package/dist/esm/page/templates/routingGuide.txt.ejs +24 -0
  17. package/dist/esm/shared/packageVersion.js.map +1 -1
  18. package/dist/esm/shared/renderTemplate.js +21 -0
  19. package/dist/esm/shared/renderTemplate.js.map +1 -0
  20. package/dist/esm/shared/validators.js +20 -1
  21. package/dist/esm/shared/validators.js.map +1 -1
  22. package/dist/esm/shared/versions.js.map +1 -1
  23. package/dist/esm/wrapper/index.js +9 -19
  24. package/dist/esm/wrapper/index.js.map +1 -1
  25. package/dist/esm/wrapper/templates/Layout.tsx.ejs +7 -0
  26. package/dist/esm/wrapper/templates/index.ts.ejs +1 -0
  27. package/dist/types/application/react/index.d.ts.map +1 -1
  28. package/dist/types/domain/index.d.ts.map +1 -1
  29. package/dist/types/index.d.ts +1 -1
  30. package/dist/types/index.d.ts.map +1 -1
  31. package/dist/types/page/index.d.ts +7 -0
  32. package/dist/types/page/index.d.ts.map +1 -0
  33. package/dist/types/shared/packageManager.d.ts.map +1 -1
  34. package/dist/types/shared/renderTemplate.d.ts +17 -0
  35. package/dist/types/shared/renderTemplate.d.ts.map +1 -0
  36. package/dist/types/shared/validators.d.ts +14 -2
  37. package/dist/types/shared/validators.d.ts.map +1 -1
  38. package/dist/types/wrapper/index.d.ts.map +1 -1
  39. package/package.json +10 -10
  40. package/dist/esm/route/index.js +0 -124
  41. package/dist/esm/route/index.js.map +0 -1
  42. package/dist/esm/route/insertRoute.js +0 -206
  43. package/dist/esm/route/insertRoute.js.map +0 -1
  44. package/dist/types/route/index.d.ts +0 -7
  45. package/dist/types/route/index.d.ts.map +0 -1
  46. package/dist/types/route/insertRoute.d.ts +0 -34
  47. package/dist/types/route/insertRoute.d.ts.map +0 -1
@@ -1,34 +0,0 @@
1
- export interface RouteInsertion {
2
- /** Imported page component, e.g. "InvoicesPage". */
3
- readonly pageName: string;
4
- /** Import specifier, e.g. "./InvoicesPage.js". */
5
- readonly importPath: string;
6
- /** Route key in the routes object, e.g. "invoices". */
7
- readonly routeKey: string;
8
- /** Route URL, e.g. "/billing/invoices". */
9
- readonly url: string;
10
- }
11
- /**
12
- * Insert a route into a domain `routes.ts` source.
13
- *
14
- * Uses the TypeScript compiler API only to *locate* the insertion points (the
15
- * last import declaration and the `routes` object literal), then splices text
16
- * at those offsets. Locating with the AST is robust to formatting; editing by
17
- * string keeps the rest of the file byte-for-byte unchanged (no full re-print,
18
- * so it doesn't fight the formatter).
19
- *
20
- * Idempotent: if `routeKey` already exists in the routes object, the source is
21
- * returned unchanged. Throws if the `routes` object literal cannot be found.
22
- */
23
- export declare function insertRoute(source: string, ins: RouteInsertion): string;
24
- /**
25
- * Inverse of {@link insertRoute}: remove the route entry and its import.
26
- *
27
- * Used as the route generator's undo. Rather than restoring a stored copy of
28
- * the file, it deletes exactly the lines that {@link insertRoute} added — the
29
- * `routeKey` property in the `routes` object and the `import <pageName> ...`
30
- * line. Idempotent: returns the source unchanged if neither is present, and
31
- * leaves any other content (including manual edits) intact.
32
- */
33
- export declare function removeRoute(source: string, ins: Pick<RouteInsertion, "pageName" | "routeKey">): string;
34
- //# sourceMappingURL=insertRoute.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"insertRoute.d.ts","sourceRoot":"","sources":["../../../src/route/insertRoute.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,kDAAkD;IAClD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,2CAA2C;IAC3C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,GAAG,MAAM,CA8FvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,UAAU,CAAC,GACjD,MAAM,CA2DR"}