@canonical/summon-application 0.40.0 → 0.43.0-experimental.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.
- package/README.md +23 -10
- package/dist/esm/application/react/index.js.map +1 -1
- package/dist/esm/application/react/templates/README.md.ejs +1 -1
- package/dist/esm/application/react/templates/package.json.ejs +1 -1
- package/dist/esm/application/react/templates/src/formatDocumentTitle.ts.ejs +1 -1
- package/dist/esm/application/react/templates/tsconfig.json.ejs +1 -13
- package/dist/esm/domain/index.js +13 -34
- package/dist/esm/domain/index.js.map +1 -1
- package/dist/esm/domain/templates/MainPage.tsx.ejs +12 -0
- package/dist/esm/domain/templates/routes.ts.ejs +11 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/page/index.js +182 -0
- package/dist/esm/page/index.js.map +1 -0
- package/dist/esm/page/templates/Page.tsx.ejs +11 -0
- package/dist/esm/page/templates/routingGuide.txt.ejs +24 -0
- package/dist/esm/shared/packageVersion.js.map +1 -1
- package/dist/esm/shared/renderTemplate.js +21 -0
- package/dist/esm/shared/renderTemplate.js.map +1 -0
- package/dist/esm/shared/validators.js +20 -1
- package/dist/esm/shared/validators.js.map +1 -1
- package/dist/esm/shared/versions.js.map +1 -1
- package/dist/esm/wrapper/index.js +9 -19
- package/dist/esm/wrapper/index.js.map +1 -1
- package/dist/esm/wrapper/templates/Layout.tsx.ejs +7 -0
- package/dist/esm/wrapper/templates/index.ts.ejs +1 -0
- package/dist/types/application/react/index.d.ts.map +1 -1
- package/dist/types/domain/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/page/index.d.ts +7 -0
- package/dist/types/page/index.d.ts.map +1 -0
- package/dist/types/shared/packageManager.d.ts.map +1 -1
- package/dist/types/shared/renderTemplate.d.ts +17 -0
- package/dist/types/shared/renderTemplate.d.ts.map +1 -0
- package/dist/types/shared/validators.d.ts +14 -2
- package/dist/types/shared/validators.d.ts.map +1 -1
- package/dist/types/wrapper/index.d.ts.map +1 -1
- package/package.json +15 -11
- package/dist/esm/route/index.js +0 -124
- package/dist/esm/route/index.js.map +0 -1
- package/dist/esm/route/insertRoute.js +0 -206
- package/dist/esm/route/insertRoute.js.map +0 -1
- package/dist/types/route/index.d.ts +0 -7
- package/dist/types/route/index.d.ts.map +0 -1
- package/dist/types/route/insertRoute.d.ts +0 -34
- 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"}
|