@flisk-sh/flisk-import 0.2.3 → 0.2.4
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 +44 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,24 +1,60 @@
|
|
|
1
|
-
#
|
|
1
|
+
# flisk import
|
|
2
2
|
|
|
3
|
-
Import the services in a repo's root `docker-compose.yml` into [
|
|
3
|
+
Import the services in a repo's root `docker-compose.yml` into [Flisk](https://github.com/flisk-sh/flisk) as `service.json` files. This is the Compose first tier of flisk-sh/flisk#511.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
flisk import . --dry-run # plan only
|
|
7
|
+
flisk import . # plan, then ask before writing
|
|
8
|
+
flisk import . --yes # write service.json files and project setup
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## What to expect
|
|
12
12
|
|
|
13
13
|
- **Reads one file:** the root `docker-compose.yml`. Not `compose.yaml`, override files, nested Compose files, Dockerfiles on their own, `package.json`, or Procfiles.
|
|
14
|
-
- **Writes:** one bring-your-own `service.json` per Compose service, plus `.tdk/project.json` if the repo is not a
|
|
14
|
+
- **Writes:** one bring-your-own `service.json` per Compose service, plus `.tdk/project.json` if the repo is not a Flisk project yet. It never edits the Compose file or overwrites a `service.json` without `--force`.
|
|
15
15
|
- **Keeps:** the build context and Dockerfile (or the image), the container port, `depends_on`, and an HTTP health path. Databases and brokers are private, with no proxy route.
|
|
16
16
|
- **Drops, and says so:** env values, volumes, `command`, `env_file` and every other untranslated key; services with `profiles`, `extends`, an out-of-tree build or a `${VAR}` image.
|
|
17
|
-
- **Does not start anything.** Put env values in `.env`, then run `
|
|
17
|
+
- **Does not start anything.** Put env values in `.env`, then run `flisk up` with Flisk core **1.3.145 or later**. The importer does not check the core version.
|
|
18
18
|
- **Exit codes:** `0` when the plan succeeds (`--dry-run`, files written, or all `service.json` files already exist), `1` when no root `docker-compose.yml` or mappable service is found, and `2` when the write prompt is declined or closed without an answer (`Nothing written.`).
|
|
19
19
|
|
|
20
|
-
See [docs/import.md](docs/import.md) for the full mapping and limits. `
|
|
20
|
+
See [docs/import.md](docs/import.md) for the full mapping and limits. `flisk import` is the core CLI command backed by this package.
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
bun install && bun run build && bun run test
|
|
24
24
|
```
|
|
25
|
+
|
|
26
|
+
## Publishing
|
|
27
|
+
|
|
28
|
+
`flisk-import` is published to npmjs.org by the workflow in
|
|
29
|
+
[`.github/workflows/publish-npm.yml`](.github/workflows/publish-npm.yml), triggered by a
|
|
30
|
+
GitHub release. It uses **npm trusted publishing (OIDC)**, so no long-lived npm token
|
|
31
|
+
lives in this repository. The package is published under two names: the unscoped
|
|
32
|
+
`flisk-import` and the scoped `@flisk-sh/flisk-import` (the same archive with the name
|
|
33
|
+
rewritten in the packed manifest).
|
|
34
|
+
|
|
35
|
+
### One-time owner setup
|
|
36
|
+
|
|
37
|
+
A trusted publisher has to exist on npm before the first OIDC publish succeeds, and it is
|
|
38
|
+
configured per package name:
|
|
39
|
+
|
|
40
|
+
1. Open the package on npmjs.com → **Settings** → **Trusted Publisher** → **GitHub Actions**
|
|
41
|
+
2. Fill in:
|
|
42
|
+
- Organization: `flisk-sh`
|
|
43
|
+
- Repository: `flisk-import`
|
|
44
|
+
- Workflow filename: `publish-npm.yml`
|
|
45
|
+
- Allowed actions: `npm publish`
|
|
46
|
+
3. Repeat for `@flisk-sh/flisk-import` once that package exists
|
|
47
|
+
|
|
48
|
+
The same thing from the command line, for either name:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm trust github flisk-import --file publish-npm.yml --repo flisk-sh/flisk-import --allow-publish
|
|
52
|
+
npm trust list flisk-import
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### The first version
|
|
56
|
+
|
|
57
|
+
A package's first version cannot be published through OIDC — npm has no trusted publisher
|
|
58
|
+
for a name that does not exist yet. Version 0.2.2 was therefore published once with a
|
|
59
|
+
token; every version after that publishes over OIDC from the release workflow.
|
|
60
|
+
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flisk-sh/flisk-import",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Import services from a repository's root docker-compose.yml into
|
|
3
|
+
"version": "0.2.4",
|
|
4
|
+
"description": "Import services from a repository's root docker-compose.yml into Flisk service.json files.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|