@adea-ai/app-framework 0.29.2 → 0.30.0
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 +6 -3
- package/dist/app/create-application.d.ts +2 -0
- package/dist/app/create-application.js +6 -0
- package/dist/cli/create-application-cli.js +6 -4
- package/dist/framework-source.json +1 -1
- package/package.json +1 -1
- package/templates/application/.gitlab-ci.yml +19 -0
- package/templates/application/README.md +9 -0
package/README.md
CHANGED
|
@@ -398,9 +398,12 @@ can wrap the `construct` callback given to `desktop-host`.
|
|
|
398
398
|
The `create-adea-app` command generates a new application
|
|
399
399
|
from an identity, framework package specifier and renderer choice. The starter
|
|
400
400
|
provides the shared shell, appearance, one view and one desktop service. The
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
401
|
+
generated GitLab validation job accepts optional comma-separated
|
|
402
|
+
`--gitlab-runner-tags`; without them it requires an untagged Docker runner.
|
|
403
|
+
The generated GitLab job validates the app but does not publish releases.
|
|
404
|
+
The framework package specifier must refer to a distributable package available to
|
|
405
|
+
the new project. Its GitHub Actions release workflows call this framework release's
|
|
406
|
+
reusable workflows on the shared schedule (pinned to the release tag; run
|
|
404
407
|
`bunx adea-update-app-framework` to pin the commit) and stay off until the
|
|
405
408
|
repository sets `DESKTOP_RELEASES_ENABLED=true` with a release signing key.
|
|
406
409
|
Native application services and product-specific authorization must still be
|
|
@@ -11,6 +11,8 @@ export declare function createApplication(options: {
|
|
|
11
11
|
repository?: string;
|
|
12
12
|
frameworkSpecifier: string;
|
|
13
13
|
renderer?: DesktopRenderer;
|
|
14
|
+
/** Runner tags required by the generated GitLab validation job. */
|
|
15
|
+
gitlabRunnerTags?: readonly string[];
|
|
14
16
|
}, dependencies?: {
|
|
15
17
|
templateDirectory?: string;
|
|
16
18
|
/** Synchronize publish races in tests; app creation does not need this hook. */
|
|
@@ -75,6 +75,8 @@ async function createApplication(options, dependencies = {}) {
|
|
|
75
75
|
if (dependency.protocol !== "https:" || dependency.username || dependency.password || dependency.search) throw new Error("Invalid framework dependency");
|
|
76
76
|
}
|
|
77
77
|
const renderer = createRendererProfile(options.renderer).renderer;
|
|
78
|
+
const runnerTags = options.gitlabRunnerTags ?? [];
|
|
79
|
+
if (!Array.isArray(runnerTags) || runnerTags.length > 49 || runnerTags.some((tag) => typeof tag !== "string" || !/^[A-Za-z0-9_.-]{1,128}$/.test(tag)) || new Set(runnerTags).size !== runnerTags.length) throw new Error("Invalid GitLab runner tags");
|
|
78
80
|
const frameworkManifest = JSON.parse(await readFile(resolve(import.meta.dir, "../../package.json"), "utf8"));
|
|
79
81
|
const uiVersion = frameworkManifest.devDependencies?.["@adea-ai/ui"];
|
|
80
82
|
if (typeof uiVersion !== "string" || !/^\d+\.\d+\.\d+$/.test(uiVersion)) throw new Error("Framework UI version is unavailable");
|
|
@@ -100,6 +102,10 @@ async function createApplication(options, dependencies = {}) {
|
|
|
100
102
|
errorOnExist: true,
|
|
101
103
|
force: false
|
|
102
104
|
});
|
|
105
|
+
const gitlabPath = resolve(staging, ".gitlab-ci.yml");
|
|
106
|
+
const gitlabTemplate = await readFile(gitlabPath, "utf8");
|
|
107
|
+
const tags = runnerTags.length ? ` tags:\n${runnerTags.map((tag) => ` - ${JSON.stringify(tag)}\n`).join("")}` : "";
|
|
108
|
+
await writeFile(gitlabPath, gitlabTemplate.replace(" # {{GITLAB_RUNNER_TAGS}}\n", tags));
|
|
103
109
|
for (const name of [
|
|
104
110
|
"release.yml",
|
|
105
111
|
"release-assets.yml",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createApplication } from "../app/create-application.js";
|
|
3
3
|
import { runCli } from "./cli-runner.js";
|
|
4
4
|
// src/cli/create-application-cli.ts
|
|
5
|
-
var usage = "Usage: create-adea-app --directory PATH --slug SLUG --name NAME --identifier REVERSE_DNS --source-url HTTPS_URL --framework SPECIFIER [--repository OWNER/NAME] [--renderer native|cef]";
|
|
5
|
+
var usage = "Usage: create-adea-app --directory PATH --slug SLUG --name NAME --identifier REVERSE_DNS --source-url HTTPS_URL --framework SPECIFIER [--repository OWNER/NAME] [--renderer native|cef] [--gitlab-runner-tags TAG,TAG]";
|
|
6
6
|
var allowed = /* @__PURE__ */ new Set([
|
|
7
7
|
"directory",
|
|
8
8
|
"slug",
|
|
@@ -11,7 +11,8 @@ var allowed = /* @__PURE__ */ new Set([
|
|
|
11
11
|
"source-url",
|
|
12
12
|
"framework",
|
|
13
13
|
"repository",
|
|
14
|
-
"renderer"
|
|
14
|
+
"renderer",
|
|
15
|
+
"gitlab-runner-tags"
|
|
15
16
|
]);
|
|
16
17
|
await runCli((error) => error instanceof Error ? error.message : "Could not create application", async () => {
|
|
17
18
|
const args = process.argv.slice(2);
|
|
@@ -26,7 +27,7 @@ await runCli((error) => error instanceof Error ? error.message : "Could not crea
|
|
|
26
27
|
if (!allowed.has(key) || values[key] !== void 0 || !value || value.startsWith("--")) throw new Error(usage);
|
|
27
28
|
values[key] = value;
|
|
28
29
|
}
|
|
29
|
-
const { directory, slug, name, identifier, "source-url": sourceUrl, framework, repository, renderer } = values;
|
|
30
|
+
const { directory, slug, name, identifier, "source-url": sourceUrl, framework, repository, renderer, "gitlab-runner-tags": gitlabRunnerTags } = values;
|
|
30
31
|
if (!directory || !slug || !name || !identifier || !sourceUrl || !framework || renderer && renderer !== "native" && renderer !== "cef") throw new Error(usage);
|
|
31
32
|
const result = await createApplication({
|
|
32
33
|
directory,
|
|
@@ -36,7 +37,8 @@ await runCli((error) => error instanceof Error ? error.message : "Could not crea
|
|
|
36
37
|
sourceUrl,
|
|
37
38
|
repository,
|
|
38
39
|
frameworkSpecifier: framework,
|
|
39
|
-
renderer
|
|
40
|
+
renderer,
|
|
41
|
+
gitlabRunnerTags: gitlabRunnerTags?.split(",").map((tag) => tag.trim())
|
|
40
42
|
});
|
|
41
43
|
console.log(`Created application at ${result.directory}`);
|
|
42
44
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.
|
|
1
|
+
{"version":"0.30.0","commit":"3c39a8178b5d816c9a5d52eef959c871a2820ce6"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
image:
|
|
2
|
+
name: oven/bun:1.4.4
|
|
3
|
+
entrypoint: ['']
|
|
4
|
+
|
|
5
|
+
workflow:
|
|
6
|
+
rules:
|
|
7
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
8
|
+
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
9
|
+
|
|
10
|
+
validate:
|
|
11
|
+
timeout: 20m
|
|
12
|
+
# {{GITLAB_RUNNER_TAGS}}
|
|
13
|
+
script:
|
|
14
|
+
- bun install --frozen-lockfile
|
|
15
|
+
- bun run format:check
|
|
16
|
+
- bun run lint
|
|
17
|
+
- bun run typecheck
|
|
18
|
+
- bun run test
|
|
19
|
+
- bun run build:web
|
|
@@ -4,6 +4,15 @@ Use Bun 1.4.4, install dependencies with `bun install`, run `bun run format:chec
|
|
|
4
4
|
|
|
5
5
|
Add navigation and views in `src/web/main.tsx`, and register app-specific services in `src/bun/index.ts`. Supply your app icon, identity, authorization and release configuration before distribution. The host registers shared app information, external-link and folder-picker services; a picked folder does not grant file access. The framework's native host and release tooling are still under development.
|
|
6
6
|
|
|
7
|
+
The generated `.gitlab-ci.yml` validates merge requests and the default branch
|
|
8
|
+
with the same checks as the GitHub validation workflow. Commit `bun.lock`
|
|
9
|
+
before running it. It uses an untagged Docker runner by default; if your GitLab
|
|
10
|
+
runner requires tags, supply `--gitlab-runner-tags tag1,tag2` when generating
|
|
11
|
+
the app or add the tags to the job afterward. The runner must have access to
|
|
12
|
+
the package registry. This is validation only: the generated release workflows
|
|
13
|
+
and release tooling below still require GitHub Actions and have not been migrated
|
|
14
|
+
to GitLab.
|
|
15
|
+
|
|
7
16
|
The generated release control workflow uses `release-config.json` for daily,
|
|
8
17
|
dev and stable channels. Run `bun install` and commit `bun.lock` before
|
|
9
18
|
pushing. The root `package.json` version is the default for both web and
|