@octalmesh/seagull-core 0.0.2
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.md +21 -0
- package/README.md +52 -0
- package/dist/index.mjs +1364 -0
- package/package.json +45 -0
- package/src/config/loader.ts +353 -0
- package/src/config/publishing.ts +37 -0
- package/src/config/resolve-config-file.ts +38 -0
- package/src/config/schema.ts +270 -0
- package/src/config/template.ts +113 -0
- package/src/config/types.ts +139 -0
- package/src/generator/generator.ts +33 -0
- package/src/generator/registry.ts +51 -0
- package/src/generator/types.ts +38 -0
- package/src/generators/openapi-generator-cli/index.ts +1 -0
- package/src/generators/openapi-generator-cli/openapi-generator-cli.generator.ts +122 -0
- package/src/generators/openapi-generator-cli/patchers/go-module.patcher.ts +31 -0
- package/src/generators/openapi-generator-cli/patchers/maven.patcher.ts +44 -0
- package/src/generators/openapi-generator-cli/patchers/npm.patcher.ts +32 -0
- package/src/generators/openapi-generator-cli/patchers/patcher.ts +17 -0
- package/src/generators/openapi-typescript/index.ts +1 -0
- package/src/generators/openapi-typescript/openapi-typescript.generator.ts +62 -0
- package/src/git/git.ts +118 -0
- package/src/index.ts +45 -0
- package/src/process/exec.ts +53 -0
- package/src/process/resolve-bin.ts +41 -0
- package/src/readme/default-templates.ts +300 -0
- package/src/readme/readme-renderer.ts +69 -0
- package/src/redocly/redocly-sync.ts +67 -0
- package/src/version/version.ts +67 -0
- package/tsconfig.json +34 -0
- package/tsdown.config.ts +21 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OctalMesh
|
|
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,52 @@
|
|
|
1
|
+
# @octalmesh/seagull-core
|
|
2
|
+
|
|
3
|
+
**Internal package** - not published to npm on its own. This is the config
|
|
4
|
+
loading + SDK generator engine, bundled straight into
|
|
5
|
+
[`@octalmesh/seagull`](../..) at build time (see the root `tsdown.config.ts`).
|
|
6
|
+
It's organized as its own package for a clean internal boundary, not as a
|
|
7
|
+
separately installable one.
|
|
8
|
+
|
|
9
|
+
See the [main README](https://github.com/OctalMesh/Seagull#readme) for the
|
|
10
|
+
full config reference (`generators:`, `contracts:`, `publishing:`, custom
|
|
11
|
+
README templates, ...) and the [`@octalmesh/seagull`](../..) package for the
|
|
12
|
+
actual public API surface (this package's exports, re-exported).
|
|
13
|
+
|
|
14
|
+
## What lives here
|
|
15
|
+
|
|
16
|
+
- `config/` - the `seagull.yaml` schema (zod), loader, `{...}` template
|
|
17
|
+
engine, and publishing-conventions resolution.
|
|
18
|
+
- `generator/` - the `Generator` abstract primitive and `GeneratorRegistry`
|
|
19
|
+
every concrete generator plugs into.
|
|
20
|
+
- `generators/` - the built-in `openapi-generator-cli` and `openapi-typescript`
|
|
21
|
+
generator implementations.
|
|
22
|
+
- `readme/` - README rendering for generated SDK artifacts (custom template
|
|
23
|
+
or built-in default, per language/kind).
|
|
24
|
+
- `redocly/` - keeps `redocly.yaml` in sync with `seagull.yaml`.
|
|
25
|
+
- `git/`, `process/`, `version/` - small process/git/versioning utilities
|
|
26
|
+
used by the pipeline commands (which live in
|
|
27
|
+
[`@octalmesh/seagull-cli`](../cli)).
|
|
28
|
+
|
|
29
|
+
## Extending seagull with a custom generator
|
|
30
|
+
|
|
31
|
+
`Generator` is the root primitive every SDK generator implements -
|
|
32
|
+
`GeneratorRegistry` looks one up by the `tool` name referenced in
|
|
33
|
+
`generators.*.tool` in the config:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { Generator, GeneratorRegistry } from "@octalmesh/seagull-core";
|
|
37
|
+
import type { GenerateContext } from "@octalmesh/seagull-core";
|
|
38
|
+
|
|
39
|
+
class MyGenerator extends Generator {
|
|
40
|
+
readonly tool = "my-tool";
|
|
41
|
+
|
|
42
|
+
async generate(ctx: GenerateContext): Promise<void> {
|
|
43
|
+
// ...
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const registry = new GeneratorRegistry().register(new MyGenerator());
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT
|