@c6fc/spellcraft 0.0.8 → 0.0.10
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 +25 -21
- package/package.json +1 -1
package/README.md
CHANGED
@@ -129,8 +129,8 @@ $ npx spellcraft --help
|
|
129
129
|
Commands:
|
130
130
|
spellcraft generate <filename> Generates files from a configuration
|
131
131
|
spellcraft importModule <npmPackage> [name] Configures the current project to use a SpellCraft module
|
132
|
-
spellcraft aws-identity Display the AWS IAM identity of the SpellCraft context
|
133
|
-
spellcraft aws-exportcredentials Export the current credentials as environment variables
|
132
|
+
spellcraft aws-identity Display the AWS IAM identity of the SpellCraft context # Added by a module
|
133
|
+
spellcraft aws-exportcredentials Export the current credentials as environment variables # Added by a module
|
134
134
|
```
|
135
135
|
|
136
136
|
## Programmatic Usage (API)
|
@@ -139,10 +139,9 @@ For more advanced workflows, such as integration into larger automation scripts,
|
|
139
139
|
|
140
140
|
The typical flow is:
|
141
141
|
1. Instantiate `SpellFrame`.
|
142
|
-
2.
|
143
|
-
3.
|
144
|
-
4.
|
145
|
-
5. Write the resulting object to disk with `write()`.
|
142
|
+
2. Run module initializers with `init()`.
|
143
|
+
3. Render the Jsonnet file with `render()`.
|
144
|
+
4. Write the resulting object to disk with `write()`.
|
146
145
|
|
147
146
|
```javascript
|
148
147
|
// my-automation-script.js
|
@@ -157,33 +156,38 @@ const frame = new SpellFrame({
|
|
157
156
|
});
|
158
157
|
|
159
158
|
(async () => {
|
160
|
-
|
161
|
-
// 2.
|
162
|
-
// This loads modules listed in 'spellcraft_modules/packages.json'
|
163
|
-
// and from the local 'spellcraft_modules/' directory.
|
164
|
-
// frame.loadModuleByName('my-module-key', 'my-npm-package');
|
165
|
-
|
166
|
-
// 3. Initialize modules (if any modules registered an init function)
|
159
|
+
|
160
|
+
// 2. Initialize modules before rendering.
|
167
161
|
await frame.init();
|
168
162
|
|
169
|
-
//
|
163
|
+
// 3. Render the master Jsonnet file
|
170
164
|
const manifest = await frame.render(path.resolve('./manifest.jsonnet'));
|
171
165
|
|
172
166
|
// The result is available in memory
|
173
167
|
console.log('Rendered Manifest:', JSON.stringify(manifest, null, 2));
|
174
168
|
|
175
|
-
//
|
176
|
-
|
169
|
+
// 4. Write the manifest object to the filesystem. Defaults to the contents of
|
170
|
+
// the most recent 'render'.
|
171
|
+
frame.write();
|
177
172
|
|
178
173
|
console.log('Successfully wrote files to the dist/ directory!');
|
179
174
|
|
180
|
-
} catch (error) {
|
181
|
-
console.error('An error occurred during the SpellCraft process:', error);
|
182
|
-
process.exit(1);
|
183
|
-
}
|
184
175
|
})();
|
185
176
|
```
|
186
177
|
|
187
|
-
##
|
178
|
+
## Top-tier spellframe extensions by SpellCraft authors:
|
179
|
+
|
180
|
+
It can be hard to conceptualize what SpellCraft is capable of by just looking at the engine itself. Here are a set of SpellCraft modules that demonstrate the extensibility of the engine:
|
181
|
+
|
182
|
+
|Package|Description|
|
183
|
+
|---|---|
|
184
|
+
|[**@c6fc/spellcraft-aws-auth**](https://www.npmjs.com/package/@c6fc/spellcraft-aws-auth)|Exposes the full power of the AWS SDK for JavaScript to your SpellFrames, including native support for common AWS credential sources and role-chaining.|
|
185
|
+
|[**@c6fc/spellcraft-terraform**](https://www.npmjs.com/package/@c6fc/spellcraft-terraform)|Brings Terraform into your SpellCraft CLI and SpellFrames, allowing you to directly deploy the results of your Spells.|
|
186
|
+
|[**@c6fc/spellcraft-packer**](https://www.npmjs.com/package/@c6fc/spellcraft-packer)|Brings Packer into SpellCraft CLI and SpellFrames, allowing you to run builds against the results of your Spells.|
|
187
|
+
|[**@c6fc/spellcraft-aws-terraform**](https://www.npmjs.com/package/@c6fc/spellcraft-aws-terraform)|Contains shortcuts for common use-cases when using Terraform to deploy configurations to AWS. Including backend bootstrapping, artifact repositories, and remote state access. It also demonstrates how modules can build on the capabilities of other modules.|
|
188
|
+
|[**@c6fc/spellcraft-aws-s3**](https://www.npmjs.com/package/@c6fc/spellcraft-aws-s3)|A simple but powerful module for creating AWS S3 buckets. It uses secure defaults, exposes common use-cases as optional 'types', and grants extensive control with minimal code.|
|
189
|
+
|
190
|
+
|
191
|
+
## Creating Your Own Modules
|
188
192
|
|
189
193
|
When you're ready to start writing your own modules and unleashing the true power of SpellCraft, check out **[create-spellcraft-module](https://www.npmjs.com/package/@c6fc/spellcraft)**
|