@vezham/config 0.0.0-stage → 26.0.0-alpha.6
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/LICENSE +173 -0
- package/README.md +14 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +0 -0
- package/dist/lib/deploy/cli.d.ts +3 -0
- package/dist/lib/deploy/cli.d.ts.map +1 -0
- package/dist/lib/deploy/cli.js +12 -0
- package/dist/lib/deploy/firebase.d.ts +3 -0
- package/dist/lib/deploy/firebase.d.ts.map +1 -0
- package/dist/lib/deploy/firebase.js +106 -0
- package/dist/lib/deploy/index.d.ts +4 -0
- package/dist/lib/deploy/index.d.ts.map +1 -0
- package/dist/lib/deploy/index.js +42 -0
- package/dist/lib/deploy/paths.d.ts +3 -0
- package/dist/lib/deploy/paths.d.ts.map +1 -0
- package/dist/lib/deploy/paths.js +6 -0
- package/dist/lib/deploy/presets.d.ts +5 -0
- package/dist/lib/deploy/presets.d.ts.map +1 -0
- package/dist/lib/deploy/presets.js +10 -0
- package/dist/lib/deploy/types.d.ts +97 -0
- package/dist/lib/deploy/types.d.ts.map +1 -0
- package/dist/lib/deploy/vercel.d.ts +3 -0
- package/dist/lib/deploy/vercel.d.ts.map +1 -0
- package/dist/lib/deploy/vercel.js +47 -0
- package/dist/lib/framework.d.ts +3 -0
- package/dist/lib/framework.d.ts.map +1 -0
- package/dist/lib/framework.js +7 -0
- package/dist/lib/i18n.d.ts +6 -0
- package/dist/lib/i18n.d.ts.map +1 -0
- package/dist/lib/i18n.js +11 -0
- package/dist/lib/integrations/next/index.d.ts +4 -0
- package/dist/lib/integrations/next/index.d.ts.map +1 -0
- package/dist/lib/integrations/next/index.js +29 -0
- package/dist/lib/integrations/playwright/index.d.ts +11 -0
- package/dist/lib/integrations/playwright/index.d.ts.map +1 -0
- package/dist/lib/integrations/playwright/index.js +77 -0
- package/dist/lib/integrations/playwright/test.d.ts +5 -0
- package/dist/lib/integrations/playwright/test.d.ts.map +1 -0
- package/dist/lib/integrations/playwright/test.js +23 -0
- package/dist/lib/integrations/vite/index.d.ts +12 -0
- package/dist/lib/integrations/vite/index.d.ts.map +1 -0
- package/dist/lib/integrations/vite/index.js +34 -0
- package/dist/lib/integrations/vite-lib/base.d.ts +3 -0
- package/dist/lib/integrations/vite-lib/base.d.ts.map +1 -0
- package/dist/lib/integrations/vite-lib/base.js +31 -0
- package/dist/lib/integrations/vite-lib/index.d.ts +3 -0
- package/dist/lib/integrations/vite-lib/index.d.ts.map +1 -0
- package/dist/lib/integrations/vite-lib/index.js +42 -0
- package/dist/lib/integrations/vite-lib/react.d.ts +3 -0
- package/dist/lib/integrations/vite-lib/react.d.ts.map +1 -0
- package/dist/lib/integrations/vite-lib/react.js +10 -0
- package/dist/lib/integrations/vitest/framework.d.ts +4 -0
- package/dist/lib/integrations/vitest/framework.d.ts.map +1 -0
- package/dist/lib/integrations/vitest/framework.js +5 -0
- package/dist/lib/integrations/vitest/frameworks/docs-plugins.d.ts +3 -0
- package/dist/lib/integrations/vitest/frameworks/docs-plugins.d.ts.map +1 -0
- package/dist/lib/integrations/vitest/frameworks/docs-plugins.js +27 -0
- package/dist/lib/integrations/vitest/frameworks/docs.d.ts +3 -0
- package/dist/lib/integrations/vitest/frameworks/docs.d.ts.map +1 -0
- package/dist/lib/integrations/vitest/frameworks/docs.js +5 -0
- package/dist/lib/integrations/vitest/frameworks/next.d.ts +3 -0
- package/dist/lib/integrations/vitest/frameworks/next.d.ts.map +1 -0
- package/dist/lib/integrations/vitest/frameworks/next.js +5 -0
- package/dist/lib/integrations/vitest/frameworks/react.d.ts +3 -0
- package/dist/lib/integrations/vitest/frameworks/react.d.ts.map +1 -0
- package/dist/lib/integrations/vitest/frameworks/react.js +5 -0
- package/dist/lib/integrations/vitest/index.d.ts +4 -0
- package/dist/lib/integrations/vitest/index.d.ts.map +1 -0
- package/dist/lib/integrations/vitest/index.js +4 -0
- package/dist/lib/integrations/vitest/setup/next.d.ts +2 -0
- package/dist/lib/integrations/vitest/setup/next.d.ts.map +1 -0
- package/dist/lib/integrations/vitest/setup/next.js +11 -0
- package/dist/lib/integrations/vitest/setup/react.d.ts +2 -0
- package/dist/lib/integrations/vitest/setup/react.d.ts.map +1 -0
- package/dist/lib/integrations/vitest/setup/react.js +36 -0
- package/dist/lib/integrations/vitest/shared.d.ts +3 -0
- package/dist/lib/integrations/vitest/shared.d.ts.map +1 -0
- package/dist/lib/integrations/vitest/shared.js +24 -0
- package/dist/lib/metadata/cli.d.ts +3 -0
- package/dist/lib/metadata/cli.d.ts.map +1 -0
- package/dist/lib/metadata/cli.js +13 -0
- package/dist/lib/metadata/env.d.ts +9 -0
- package/dist/lib/metadata/env.d.ts.map +1 -0
- package/dist/lib/metadata/env.js +36 -0
- package/dist/lib/metadata/html.d.ts +3 -0
- package/dist/lib/metadata/html.d.ts.map +1 -0
- package/dist/lib/metadata/html.js +96 -0
- package/dist/lib/metadata/index.d.ts +7 -0
- package/dist/lib/metadata/index.d.ts.map +1 -0
- package/dist/lib/metadata/index.js +61 -0
- package/dist/lib/metadata/next.d.ts +79 -0
- package/dist/lib/metadata/next.d.ts.map +1 -0
- package/dist/lib/metadata/next.js +106 -0
- package/dist/lib/metadata/public.d.ts +3 -0
- package/dist/lib/metadata/public.d.ts.map +1 -0
- package/dist/lib/metadata/public.js +107 -0
- package/dist/lib/metadata/render.d.ts +7 -0
- package/dist/lib/metadata/render.d.ts.map +1 -0
- package/dist/lib/metadata/render.js +37 -0
- package/dist/lib/metadata/runtime.d.ts +68 -0
- package/dist/lib/metadata/runtime.d.ts.map +1 -0
- package/dist/lib/metadata/runtime.js +134 -0
- package/dist/lib/metadata/tanstack.d.ts +71 -0
- package/dist/lib/metadata/tanstack.d.ts.map +1 -0
- package/dist/lib/metadata/tanstack.js +194 -0
- package/dist/lib/metadata/templates/not-found.html +224 -0
- package/dist/lib/metadata/templates/offline.html +210 -0
- package/dist/lib/metadata/types.d.ts +118 -0
- package/dist/lib/metadata/types.d.ts.map +1 -0
- package/dist/lib/navigation/app-menu.d.ts +2 -0
- package/dist/lib/navigation/app-menu.d.ts.map +1 -0
- package/dist/lib/navigation/app-menu.js +45 -0
- package/dist/lib/navigation/control-center.d.ts +2 -0
- package/dist/lib/navigation/control-center.d.ts.map +1 -0
- package/dist/lib/navigation/control-center.js +66 -0
- package/dist/lib/navigation/index.d.ts +5 -0
- package/dist/lib/navigation/index.d.ts.map +1 -0
- package/dist/lib/navigation/index.js +59 -0
- package/dist/lib/navigation/toolbar.d.ts +2 -0
- package/dist/lib/navigation/toolbar.d.ts.map +1 -0
- package/dist/lib/navigation/toolbar.js +78 -0
- package/dist/lib/presets/app/index.d.ts +21 -0
- package/dist/lib/presets/app/index.d.ts.map +1 -0
- package/dist/lib/presets/app/index.js +114 -0
- package/dist/lib/presets/cdn/index.d.ts +2 -0
- package/dist/lib/presets/cdn/index.d.ts.map +1 -0
- package/dist/lib/presets/cdn/index.js +2 -0
- package/dist/lib/presets/docs/cli.d.ts +3 -0
- package/dist/lib/presets/docs/cli.d.ts.map +1 -0
- package/dist/lib/presets/docs/cli.js +18 -0
- package/dist/lib/presets/docs/config.d.ts +40 -0
- package/dist/lib/presets/docs/config.d.ts.map +1 -0
- package/dist/lib/presets/docs/config.js +39 -0
- package/dist/lib/presets/docs/files.d.ts +2 -0
- package/dist/lib/presets/docs/files.d.ts.map +1 -0
- package/dist/lib/presets/docs/files.js +13 -0
- package/dist/lib/presets/docs/index.d.ts +7 -0
- package/dist/lib/presets/docs/index.d.ts.map +1 -0
- package/dist/lib/presets/docs/index.js +6 -0
- package/dist/lib/presets/docs/mdx-path.d.ts +7 -0
- package/dist/lib/presets/docs/mdx-path.d.ts.map +1 -0
- package/dist/lib/presets/docs/mdx-path.js +19 -0
- package/dist/lib/presets/docs/og-image.d.ts +9 -0
- package/dist/lib/presets/docs/og-image.d.ts.map +1 -0
- package/dist/lib/presets/docs/og-image.js +88 -0
- package/dist/lib/presets/docs/og-output.d.ts +5 -0
- package/dist/lib/presets/docs/og-output.d.ts.map +1 -0
- package/dist/lib/presets/docs/og-output.js +34 -0
- package/dist/lib/presets/docs/og.d.ts +9 -0
- package/dist/lib/presets/docs/og.d.ts.map +1 -0
- package/dist/lib/presets/docs/og.js +112 -0
- package/dist/lib/presets/docs/openapi.d.ts +3 -0
- package/dist/lib/presets/docs/openapi.d.ts.map +1 -0
- package/dist/lib/presets/docs/openapi.js +105 -0
- package/dist/lib/presets/docs/routes.d.ts +7 -0
- package/dist/lib/presets/docs/routes.d.ts.map +1 -0
- package/dist/lib/presets/docs/routes.js +109 -0
- package/dist/lib/presets/docs/types.d.ts +31 -0
- package/dist/lib/presets/docs/types.d.ts.map +1 -0
- package/dist/lib/presets/docs/vite.d.ts +11 -0
- package/dist/lib/presets/docs/vite.d.ts.map +1 -0
- package/dist/lib/presets/docs/vite.js +78 -0
- package/dist/lib/presets/files.d.ts +5 -0
- package/dist/lib/presets/files.d.ts.map +1 -0
- package/dist/lib/presets/files.js +21 -0
- package/dist/lib/presets/route-files.d.ts +22 -0
- package/dist/lib/presets/route-files.d.ts.map +1 -0
- package/dist/lib/presets/route-files.js +49 -0
- package/dist/lib/yaml-config.d.ts +2 -0
- package/dist/lib/yaml-config.d.ts.map +1 -0
- package/dist/lib/yaml-config.js +6 -0
- package/package.json +119 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
|
|
3
|
+
Business Source License 1.1
|
|
4
|
+
|
|
5
|
+
License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved.
|
|
6
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Parameters
|
|
11
|
+
|
|
12
|
+
Licensor: Vezham Technologies Private Limited
|
|
13
|
+
|
|
14
|
+
Licensed Work: The source code and packages in this repository (“the Licensed Work”).
|
|
15
|
+
The Licensed Work is (c) 2025–present Vezham Technologies Private Limited
|
|
16
|
+
|
|
17
|
+
Release Tag: The applicable release tag or commit identifier (for example, “v1.0.0”)
|
|
18
|
+
published by the Licensor for this version of the Licensed Work.
|
|
19
|
+
Users must cross-check the tag or commit identifier to verify
|
|
20
|
+
the release version and applicable Change Date.
|
|
21
|
+
|
|
22
|
+
Additional Use Grant: 1. You may make non-production use of the Licensed Work.
|
|
23
|
+
|
|
24
|
+
2. You may make production use of the Licensed Work, provided
|
|
25
|
+
your use does not include offering the Licensed Work, or any
|
|
26
|
+
derivative thereof, to third parties on a hosted, embedded,
|
|
27
|
+
or managed basis in order to compete with the Licensor’s
|
|
28
|
+
commercial offerings based on the Licensed Work, or offerings
|
|
29
|
+
that provide substantially similar functionality.
|
|
30
|
+
|
|
31
|
+
For purposes of this license:
|
|
32
|
+
|
|
33
|
+
A “competitive offering” is a Product that is offered to third
|
|
34
|
+
parties on a paid basis, including through paid support,
|
|
35
|
+
consulting, managed service arrangements, or similar commercial
|
|
36
|
+
relationships, that significantly overlaps with the capabilities
|
|
37
|
+
or functionality of the Licensor’s commercial offerings based on
|
|
38
|
+
the Licensed Work.
|
|
39
|
+
|
|
40
|
+
If your Product is not a competitive offering when you first
|
|
41
|
+
make it generally available, it will not become a competitive
|
|
42
|
+
offering solely because the Licensor releases a new version of the
|
|
43
|
+
Licensed Work with additional features or capabilities. Products
|
|
44
|
+
that are not provided on a paid basis are not competitive offerings.
|
|
45
|
+
|
|
46
|
+
“Product” means any software or service that is (a) offered to end
|
|
47
|
+
users for deployment in their own environments (self-managed), or
|
|
48
|
+
(b) offered as a hosted, cloud, or managed service by you or on
|
|
49
|
+
your behalf.
|
|
50
|
+
|
|
51
|
+
“Embedded” means including the source code or executable code of
|
|
52
|
+
the Licensed Work in a competitive offering. “Embedded” also means
|
|
53
|
+
packaging or distributing the competitive offering in a way that
|
|
54
|
+
requires the Licensed Work to be accessed, invoked, or downloaded
|
|
55
|
+
for the competitive offering to function.
|
|
56
|
+
|
|
57
|
+
Hosting or using the Licensed Work internally within your own
|
|
58
|
+
organization, including your affiliates under common control,
|
|
59
|
+
is not considered a competitive offering.
|
|
60
|
+
|
|
61
|
+
3. Educational institutions and legally recognised non-profit
|
|
62
|
+
organizations may use the Licensed Work in a production
|
|
63
|
+
environment without restriction, provided such use is not
|
|
64
|
+
for commercial profit.
|
|
65
|
+
|
|
66
|
+
For binding interpretive guidance on using Vezham products under
|
|
67
|
+
the Business Source License, please visit our licensing FAQ:
|
|
68
|
+
https://trust.vezham.com/legal/license-faq
|
|
69
|
+
|
|
70
|
+
Change Date: Four (4) years from the date the Licensed Work is first publicly
|
|
71
|
+
released under the specified Release Tag
|
|
72
|
+
|
|
73
|
+
Change License: GNU Affero General Public License v3.0 (AGPL-3.0-or-later)
|
|
74
|
+
The full text of the Change License is available at:
|
|
75
|
+
https://www.gnu.org/licenses/agpl-3.0.html
|
|
76
|
+
|
|
77
|
+
For information about commercial licensing or alternative arrangements,
|
|
78
|
+
please contact the Licensor at: https://vezham.com
|
|
79
|
+
or email: license@vezham.com
|
|
80
|
+
|
|
81
|
+
For formal legal notices or IP-related correspondence,
|
|
82
|
+
please contact: licensor@vezham.com
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
Notice
|
|
87
|
+
|
|
88
|
+
The Business Source License (this document, or the "License") is not an Open
|
|
89
|
+
Source license. However, the Licensed Work will eventually be made available
|
|
90
|
+
under an Open Source License, as stated in this License.
|
|
91
|
+
|
|
92
|
+
For more information on the use of the Business Source License generally,
|
|
93
|
+
please visit the Adopting and Developing Business Source License FAQ at:
|
|
94
|
+
https://mariadb.com/bsl-faq-adopting
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
Business Source License 1.1
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
Terms
|
|
103
|
+
|
|
104
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
105
|
+
works, redistribute, and make non-production use of the Licensed Work.
|
|
106
|
+
The Licensor may make an Additional Use Grant, above, permitting limited
|
|
107
|
+
production use.
|
|
108
|
+
|
|
109
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
110
|
+
available distribution of a specific version of the Licensed Work under this
|
|
111
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
112
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
113
|
+
above terminate.
|
|
114
|
+
|
|
115
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
116
|
+
currently in effect as described in this License, you must purchase a
|
|
117
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
118
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
119
|
+
|
|
120
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
121
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
122
|
+
separately for each version of the Licensed Work, and the Change Date may
|
|
123
|
+
vary for each version of the Licensed Work released by the Licensor.
|
|
124
|
+
|
|
125
|
+
You must conspicuously display this License on each original or modified copy
|
|
126
|
+
of the Licensed Work. If you receive the Licensed Work in original or modified
|
|
127
|
+
form from a third party, the terms and conditions set forth in this License
|
|
128
|
+
apply to your use of that work.
|
|
129
|
+
|
|
130
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
131
|
+
terminate your rights under this License for the current and all other versions
|
|
132
|
+
of the Licensed Work.
|
|
133
|
+
|
|
134
|
+
This License does not grant you any right in any trademark or logo of the
|
|
135
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
136
|
+
the Licensor as expressly required by this License).
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
Disclaimer
|
|
141
|
+
|
|
142
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
143
|
+
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
144
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
145
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
146
|
+
TITLE.
|
|
147
|
+
|
|
148
|
+
-----------------------------------------------------------------------------
|
|
149
|
+
|
|
150
|
+
MariaDB hereby grants you permission to use this License’s text to license your
|
|
151
|
+
works, and to refer to it using the trademark "Business Source License", as long
|
|
152
|
+
as you comply with the Covenants of Licensor below.
|
|
153
|
+
|
|
154
|
+
Covenants of Licensor
|
|
155
|
+
|
|
156
|
+
In consideration of the right to use this License’s text and the "Business
|
|
157
|
+
Source License" name and trademark, Licensor covenants to MariaDB, and to all
|
|
158
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
159
|
+
|
|
160
|
+
1. To specify as the Change License the GPL Version 3.0 or any later version,
|
|
161
|
+
or a license that is compatible with GPL Version 3.0 or a later version,
|
|
162
|
+
where "compatible" means that software provided under the Change License can
|
|
163
|
+
be included in a program with software provided under GPL Version 3.0 or a
|
|
164
|
+
later version. Licensor may specify additional Change Licenses without
|
|
165
|
+
limitation.
|
|
166
|
+
|
|
167
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
168
|
+
impose any additional restriction on the right granted in this License, as
|
|
169
|
+
the Additional Use Grant; or (b) insert the text "None".
|
|
170
|
+
|
|
171
|
+
3. To specify a Change Date.
|
|
172
|
+
|
|
173
|
+
4. Not to modify this License in any other way.
|
package/README.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vezham/config
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Build, test, metadata, navigation, and deployment presets.
|
|
4
|
+
|
|
5
|
+
Import presets directly from package subpaths, such as
|
|
6
|
+
`@vezham/config/vite` and `@vezham/config/vitest/react`.
|
|
7
|
+
|
|
8
|
+
Package builds use `defineConfig` from `@vezham/config/vite-lib`, or
|
|
9
|
+
`@vezham/config/vite-lib/react` for React packages. Both presets discover source
|
|
10
|
+
entries from package exports and CLI entries, preserve ES modules, keep
|
|
11
|
+
package dependencies external, copy CSS and HTML assets, and generate declarations.
|
|
12
|
+
|
|
13
|
+
Workspace entry points load TypeScript source before the first build. Publishing
|
|
14
|
+
replaces those entries with compiled ESM and declarations; the workspace loader
|
|
15
|
+
and its dependencies are not included in the npm output.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA"}
|
package/dist/index.js
ADDED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/lib/deploy/cli.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { generateDeployConfig } from "./index.js";
|
|
3
|
+
//#region src/lib/deploy/cli.ts
|
|
4
|
+
var [, , command = "generate", projectRoot = process.cwd()] = process.argv;
|
|
5
|
+
if (command === "generate") {
|
|
6
|
+
const files = generateDeployConfig({ projectRoot });
|
|
7
|
+
console.log(`Generated ${files.length} deploy files for ${projectRoot}`);
|
|
8
|
+
} else {
|
|
9
|
+
console.error(`Unknown deploy command "${command}". Use "generate".`);
|
|
10
|
+
process.exitCode = 1;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firebase.d.ts","sourceRoot":"","sources":["../../../src/lib/deploy/firebase.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EAQV,WAAW,EACX,cAAc,EACf,MAAM,SAAS,CAAA;AAiMhB,eAAO,MAAM,qBAAqB,GAChC,eAAe,MAAM,EACrB,aAAa,MAAM,EACnB,WAAW,WAAW,EACtB,cAAc,cAAc,KAC3B,UAWF,CAAA"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { normalizePath, resolveProjectPath } from "./paths.js";
|
|
2
|
+
import { cdnRewrites } from "./presets.js";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
//#region src/lib/deploy/firebase.ts
|
|
5
|
+
var cacheHeader = (source, value) => ({
|
|
6
|
+
source,
|
|
7
|
+
headers: [{
|
|
8
|
+
key: "Cache-Control",
|
|
9
|
+
value
|
|
10
|
+
}]
|
|
11
|
+
});
|
|
12
|
+
var unique = (values) => [...new Set(values)];
|
|
13
|
+
var firebaseDeployPresets = {
|
|
14
|
+
cdn: {
|
|
15
|
+
public: "dist",
|
|
16
|
+
rewrites: cdnRewrites
|
|
17
|
+
},
|
|
18
|
+
spa: {
|
|
19
|
+
public: "dist",
|
|
20
|
+
fallback: "/index.html"
|
|
21
|
+
},
|
|
22
|
+
"start-spa": {
|
|
23
|
+
public: ".output/public",
|
|
24
|
+
fallback: "/_shell.html"
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var defaultFirebaseDeployPreset = firebaseDeployPresets["start-spa"];
|
|
28
|
+
var getFirebaseDeployPreset = (preset) => {
|
|
29
|
+
if (!preset) return defaultFirebaseDeployPreset;
|
|
30
|
+
if (preset === "next" || preset === "tanstack-start") throw new Error(`The "${preset}" deploy preset supports Vercel only`);
|
|
31
|
+
return firebaseDeployPresets[preset];
|
|
32
|
+
};
|
|
33
|
+
var getDefaultFirebaseHeaders = (appConfig, options = {}, fallback) => {
|
|
34
|
+
const { app = true, docs = Boolean(appConfig.docs), routes = true, static: staticAssets = true } = options;
|
|
35
|
+
const docsRoute = appConfig.docs?.docsRoute ?? "/docs";
|
|
36
|
+
const localizedDocsRoutes = (appConfig.i18n?.languages ?? []).filter((language) => language !== appConfig.i18n?.defaultLanguage).flatMap((language) => {
|
|
37
|
+
const localizedDocsRoute = `/${language}${docsRoute}`;
|
|
38
|
+
return [localizedDocsRoute, `${localizedDocsRoute.replace(/\/$/, "")}/**`];
|
|
39
|
+
});
|
|
40
|
+
const routeSources = unique([
|
|
41
|
+
...app ? ["/"] : [],
|
|
42
|
+
...docs ? [
|
|
43
|
+
docsRoute,
|
|
44
|
+
`${docsRoute.replace(/\/$/, "")}/**`,
|
|
45
|
+
...localizedDocsRoutes
|
|
46
|
+
] : [],
|
|
47
|
+
...routes ? (appConfig.routes ?? []).map((route) => route.path).filter((route) => route.startsWith("/api")) : []
|
|
48
|
+
].filter(Boolean));
|
|
49
|
+
return [...staticAssets ? [
|
|
50
|
+
cacheHeader("/sw.js", "no-cache,no-store,must-revalidate"),
|
|
51
|
+
cacheHeader("/manifest.webmanifest", "public,max-age=300"),
|
|
52
|
+
...fallback ? [cacheHeader(fallback, "public,max-age=300")] : [],
|
|
53
|
+
cacheHeader("/assets/**", "public,max-age=31536000,immutable"),
|
|
54
|
+
cacheHeader("**/*.@(html|json|txt|md)", "public,max-age=300")
|
|
55
|
+
] : [], ...routeSources.map((source) => cacheHeader(source, "public,max-age=300"))];
|
|
56
|
+
};
|
|
57
|
+
var getDefaultLanguageRedirects = (appConfig) => {
|
|
58
|
+
const defaultLanguage = appConfig.i18n?.defaultLanguage;
|
|
59
|
+
return defaultLanguage ? [{
|
|
60
|
+
source: `/${defaultLanguage}`,
|
|
61
|
+
destination: "/",
|
|
62
|
+
type: 301
|
|
63
|
+
}, {
|
|
64
|
+
source: `/${defaultLanguage}/:path*`,
|
|
65
|
+
destination: "/:path",
|
|
66
|
+
type: 301
|
|
67
|
+
}] : [];
|
|
68
|
+
};
|
|
69
|
+
var resolveFirebasePublicDir = (workspaceRoot, projectRoot, publicDir = ".output/public") => {
|
|
70
|
+
const resolvedPublicDir = path.isAbsolute(publicDir) ? publicDir : path.join(projectRoot, publicDir);
|
|
71
|
+
return normalizePath(path.relative(workspaceRoot, resolvedPublicDir));
|
|
72
|
+
};
|
|
73
|
+
var getFirebaseConfig = (workspaceRoot, projectRoot, appConfig, deployConfig) => {
|
|
74
|
+
const firebase = deployConfig.firebase ?? {};
|
|
75
|
+
const preset = getFirebaseDeployPreset(deployConfig.preset);
|
|
76
|
+
const headers = firebase.headers === false ? void 0 : Array.isArray(firebase.headers) ? firebase.headers : getDefaultFirebaseHeaders(appConfig, firebase.headers, preset.fallback);
|
|
77
|
+
const redirects = [...firebase.redirects ?? [], ...deployConfig.redirectDefaultLanguage ? getDefaultLanguageRedirects(appConfig) : []];
|
|
78
|
+
const rewrites = firebase.rewrites === false ? void 0 : firebase.rewrites ?? preset.rewrites ?? (preset.fallback ? [{
|
|
79
|
+
source: "**",
|
|
80
|
+
destination: preset.fallback
|
|
81
|
+
}] : void 0);
|
|
82
|
+
return { hosting: {
|
|
83
|
+
public: resolveFirebasePublicDir(workspaceRoot, projectRoot, firebase.public ?? preset.public),
|
|
84
|
+
ignore: firebase.ignore ?? [
|
|
85
|
+
"firebase.json",
|
|
86
|
+
"**/.*",
|
|
87
|
+
"**/node_modules/**",
|
|
88
|
+
"**/*.d.ts",
|
|
89
|
+
"**/*.d.ts.map",
|
|
90
|
+
"**/*.tsbuildinfo"
|
|
91
|
+
],
|
|
92
|
+
cleanUrls: firebase.cleanUrls ?? true,
|
|
93
|
+
...headers ? { headers } : {},
|
|
94
|
+
...redirects.length > 0 ? { redirects } : {},
|
|
95
|
+
...rewrites ? { rewrites } : {}
|
|
96
|
+
} };
|
|
97
|
+
};
|
|
98
|
+
var getFirebaseDeployFile = (workspaceRoot, projectRoot, appConfig, deployConfig) => {
|
|
99
|
+
const projectPath = resolveProjectPath(workspaceRoot, projectRoot);
|
|
100
|
+
return {
|
|
101
|
+
path: path.join(workspaceRoot, "vx/deploy/firebase", `${projectPath}.json`),
|
|
102
|
+
content: `${JSON.stringify(getFirebaseConfig(workspaceRoot, projectRoot, appConfig, deployConfig), null, 2)}\n`
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
//#endregion
|
|
106
|
+
export { getFirebaseDeployFile };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/deploy/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,2BAA2B,EAG5B,MAAM,SAAS,CAAA;AAGhB,YAAY,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAwD1D,eAAO,MAAM,oBAAoB,GAC/B,UAAS,2BAAgC,aAoB1C,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { readYamlConfig } from "../yaml-config.js";
|
|
2
|
+
import { getFirebaseDeployFile } from "./firebase.js";
|
|
3
|
+
import { getVercelDeployFile } from "./vercel.js";
|
|
4
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
//#region src/lib/deploy/index.ts
|
|
7
|
+
var writeDeployFile = ({ path: file, content }) => {
|
|
8
|
+
mkdirSync(path.dirname(file), { recursive: true });
|
|
9
|
+
writeFileSync(file, content);
|
|
10
|
+
};
|
|
11
|
+
var findWorkspaceRoot = (projectRoot) => {
|
|
12
|
+
let currentDir = path.resolve(projectRoot);
|
|
13
|
+
while (true) {
|
|
14
|
+
if (existsSync(path.join(currentDir, "nx.json"))) return currentDir;
|
|
15
|
+
const parentDir = path.dirname(currentDir);
|
|
16
|
+
if (parentDir === currentDir) return process.cwd();
|
|
17
|
+
currentDir = parentDir;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var loadYamlConfig = (projectRoot, fileName) => {
|
|
21
|
+
const configFile = path.resolve(projectRoot, fileName);
|
|
22
|
+
return existsSync(configFile) ? readYamlConfig(configFile) : void 0;
|
|
23
|
+
};
|
|
24
|
+
var getDeployFiles = (appConfig, deployConfig, projectRoot) => {
|
|
25
|
+
const workspaceRoot = findWorkspaceRoot(projectRoot);
|
|
26
|
+
return deployConfig.providers.map((provider) => {
|
|
27
|
+
if (provider === "firebase") return getFirebaseDeployFile(workspaceRoot, projectRoot, appConfig, deployConfig);
|
|
28
|
+
if (provider === "vercel") return getVercelDeployFile(workspaceRoot, projectRoot, deployConfig);
|
|
29
|
+
throw new Error(`Unsupported deploy provider "${provider}"`);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
var generateDeployConfig = (options = {}) => {
|
|
33
|
+
const projectRoot = path.resolve(options.projectRoot ?? process.cwd());
|
|
34
|
+
const appConfig = loadYamlConfig(projectRoot, "vx.app.yaml");
|
|
35
|
+
const deployConfig = loadYamlConfig(projectRoot, "vx.deploy.yaml");
|
|
36
|
+
if (!appConfig || !deployConfig) return [];
|
|
37
|
+
const files = getDeployFiles(appConfig, deployConfig, projectRoot);
|
|
38
|
+
for (const file of files) writeDeployFile(file);
|
|
39
|
+
return files.map((file) => file.path);
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { generateDeployConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/lib/deploy/paths.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,WAAoC,CAAA;AAE/E,eAAO,MAAM,kBAAkB,GAC7B,eAAe,MAAM,EACrB,aAAa,MAAM,WACwC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
//#region src/lib/deploy/paths.ts
|
|
3
|
+
var normalizePath = (value) => value.split(path.sep).join("/");
|
|
4
|
+
var resolveProjectPath = (workspaceRoot, projectRoot) => normalizePath(path.relative(workspaceRoot, projectRoot));
|
|
5
|
+
//#endregion
|
|
6
|
+
export { normalizePath, resolveProjectPath };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../src/lib/deploy/presets.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;GASvB,CAAA"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export type HostingProvider = 'firebase' | 'vercel';
|
|
2
|
+
/**
|
|
3
|
+
* Deployment shapes are provider-specific: static Firebase Hosting, or SSR on
|
|
4
|
+
* Vercel. Choose the preset for the application runtime and routing model.
|
|
5
|
+
*/
|
|
6
|
+
export type DeployPreset = 'cdn' | 'spa' | 'start-spa' | 'next' | 'tanstack-start';
|
|
7
|
+
export type FirebaseDeployPresetName = Exclude<DeployPreset, 'next' | 'tanstack-start'>;
|
|
8
|
+
export type VxDeployConfig = {
|
|
9
|
+
preset?: DeployPreset;
|
|
10
|
+
providers: HostingProvider[];
|
|
11
|
+
redirectDefaultLanguage?: boolean;
|
|
12
|
+
firebase?: FirebaseDeployConfig;
|
|
13
|
+
vercel?: VercelDeployConfig;
|
|
14
|
+
};
|
|
15
|
+
export type VxAppConfig = {
|
|
16
|
+
docs?: {
|
|
17
|
+
docsRoute?: string;
|
|
18
|
+
};
|
|
19
|
+
i18n?: {
|
|
20
|
+
defaultLanguage: string;
|
|
21
|
+
languages: string[];
|
|
22
|
+
};
|
|
23
|
+
routes?: RouteConfig[];
|
|
24
|
+
};
|
|
25
|
+
export type RouteConfig = {
|
|
26
|
+
path: string;
|
|
27
|
+
source?: string;
|
|
28
|
+
};
|
|
29
|
+
export type FirebaseDeployConfig = {
|
|
30
|
+
cleanUrls?: boolean;
|
|
31
|
+
headers?: false | FirebaseHeader[] | FirebaseHeaderOptions;
|
|
32
|
+
ignore?: string[];
|
|
33
|
+
public?: string;
|
|
34
|
+
redirects?: FirebaseRedirect[];
|
|
35
|
+
rewrites?: false | FirebaseRewrite[];
|
|
36
|
+
};
|
|
37
|
+
export type FirebaseHeaderOptions = {
|
|
38
|
+
app?: boolean;
|
|
39
|
+
docs?: boolean;
|
|
40
|
+
routes?: boolean;
|
|
41
|
+
static?: boolean;
|
|
42
|
+
};
|
|
43
|
+
export type FirebaseHeader = {
|
|
44
|
+
source: string;
|
|
45
|
+
headers: Array<{
|
|
46
|
+
key: string;
|
|
47
|
+
value: string;
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
50
|
+
export type FirebaseRedirect = {
|
|
51
|
+
source: string;
|
|
52
|
+
destination: string;
|
|
53
|
+
type: number;
|
|
54
|
+
};
|
|
55
|
+
export type FirebaseRewrite = {
|
|
56
|
+
source: string;
|
|
57
|
+
destination: string;
|
|
58
|
+
};
|
|
59
|
+
export type FirebaseConfig = {
|
|
60
|
+
hosting: {
|
|
61
|
+
public: string;
|
|
62
|
+
ignore: string[];
|
|
63
|
+
cleanUrls?: boolean;
|
|
64
|
+
headers?: FirebaseHeader[];
|
|
65
|
+
redirects?: FirebaseRedirect[];
|
|
66
|
+
rewrites?: FirebaseRewrite[];
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export type VercelDeployConfig = {
|
|
70
|
+
buildCommand?: string;
|
|
71
|
+
};
|
|
72
|
+
export type VercelFramework = 'nextjs' | 'tanstack-start' | 'vite' | null;
|
|
73
|
+
export type VercelConfig = {
|
|
74
|
+
$schema: string;
|
|
75
|
+
buildCommand?: string;
|
|
76
|
+
framework: VercelFramework;
|
|
77
|
+
outputDirectory?: string;
|
|
78
|
+
rewrites?: FirebaseRewrite[];
|
|
79
|
+
};
|
|
80
|
+
export type FirebaseDeployPreset = {
|
|
81
|
+
public: string;
|
|
82
|
+
fallback?: string;
|
|
83
|
+
rewrites?: FirebaseRewrite[];
|
|
84
|
+
};
|
|
85
|
+
export type VercelDeployPreset = {
|
|
86
|
+
framework: VercelFramework;
|
|
87
|
+
outputDirectory?: string;
|
|
88
|
+
rewrites?: FirebaseRewrite[];
|
|
89
|
+
};
|
|
90
|
+
export type GenerateDeployConfigOptions = {
|
|
91
|
+
projectRoot?: string;
|
|
92
|
+
};
|
|
93
|
+
export type DeployFile = {
|
|
94
|
+
path: string;
|
|
95
|
+
content: string;
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/deploy/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vercel.d.ts","sourceRoot":"","sources":["../../../src/lib/deploy/vercel.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EAIV,cAAc,EACf,MAAM,SAAS,CAAA;AAsBhB,eAAO,MAAM,mBAAmB,GAC9B,eAAe,MAAM,EACrB,aAAa,MAAM,EACnB,cAAc,cAAc,KAC3B,UAqBF,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { resolveProjectPath } from "./paths.js";
|
|
2
|
+
import { cdnRewrites } from "./presets.js";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
//#region src/lib/deploy/vercel.ts
|
|
5
|
+
var vercelDeployPresets = {
|
|
6
|
+
cdn: {
|
|
7
|
+
framework: "vite",
|
|
8
|
+
outputDirectory: "dist",
|
|
9
|
+
rewrites: cdnRewrites
|
|
10
|
+
},
|
|
11
|
+
spa: {
|
|
12
|
+
framework: "vite",
|
|
13
|
+
outputDirectory: "dist",
|
|
14
|
+
rewrites: [{
|
|
15
|
+
source: "/(.*)",
|
|
16
|
+
destination: "/index.html"
|
|
17
|
+
}]
|
|
18
|
+
},
|
|
19
|
+
"start-spa": {
|
|
20
|
+
framework: null,
|
|
21
|
+
outputDirectory: ".output/public",
|
|
22
|
+
rewrites: [{
|
|
23
|
+
source: "/(.*)",
|
|
24
|
+
destination: "/_shell.html"
|
|
25
|
+
}]
|
|
26
|
+
},
|
|
27
|
+
next: { framework: "nextjs" },
|
|
28
|
+
"tanstack-start": { framework: "tanstack-start" }
|
|
29
|
+
};
|
|
30
|
+
var getVercelDeployFile = (workspaceRoot, projectRoot, deployConfig) => {
|
|
31
|
+
const projectPath = resolveProjectPath(workspaceRoot, projectRoot);
|
|
32
|
+
const vercel = deployConfig.vercel ?? {};
|
|
33
|
+
const preset = deployConfig.preset ? vercelDeployPresets[deployConfig.preset] : vercelDeployPresets["start-spa"];
|
|
34
|
+
const config = {
|
|
35
|
+
$schema: "https://openapi.vercel.sh/vercel.json",
|
|
36
|
+
framework: preset.framework,
|
|
37
|
+
...preset.outputDirectory ? { outputDirectory: preset.outputDirectory } : {},
|
|
38
|
+
...preset.rewrites ? { rewrites: preset.rewrites } : {},
|
|
39
|
+
...vercel.buildCommand ? { buildCommand: vercel.buildCommand } : {}
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
path: path.join(workspaceRoot, "vx/deploy/vercel", `${projectPath}.json`),
|
|
43
|
+
content: `${JSON.stringify(config, null, 2)}\n`
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
//#endregion
|
|
47
|
+
export { getVercelDeployFile };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework.d.ts","sourceRoot":"","sources":["../../src/lib/framework.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,eAAe,GAAG,MAAM,CAAA;AAEtE,eAAO,MAAM,iBAAiB,GAAI,OAAO,OAAO,KAAG,SAWlD,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/lib/framework.ts
|
|
2
|
+
var validateFramework = (value) => {
|
|
3
|
+
if (value === "vite" || value === "tanstack" || value === "tanstack-docs" || value === "next") return value;
|
|
4
|
+
throw new Error("vx.app.yaml framework must be vite, tanstack, tanstack-docs, or next");
|
|
5
|
+
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export { validateFramework };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/lib/i18n.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,OAAO,UAAU,KAAG,UAQ/C,CAAA"}
|
package/dist/lib/i18n.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/lib/i18n.ts
|
|
2
|
+
var resolveI18n = (i18n) => {
|
|
3
|
+
const defaultLanguage = i18n?.defaultLanguage ?? "en";
|
|
4
|
+
const configuredLanguages = i18n?.languages ?? [];
|
|
5
|
+
return {
|
|
6
|
+
defaultLanguage,
|
|
7
|
+
languages: configuredLanguages.includes(defaultLanguage) ? configuredLanguages : [...configuredLanguages, defaultLanguage]
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { resolveI18n };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/integrations/next/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D,MAAM,MAAM,UAAU,GAAG,aAAa,CAAA;AAYtC,eAAO,MAAM,YAAY,GAAI,YAAW,UAAe,qDAmBtD,CAAA"}
|