@czfabrics/front-ready 0.1.0-beta.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/.dist/index.cjs +129 -0
- package/.dist/index.d.ts +1 -0
- package/.dist/index.mjs +100 -0
- package/.dist/main.mjs +1337 -0
- package/.dist/src/config/schema.d.ts +45 -0
- package/LICENSE +21 -0
- package/README.md +201 -0
- package/package.json +96 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export type Config = z.input<typeof ConfigSchema>;
|
|
3
|
+
export type InternalConfig = z.output<typeof ConfigSchema>;
|
|
4
|
+
export type ConfigSchema = typeof ConfigSchema;
|
|
5
|
+
export declare const ConfigSchema: z.ZodObject<{
|
|
6
|
+
bucket: z.ZodObject<{
|
|
7
|
+
namePrefix: z.ZodString;
|
|
8
|
+
params: z.ZodObject<{
|
|
9
|
+
region: z.ZodString;
|
|
10
|
+
apiVersion: z.ZodString;
|
|
11
|
+
endpoint: z.ZodString;
|
|
12
|
+
forcePathStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodCodec<z.ZodString, z.ZodBoolean>, z.ZodBoolean]>>;
|
|
13
|
+
credentials: z.ZodObject<{
|
|
14
|
+
accessKeyId: z.ZodString;
|
|
15
|
+
secretAccessKey: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
front: z.ZodPrefault<z.ZodObject<{
|
|
19
|
+
cacheControlMapping: z.ZodDefault<z.ZodRecord<z.ZodTemplateLiteral<`^${string}$`>, z.ZodString>>;
|
|
20
|
+
indexDocumentSuffix: z.ZodDefault<z.ZodString>;
|
|
21
|
+
errorDocumentKey: z.ZodDefault<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
upload: z.ZodPrefault<z.ZodObject<{
|
|
24
|
+
concurrency: z.ZodDefault<z.ZodNumber>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
front: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
28
|
+
type: z.ZodLiteral<"angular">;
|
|
29
|
+
angular: z.ZodObject<{
|
|
30
|
+
projectName: z.ZodString;
|
|
31
|
+
angularJsonPath: z.ZodString;
|
|
32
|
+
configurationName: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
35
|
+
type: z.ZodLiteral<"custom">;
|
|
36
|
+
custom: z.ZodObject<{
|
|
37
|
+
build: z.ZodObject<{
|
|
38
|
+
command: z.ZodString;
|
|
39
|
+
args: z.ZodArray<z.ZodString>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
environmentName: z.ZodString;
|
|
42
|
+
buildOutputPath: z.ZodString;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
}, z.core.$strip>], "type">;
|
|
45
|
+
}, z.core.$strip>;
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Dylan Valentin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
<!-- ⚠️ This README has been generated from the file(s) ".blueprint.md" ⚠️--><h1 align="center">@czfabrics/front-ready</h1>
|
|
2
|
+
<p align="center">
|
|
3
|
+
<a href="https://npmcharts.com/compare/@czfabrics/front-ready?minimal=true"><img alt="Downloads per month" src="https://img.shields.io/npm/dm/@czfabrics/front-ready.svg" height="20"/></a>
|
|
4
|
+
<a href="https://www.npmjs.com/package/@czfabrics/front-ready"><img alt="NPM Version" src="https://img.shields.io/npm/v/@czfabrics/front-ready.svg" height="20"/></a>
|
|
5
|
+
<a href="https://github.com/czfabrics/front-ready/graphs/commit-activity"><img alt="Maintained" src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" height="20"/></a>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<b>A framework-aware deployment tool for static frontends. It reads your project's build configuration (e.g. angular.json), runs the build with the configuration you choose, and pushes the compiled output to an S3 bucket — with correct content types and cache headers — so a single command takes you from source to a live, hosted site.</b></br>
|
|
10
|
+
<sub><sub>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<br />
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
[](#table-of-contents)
|
|
17
|
+
|
|
18
|
+
## Table of Contents
|
|
19
|
+
|
|
20
|
+
* [Overview](#overview)
|
|
21
|
+
* [Key Features](#key-features)
|
|
22
|
+
* [Installation](#installation)
|
|
23
|
+
* [Bun](#bun)
|
|
24
|
+
* [Yarn](#yarn)
|
|
25
|
+
* [NPM](#npm)
|
|
26
|
+
* [Quick Start](#quick-start)
|
|
27
|
+
* [Usage](#usage)
|
|
28
|
+
* [Custom](#custom)
|
|
29
|
+
* [Angular](#angular)
|
|
30
|
+
* [License](#license)
|
|
31
|
+
|
|
32
|
+
[](#overview)
|
|
33
|
+
|
|
34
|
+
## Overview
|
|
35
|
+
|
|
36
|
+
A framework-aware deployment tool for static frontends. It reads your project's build configuration (e.g. angular.json), runs the build with the configuration you choose, and pushes the compiled output to an S3 bucket — with correct content types and cache headers — so a single command takes you from source to a live, hosted site.
|
|
37
|
+
|
|
38
|
+
### Key Features
|
|
39
|
+
|
|
40
|
+
- **S3 Bucket support**: Upload your frontend files to an S3 bucket.
|
|
41
|
+
- **S3 Bucket host agnostic**: Choose the host you want (Amazon, OVH, etc.).
|
|
42
|
+
- **Angular support**: It reads your `angular.json` to know how to build and which folder is the output build folder.
|
|
43
|
+
- **Any Front support**: Adaptable to any frontend by using the `custom` config.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
[](#installation)
|
|
47
|
+
|
|
48
|
+
## Installation
|
|
49
|
+
|
|
50
|
+
### Bun
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
bun add @czfabrics/front-ready@0.1.0-beta.1
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Yarn
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
yarn add @czfabrics/front-ready@0.1.0-beta.1
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### NPM
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
npm install @czfabrics/front-ready@0.1.0-beta.1
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
[](#quick-start)
|
|
70
|
+
|
|
71
|
+
## Quick Start
|
|
72
|
+
|
|
73
|
+
**Config `frontready.config.ts`:**
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
import { Config } from '@czfabrics/front-ready'
|
|
77
|
+
|
|
78
|
+
export default {
|
|
79
|
+
bucket: {
|
|
80
|
+
namePrefix: 'my-front-hosting',
|
|
81
|
+
params: {
|
|
82
|
+
region: 'eu-west-3',
|
|
83
|
+
apiVersion: '2006-03-01',
|
|
84
|
+
endpoint: 'https://s3.eu-west-3.amazonaws.com',
|
|
85
|
+
credentials: {
|
|
86
|
+
accessKeyId: 'AKIAIOSFODNN7EXAMPLE',
|
|
87
|
+
secretAccessKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
front: {
|
|
92
|
+
type: 'custom',
|
|
93
|
+
custom: {
|
|
94
|
+
build: {
|
|
95
|
+
command: 'npx ng build',
|
|
96
|
+
args: ['--configuration', 'production'],
|
|
97
|
+
},
|
|
98
|
+
environmentName: 'production',
|
|
99
|
+
buildOutputPath: './example',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
} satisfies Config
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Command:**
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
npx @czfabrics/front-ready create
|
|
109
|
+
npx @czfabrics/front-ready deploy
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
[](#usage)
|
|
114
|
+
|
|
115
|
+
## Usage
|
|
116
|
+
|
|
117
|
+
### Custom
|
|
118
|
+
|
|
119
|
+
**Config `frontready.config.ts`:**
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
import { Config } from '@czfabrics/front-ready'
|
|
123
|
+
|
|
124
|
+
export default {
|
|
125
|
+
bucket: {
|
|
126
|
+
namePrefix: 'my-front-hosting',
|
|
127
|
+
params: {
|
|
128
|
+
region: 'eu-west-3',
|
|
129
|
+
apiVersion: '2006-03-01',
|
|
130
|
+
endpoint: 'https://s3.eu-west-3.amazonaws.com',
|
|
131
|
+
credentials: {
|
|
132
|
+
accessKeyId: 'AKIAIOSFODNN7EXAMPLE',
|
|
133
|
+
secretAccessKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
front: {
|
|
138
|
+
type: 'custom',
|
|
139
|
+
custom: {
|
|
140
|
+
build: {
|
|
141
|
+
command: 'npx ng build',
|
|
142
|
+
args: ['--configuration', 'production'],
|
|
143
|
+
},
|
|
144
|
+
environmentName: 'production',
|
|
145
|
+
buildOutputPath: './example',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
} satisfies Config
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Command:**
|
|
152
|
+
|
|
153
|
+
```sh
|
|
154
|
+
npx @czfabrics/front-ready create
|
|
155
|
+
npx @czfabrics/front-ready deploy
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Angular
|
|
159
|
+
|
|
160
|
+
**Config `frontready.config.ts`:**
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
import { Config } from '@czfabrics/front-ready'
|
|
164
|
+
|
|
165
|
+
export default {
|
|
166
|
+
bucket: {
|
|
167
|
+
namePrefix: 'my-front-hosting',
|
|
168
|
+
params: {
|
|
169
|
+
region: 'eu-west-3',
|
|
170
|
+
apiVersion: '2006-03-01',
|
|
171
|
+
endpoint: 'https://s3.eu-west-3.amazonaws.com',
|
|
172
|
+
credentials: {
|
|
173
|
+
accessKeyId: 'AKIAIOSFODNN7EXAMPLE',
|
|
174
|
+
secretAccessKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
front: {
|
|
179
|
+
type: 'angular',
|
|
180
|
+
angular: {
|
|
181
|
+
angularJsonPath: './angular.json',
|
|
182
|
+
configurationName: 'production',
|
|
183
|
+
projectName: 'MyFront',
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
} satisfies Config
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Command:**
|
|
190
|
+
|
|
191
|
+
```sh
|
|
192
|
+
npx @czfabrics/front-ready create
|
|
193
|
+
npx @czfabrics/front-ready deploy
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
[](#license)
|
|
198
|
+
|
|
199
|
+
## License
|
|
200
|
+
|
|
201
|
+
Licensed under [MIT](https://opensource.org/licenses/MIT).
|
package/package.json
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@czfabrics/front-ready",
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "Dylan Valentin",
|
|
6
|
+
"email": "dylan.valentin@ik.me",
|
|
7
|
+
"url": "https://github.com/czyrok"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/czfabrics/front-ready.git"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@aws-sdk/client-s3": "^3.1061.0",
|
|
15
|
+
"@clack/prompts": "^1.5.1",
|
|
16
|
+
"@effect/platform": "^0.96.1",
|
|
17
|
+
"@effect/platform-node": "^0.107.0",
|
|
18
|
+
"c12": "^4.0.0-beta.5",
|
|
19
|
+
"cmd-ts": "^0.15.0",
|
|
20
|
+
"effect": "^3.21.2",
|
|
21
|
+
"mrmime": "^2.0.1",
|
|
22
|
+
"zod": "^4.4.3"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@appnest/readme": "^1.2.7",
|
|
26
|
+
"@types/pluralize": "^0.0.33",
|
|
27
|
+
"@typescript/analyze-trace": "^0.10.1",
|
|
28
|
+
"esbuild": "^0.25.9",
|
|
29
|
+
"prettier": "^3.6.2",
|
|
30
|
+
"rimraf": "^6.0.1",
|
|
31
|
+
"tsc-alias": "^1.8.16",
|
|
32
|
+
"tsx": "^4.21.0",
|
|
33
|
+
"type-fest": "^5.3.1",
|
|
34
|
+
"typescript": "^5.9.2",
|
|
35
|
+
"vite-tsconfig-paths": "^6.1.0",
|
|
36
|
+
"vitest": "^4.0.18",
|
|
37
|
+
"vscode-generate-index-standalone": "^1.7.1"
|
|
38
|
+
},
|
|
39
|
+
"main": "./.dist/index.cjs",
|
|
40
|
+
"module": "./.dist/index.mjs",
|
|
41
|
+
"types": "./.dist/index.d.ts",
|
|
42
|
+
"exports": {
|
|
43
|
+
"./package.json": "./package.json",
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./.dist/index.d.ts",
|
|
46
|
+
"import": "./.dist/index.mjs",
|
|
47
|
+
"require": "./.dist/index.cjs"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"bin": "./.dist/main.mjs",
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/czfabrics/front-ready/issues"
|
|
53
|
+
},
|
|
54
|
+
"description": "A framework-aware deployment tool for static frontends. It reads your project's build configuration (e.g. angular.json), runs the build with the configuration you choose, and pushes the compiled output to an S3 bucket — with correct content types and cache headers — so a single command takes you from source to a live, hosted site.",
|
|
55
|
+
"files": [
|
|
56
|
+
"package.json",
|
|
57
|
+
"README.md",
|
|
58
|
+
"LICENSE",
|
|
59
|
+
".dist/**/*"
|
|
60
|
+
],
|
|
61
|
+
"homepage": "https://github.com/czfabrics/front-ready#readme",
|
|
62
|
+
"keywords": [
|
|
63
|
+
"cli",
|
|
64
|
+
"deploy",
|
|
65
|
+
"deployment",
|
|
66
|
+
"s3",
|
|
67
|
+
"aws",
|
|
68
|
+
"aws-s3",
|
|
69
|
+
"bucket",
|
|
70
|
+
"frontend",
|
|
71
|
+
"static-site",
|
|
72
|
+
"static-hosting",
|
|
73
|
+
"spa",
|
|
74
|
+
"build",
|
|
75
|
+
"angular",
|
|
76
|
+
"ci-cd",
|
|
77
|
+
"upload",
|
|
78
|
+
"typescript"
|
|
79
|
+
],
|
|
80
|
+
"license": "MIT",
|
|
81
|
+
"scripts": {
|
|
82
|
+
"format:all": "prettier . --write",
|
|
83
|
+
"typecheck": "tsc --project ./tsconfig.typecheck.json",
|
|
84
|
+
"dev": "tsx main.ts",
|
|
85
|
+
"test": "vitest",
|
|
86
|
+
"test:coverage": "vitest --coverage.enabled",
|
|
87
|
+
"check:type-perf": "rimraf .tsc_traces && tsc --project ./tsconfig.typecheck.json --generateTrace .tsc_traces && analyze-trace .tsc_traces",
|
|
88
|
+
"prepare:index": "vscode-generate-index-standalone index.ts",
|
|
89
|
+
"prepare:dist": "tsx build.ts",
|
|
90
|
+
"prepare:declaration": "tsc --project ./tsconfig.declaration.json",
|
|
91
|
+
"prepare:imports": "tsc-alias --project tsconfig.declaration.json --outDir .dist",
|
|
92
|
+
"build": "rimraf .dist && bun run prepare:index && bun run prepare:dist && bun run prepare:declaration && bun run prepare:imports",
|
|
93
|
+
"generate:readme": "readme generate --config .blueprint.json",
|
|
94
|
+
"prepublishOnly": "bun run generate:readme && bun run build"
|
|
95
|
+
}
|
|
96
|
+
}
|