@fractal_cloud/sdk 0.1.0 → 0.1.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 +196 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -7,10 +7,204 @@
|
|
|
7
7
|
[![codecov][codecov-image]][codecov-url]
|
|
8
8
|
[![TypeScript Style Guide][gts-image]][gts-url]
|
|
9
9
|
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
The Fractal TypeScript SDK is an early stage but production oriented SDK that allows platform engineers and application developers to define cloud agnostic infrastructure blueprints using TypeScript.
|
|
13
|
+
It is designed to bridge software architecture and infrastructure automation, enabling teams to express infrastructure intent in a general purpose language without relying on vendor specific tools or domain specific languages.
|
|
14
|
+
With Fractal, infrastructure is no longer written as low level scripts. It is modeled as reusable architectural building blocks that can be validated, governed, and evolved over time.
|
|
15
|
+
This SDK is currently at version 0.1.0. It supports Blueprint definition and deployment and is intended for early production pilots and platform experimentation.
|
|
16
|
+
|
|
17
|
+
## Why Fractal
|
|
18
|
+
|
|
19
|
+
Modern infrastructure automation forces teams to choose between flexibility and control.
|
|
20
|
+
|
|
21
|
+
Traditional Infrastructure as Code approaches are:
|
|
22
|
+
|
|
23
|
+
1. Tightly coupled to a specific cloud vendor
|
|
24
|
+
2. Based on string heavy DSLs
|
|
25
|
+
3. Difficult to govern at scale
|
|
26
|
+
4. Focused on resources rather than architecture
|
|
27
|
+
|
|
28
|
+
Fractal Cloud takes a different approach.
|
|
29
|
+
|
|
30
|
+
Fractal Cloud allows you to:
|
|
31
|
+
|
|
32
|
+
1. Define infrastructure as architecture, not scripts
|
|
33
|
+
2. Use TypeScript instead of a DSL
|
|
34
|
+
3. Encode governance and intent directly into reusable blueprints
|
|
35
|
+
4. Remain cloud-agnostic by design
|
|
36
|
+
|
|
37
|
+
This SDK is the programmatic interface to that model.
|
|
38
|
+
|
|
39
|
+
## Core concepts in one minute
|
|
40
|
+
|
|
41
|
+
You do not need prior knowledge of Fractal to use this SDK, the most important concepts are explained below.
|
|
42
|
+
|
|
43
|
+
### Fractal
|
|
44
|
+
|
|
45
|
+
A Fractal is a governed, reusable infrastructure construct.
|
|
46
|
+
It defines what an infrastructure system is allowed to be, not just what it deploys.
|
|
47
|
+
|
|
48
|
+
### Blueprint
|
|
49
|
+
|
|
50
|
+
A Blueprint is the static definition of a Fractal.
|
|
51
|
+
It describes components, their relationships, and their architectural intent.
|
|
52
|
+
|
|
53
|
+
### Live System
|
|
54
|
+
|
|
55
|
+
A Live System is a running instance of a Fractal deployed to a cloud environment.
|
|
56
|
+
Live Systems are not yet supported in the TypeScript SDK.
|
|
57
|
+
|
|
58
|
+
For a deeper explanation of Fractal Architecture, see the documentation linked below.
|
|
59
|
+
|
|
60
|
+
## What this SDK does today
|
|
61
|
+
|
|
62
|
+
Version 0.1.0 supports the following capabilities.
|
|
63
|
+
|
|
64
|
+
* Definition of Fractal Blueprints using TypeScript
|
|
65
|
+
* Deployment of Blueprints to Fractal Cloud
|
|
66
|
+
* Usage from both personal and organization owned accounts
|
|
67
|
+
|
|
68
|
+
This SDK does not yet support:
|
|
69
|
+
|
|
70
|
+
* Live System creation
|
|
71
|
+
* Component instantiation
|
|
72
|
+
* Lifecycle or operational actions
|
|
73
|
+
* Bounded Context helpers
|
|
74
|
+
* Environment helpers
|
|
75
|
+
|
|
76
|
+
If you are looking to model architecture, validate concepts, or start early production pilots with Fractal Blueprints, this SDK is ready.
|
|
77
|
+
|
|
78
|
+
## Architectural positioning
|
|
79
|
+
|
|
80
|
+
The Fractal TypeScript SDK acts as a bridge between software architecture and infrastructure automation.
|
|
81
|
+
|
|
82
|
+
It allows teams to:
|
|
83
|
+
|
|
84
|
+
* Describe infrastructure using architectural concepts
|
|
85
|
+
* Keep infrastructure definitions vendor neutral
|
|
86
|
+
* Rely on the Fractal Automation Engine to interpret and enforce those definitions
|
|
87
|
+
|
|
88
|
+
This SDK does not replace cloud providers, nor does it expose raw infrastructure primitives.
|
|
89
|
+
Instead, it defines intent and delegates execution to the Fractal Automation Engine.
|
|
90
|
+
|
|
91
|
+
This is Infrastructure as Code without cloud-specific code.
|
|
92
|
+
|
|
93
|
+
## Installation
|
|
94
|
+
|
|
95
|
+
The SDK is published as a public npm package.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
npm install @fractal_cloud/sdk
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
[Package page](https://www.npmjs.com/package/@fractal_cloud/sdk)
|
|
102
|
+
|
|
103
|
+
[Source repository](https://github.com/Fractal-Cloud/fractal-ts-sdk)
|
|
104
|
+
|
|
105
|
+
Node.js and TypeScript requirements are documented in the repository and follow standard modern LTS versions.
|
|
106
|
+
|
|
107
|
+
## Minimal example
|
|
108
|
+
|
|
109
|
+
The following example defines and deploys the smallest useful Fractal Blueprint supported today.
|
|
110
|
+
|
|
111
|
+
It creates a Fractal with a single component and deploys the Blueprint to Fractal Cloud.
|
|
112
|
+
|
|
113
|
+
```js
|
|
114
|
+
const fractal = Fractal.getBuilder()
|
|
115
|
+
.withId(Fractal.Id.getBuilder()
|
|
116
|
+
.withBoundedContextId(BoundedContext.Id.getBuilder()
|
|
117
|
+
.withOwnerType(OwnerType.Personal)
|
|
118
|
+
.withOwnerId(OwnerId.getBuilder()
|
|
119
|
+
.withValue("1896f44c-9ff6-4dde-9a6d-f8d621d6bcab")
|
|
120
|
+
.build())
|
|
121
|
+
.withName(KebabCaseString.getBuilder().withValue("test-ang").build())
|
|
122
|
+
.build())
|
|
123
|
+
.withName(KebabCaseString.getBuilder().withValue("fractal-from-ts").build())
|
|
124
|
+
.withVersion(Version.getBuilder().withMajor(1).withMinor(0).withPatch(0).build())
|
|
125
|
+
.build())
|
|
126
|
+
.withComponent(Fractal.Component.getBuilder()
|
|
127
|
+
.withId(Fractal.Component.Id.getBuilder()
|
|
128
|
+
.withValue(KebabCaseString.getBuilder().withValue("container-orchestrator").build())
|
|
129
|
+
.build())
|
|
130
|
+
.withVersion(Version.getBuilder().withMajor(1).withMinor(0).withPatch(0).build())
|
|
131
|
+
.withDescription("Container orchestrator for the fractal")
|
|
132
|
+
.withDisplayName("Container orchestrator")
|
|
133
|
+
.withType(Fractal.Component.Type.getBuilder()
|
|
134
|
+
.withInfrastructureDomain(InfrastructureDomain.NetworkAndCompute)
|
|
135
|
+
.withServiceDeliveryModel(ServiceDeliveryModel.PaaS)
|
|
136
|
+
.withName(PascalCaseString.getBuilder().withValue("Kubernetes").build())
|
|
137
|
+
.build())
|
|
138
|
+
.build())
|
|
139
|
+
.build();
|
|
140
|
+
|
|
141
|
+
await fractal.deploy(
|
|
142
|
+
ServiceAccountCredentials.getBuilder()
|
|
143
|
+
.withId(ServiceAccountId.getBuilder()
|
|
144
|
+
.withValue(process.env["SERVICE_ACCOUNT_ID"])
|
|
145
|
+
.build())
|
|
146
|
+
.withSecret(process.env["SERVICE_ACCOUNT_SECRET"])
|
|
147
|
+
.build());
|
|
148
|
+
```
|
|
149
|
+
Important notes:
|
|
150
|
+
|
|
151
|
+
* This code defines and deploys a Blueprint, not a Live System
|
|
152
|
+
* Deployment registers the Blueprint with Fractal Cloud
|
|
153
|
+
* No cloud resources are provisioned at this stage
|
|
154
|
+
|
|
155
|
+
## Current limitations
|
|
156
|
+
|
|
157
|
+
This version intentionally exposes the raw model.
|
|
158
|
+
|
|
159
|
+
Known limitations include:
|
|
160
|
+
|
|
161
|
+
1. No typed helpers for component types
|
|
162
|
+
2. No Bounded Context or Environment abstractions
|
|
163
|
+
3. API surface still evolving
|
|
164
|
+
|
|
165
|
+
These limitations are addressed in the roadmap below.
|
|
166
|
+
|
|
167
|
+
## Roadmap
|
|
168
|
+
|
|
169
|
+
Planned development priorities are:
|
|
170
|
+
|
|
171
|
+
1. Live System support
|
|
172
|
+
2. Syntax sugar and typed helpers
|
|
173
|
+
3. Bounded Context support
|
|
174
|
+
4. Environment support
|
|
175
|
+
|
|
176
|
+
The API is expected to evolve as these capabilities are introduced. Feedback from early users will directly influence design decisions.
|
|
177
|
+
|
|
178
|
+
## Samples and learning resources
|
|
179
|
+
|
|
180
|
+
[Sample repository](https://github.com/Fractal-Cloud/fractal-ts-sdk-samples)
|
|
181
|
+
|
|
182
|
+
[Fractal Architecture documentation](https://docs.fractal.cloud/)
|
|
183
|
+
|
|
184
|
+
## Contributing and feedback
|
|
185
|
+
|
|
186
|
+
Contributions and feedback are welcome.
|
|
187
|
+
|
|
188
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines
|
|
189
|
+
|
|
190
|
+
Use GitHub Issues for bugs and feature requests
|
|
191
|
+
|
|
192
|
+
Use GitHub Discussions for design and architectural questions
|
|
193
|
+
|
|
194
|
+
Direct contact and Slack channels are available for early adopters
|
|
195
|
+
|
|
196
|
+
This SDK is being built in close collaboration with its users.
|
|
197
|
+
|
|
198
|
+
## License
|
|
199
|
+
|
|
200
|
+
This project is licensed under GPLv3.
|
|
201
|
+
|
|
202
|
+
See the [LICENSE](LICENSE) file for details.
|
|
203
|
+
|
|
10
204
|
Made with ❤️ by the Fractal Cloud team.
|
|
11
205
|
|
|
12
|
-
[npm-image]: https://img.shields.io/npm/v/
|
|
13
|
-
[npm-url]: https://npmjs.org/package/
|
|
206
|
+
[npm-image]: https://img.shields.io/npm/v/@fractal_cloud/sdk.svg
|
|
207
|
+
[npm-url]: https://npmjs.org/package/@fractal_cloud/sdk
|
|
14
208
|
[build-image]: https://github.com/Fractal-Cloud/fractal-ts-sdk/actions/workflows/pr.yml/badge.svg
|
|
15
209
|
[build-url]: https://github.com/Fractal-Cloud/fractal-ts-sdk/actions/workflows/pr.yml
|
|
16
210
|
[license-image]: https://img.shields.io/github/license/Fractal-Cloud/fractal-ts-sdk.svg
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fractal_cloud/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Typescript Fractal Cloud SDK",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"author": "Fractal Cloud",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.mjs",
|
|
9
|
-
"types": "dist/index.d.
|
|
9
|
+
"types": "dist/index.d.mts",
|
|
10
10
|
"files": [
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"url": "https://github.com/Fractal-Cloud/fractal-ts-sdk"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
-
"build": "
|
|
18
|
+
"build": "tsdown",
|
|
19
19
|
"build:docs": "typedoc --entryPointStrategy Expand --exclude \"**/*+(.test|.e2e).ts\" src",
|
|
20
|
-
"dev": "
|
|
20
|
+
"dev": "tsdown --watch",
|
|
21
21
|
"test": "vitest run",
|
|
22
22
|
"test:watch": "vitest",
|
|
23
23
|
"lint": "gts lint",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@types/node": "^22.7.5",
|
|
29
29
|
"@types/superagent": "^8.1.9",
|
|
30
30
|
"gts": "^7.0.0",
|
|
31
|
-
"
|
|
31
|
+
"tsdown": "^0.20.3",
|
|
32
32
|
"typedoc": "^0.28.15",
|
|
33
33
|
"typescript": "^5.9.3",
|
|
34
34
|
"vitest": "^4.0.16"
|