wirejs-resources 0.1.182 → 0.1.184

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 (2) hide show
  1. package/dist/config.d.ts +33 -3
  2. package/package.json +1 -1
package/dist/config.d.ts CHANGED
@@ -1,3 +1,8 @@
1
+ export type RedirectRule = {
2
+ from: string;
3
+ to: string;
4
+ mode?: 'temporary' | 'permanent';
5
+ };
1
6
  export type DeploymentConfig = {
2
7
  runtimeDesiredMemoryMB?: number;
3
8
  runtimeTimeoutSeconds?: number;
@@ -26,17 +31,42 @@ export type DeploymentConfig = {
26
31
  * {
27
32
  * main: 'app.example.com',
28
33
  * staging: ['staging.example.com', 'preview.example.com'],
29
- * '*': '*.example.com'
34
+ * '*': '{branch}.example.com'
30
35
  * }
31
36
  *
32
37
  * Template behavior:
33
- * - Any `*` in a selected domain value is replaced with the current
38
+ * - Any `{branch}` token in a selected domain value is replaced with the current
34
39
  * branch id slug (lowercase, non-alphanumeric => `-`).
35
- * - Example: BRANCH_ID='feature/login' + '*.example.com' =>
40
+ * - Example: BRANCH_ID='feature/login' + '{branch}.example.com' =>
36
41
  * 'feature-login.example.com'.
42
+ * - Literal `*` values remain wildcard domains (for example '*.example.com').
37
43
  *
38
44
  * Branch resolution is handled by deployment providers (for CDK, using
39
45
  * BRANCH_ID / GITHUB_REF_NAME).
40
46
  */
41
47
  domainsByBranch?: Record<string, string | string[]>;
48
+ /**
49
+ * Optional array of host redirects.
50
+ *
51
+ * Redirects are applied whenever their target domain is deployed.
52
+ * Both `from` and `to` fields support `{branch}` token substitution.
53
+ *
54
+ * Example:
55
+ * [
56
+ * { from: 'example.com', to: 'www.example.com', mode: 'permanent' },
57
+ * { from: 'help.example.com', to: 'support.example.com', mode: 'temporary' },
58
+ * { from: '{branch}.old.example.com', to: '{branch}.new.example.com' }
59
+ * ]
60
+ *
61
+ * Template behavior:
62
+ * - Any `{branch}` token in `from` or `to` is replaced with the current branch id slug.
63
+ * - Redirects remain stable across branches — they activate whenever their target domain is deployed.
64
+ *
65
+ * Behavior:
66
+ * - `mode: 'temporary'` (default) uses HTTP 307 — safe when destination might change.
67
+ * - `mode: 'permanent'` uses HTTP 308 — for durable canonical redirects.
68
+ * - Redirects are host-only and preserve path/query.
69
+ * - All `from` hosts are automatically included in domain aliases and certificates.
70
+ */
71
+ redirects?: RedirectRule[];
42
72
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-resources",
3
- "version": "0.1.182",
3
+ "version": "0.1.184",
4
4
  "description": "Basic services and server-side resources for wirejs apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",