@plexus-ms/cli 0.130.0 → 0.131.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/dist/plx.js +3265 -2277
- package/dist/templates/app-nextjs/files/.gitignore.jinja +6 -0
- package/dist/templates/app-nextjs/files/PLEXUS.md.jinja +5 -0
- package/dist/templates/app-nextjs/files/docker/Dockerfile +39 -0
- package/dist/templates/app-nextjs/files/docker/compose.ci.yaml.jinja +22 -0
- package/dist/templates/app-nextjs/files/docker/compose.yaml.jinja +50 -0
- package/dist/templates/app-nextjs/files/next.config.ts +16 -0
- package/dist/templates/app-nextjs/files/package.json.jinja +28 -0
- package/dist/templates/app-nextjs/files/postcss.config.mjs +7 -0
- package/dist/templates/app-nextjs/files/src/app/healthz/route.ts +7 -0
- package/dist/templates/app-nextjs/files/src/app/layout.tsx +7 -0
- package/dist/templates/app-nextjs/files/src/app/page.tsx.jinja +3 -0
- package/dist/templates/app-nextjs/files/tsconfig.json +10 -0
- package/dist/templates/app-nextjs/template.yml +31 -0
- package/dist/templates/repo-operations/files/.github/workflows/deploy.yml.jinja +37 -0
- package/dist/templates/repo-operations/files/.github/workflows/on_commit.yml.jinja +25 -0
- package/dist/templates/repo-operations/files/.github/workflows/on_pr.yml.jinja +24 -0
- package/dist/templates/repo-operations/files/.github/workflows/plx-update.yml.jinja +30 -0
- package/dist/templates/repo-operations/files/.github/workflows/{% if ci_strategy == 'hybrid' or ci_registry == 'own' %}housekeeping.yml{% endif %}.jinja +30 -0
- package/dist/templates/repo-operations/files/.gitignore.jinja +2 -0
- package/dist/templates/repo-operations/files/PLEXUS.md.jinja +3 -0
- package/dist/templates/repo-operations/files/ansible-playbookw +17 -0
- package/dist/templates/repo-operations/files/ansible.cfg +4 -0
- package/dist/templates/repo-operations/files/apps/.gitkeep +0 -0
- package/dist/templates/repo-operations/files/hk.pkl +21 -0
- package/dist/templates/repo-operations/files/inventory/group_vars/all.yml.jinja +6 -0
- package/dist/templates/repo-operations/files/inventory/group_vars/platform.yml.jinja +13 -0
- package/dist/templates/repo-operations/files/inventory/hosts.yml.jinja +21 -0
- package/dist/templates/repo-operations/files/mise.toml.jinja +103 -0
- package/dist/templates/repo-operations/files/platform.yml.jinja +6 -0
- package/dist/templates/repo-operations/files/renovate.json.jinja +5 -0
- package/dist/templates/repo-operations/files/requirements.yml +15 -0
- package/dist/templates/repo-operations/files/secrets.env.jinja +3 -0
- package/dist/templates/repo-operations/files/{% if ci_strategy != 'github' %}ci.yml{% endif %}.jinja +6 -0
- package/dist/templates/repo-operations/files/{% if infrastructure %}infrastructure.yml{% endif %}.jinja +6 -0
- package/dist/templates/repo-operations/template.yml +72 -0
- package/dist/templates/repo-turbo/files/.github/workflows/on_pr.yml.jinja +91 -0
- package/dist/templates/repo-turbo/files/.github/workflows/on_push.yml.jinja +109 -0
- package/dist/templates/repo-turbo/files/.github/workflows/plx-update.yml.jinja +30 -0
- package/dist/templates/repo-turbo/files/.github/workflows/{% if not publishes_packages %}on_commit.yml{% endif %}.jinja +28 -0
- package/dist/templates/repo-turbo/files/.github/workflows/{% if not publishes_packages and ci_registry == 'ghcr' %}housekeeping.yml{% endif %}.jinja +28 -0
- package/dist/templates/repo-turbo/files/.gitignore.jinja +7 -0
- package/dist/templates/repo-turbo/files/PLEXUS.md.jinja +11 -0
- package/dist/templates/repo-turbo/files/biome.json +4 -0
- package/dist/templates/repo-turbo/files/hk.pkl +22 -0
- package/dist/templates/repo-turbo/files/mise.toml.jinja +137 -0
- package/dist/templates/repo-turbo/files/package.json.jinja +11 -0
- package/dist/templates/repo-turbo/files/packages/.gitkeep +0 -0
- package/dist/templates/repo-turbo/files/pnpm-workspace.yaml.jinja +18 -0
- package/dist/templates/repo-turbo/files/renovate.json.jinja +14 -0
- package/dist/templates/repo-turbo/files/turbo.json.jinja +35 -0
- package/dist/templates/repo-turbo/files/{% if not publishes_packages %}.dockerignore{% endif %} +9 -0
- package/dist/templates/repo-turbo/files/{% if not publishes_packages %}apps{% endif %}/.gitkeep +0 -0
- package/dist/templates/repo-turbo/files/{% if publishes_packages %}.changeset{% endif %}/config.json.jinja +11 -0
- package/dist/templates/repo-turbo/template.yml +103 -0
- package/package.json +3 -2
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Generated from plexus-ms/template-repo-operations.
|
|
3
|
+
# Mounts plexus.infrastructure.playbook for the hypervisor and its guests (§ 1 PLX-Infrastructure): `mise infrastructure`.
|
|
4
|
+
- import_playbook: plexus.infrastructure.playbook
|
|
5
|
+
|
|
6
|
+
# Plays of this tenant's own go below, tagged like the shipped ones.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Until the version that cuts over from copier is out, this template and
|
|
2
|
+
# template-repo-operations are one: a change to either is made in both.
|
|
3
|
+
# files/.gitignore.jinja is a .gitignore: npm leaves a file of that name out of a package, so the
|
|
4
|
+
# template carries it with the suffix, which renders it to the same bytes.
|
|
5
|
+
name: repo-operations
|
|
6
|
+
|
|
7
|
+
questions:
|
|
8
|
+
tenant:
|
|
9
|
+
type: str
|
|
10
|
+
help: "Tenant slug (URL-friendly)"
|
|
11
|
+
|
|
12
|
+
github_org:
|
|
13
|
+
type: str
|
|
14
|
+
help: "GitHub org of the tenant (image registry owner and forge org)"
|
|
15
|
+
default: "{{ tenant }}"
|
|
16
|
+
|
|
17
|
+
infrastructure:
|
|
18
|
+
type: bool
|
|
19
|
+
help: "Does this tenant build its own infrastructure layer (Proxmox hypervisor, backup server, ingress VM) instead of buying hosts from a provider? Adds infrastructure.yml, the mount of plexus.infrastructure.playbook"
|
|
20
|
+
default: false
|
|
21
|
+
|
|
22
|
+
ci_strategy:
|
|
23
|
+
type: str
|
|
24
|
+
help: "Where the tenant's CI jobs run (§ 8 PLX-Delivery), the same answer as its app repos': github, the forge's runners; on-prem, container slots on runner hosts of the tenant's own; hybrid, slots for the small and medium jobs and throwaway cloud instances for the large ones, whose daily sweep this repo mounts; on-prem and hybrid add ci.yml, the mount of plexus.ci.playbook for the runner host"
|
|
25
|
+
default: github
|
|
26
|
+
choices:
|
|
27
|
+
- github
|
|
28
|
+
- on-prem
|
|
29
|
+
- hybrid
|
|
30
|
+
|
|
31
|
+
ci_registry:
|
|
32
|
+
type: str
|
|
33
|
+
help: "Where the app repos' runs keep the images they build and test (§ 8 PLX-Delivery): ghcr, the forge's registry, nothing to mount here; own, a registry on the tenant's object storage, whose monthly buckets this repo rotates"
|
|
34
|
+
choices:
|
|
35
|
+
- ghcr
|
|
36
|
+
- own
|
|
37
|
+
default: "{{ 'ghcr' if ci_strategy == 'github' else 'own' }}"
|
|
38
|
+
|
|
39
|
+
ci_overlay:
|
|
40
|
+
type: str
|
|
41
|
+
help: "How a deploy of a third-party app reaches its host (§ 8 PLX-Delivery): none, as the inventory names it; netbird, over the tenant's overlay, which a job on the forge's runners joins for its length"
|
|
42
|
+
choices:
|
|
43
|
+
- none
|
|
44
|
+
- netbird
|
|
45
|
+
default: none
|
|
46
|
+
|
|
47
|
+
alerts_email:
|
|
48
|
+
type: str
|
|
49
|
+
help: "Hybrid strategy: the address the daily sweep mails when it removes an instance or a kept one is still there (empty: no mail); a fact, so an answer here and never a vault item"
|
|
50
|
+
default: ""
|
|
51
|
+
when: "{{ ci_strategy == 'hybrid' }}"
|
|
52
|
+
|
|
53
|
+
pr_reviewers:
|
|
54
|
+
type: str
|
|
55
|
+
help: "GitHub logins asked to review the pull requests that wait for a human, the update bot's and plx update's alike, comma-separated (empty: none); a pull request the bot merges itself asks nobody unless its checks fail"
|
|
56
|
+
default: ""
|
|
57
|
+
|
|
58
|
+
update_max_age:
|
|
59
|
+
type: int
|
|
60
|
+
help: "How old, in days, the oldest Plexus version this repo has not taken must be before it takes a minor one (§ 3 PLX-Updates): a patch is taken at once, a major only when asked; 0 takes every version, and more than 30 is discouraged"
|
|
61
|
+
default: 7
|
|
62
|
+
validator: "{% if update_max_age < 0 %}A number of days, zero or more{% endif %}"
|
|
63
|
+
|
|
64
|
+
policies:
|
|
65
|
+
# The marker is born once: its body is the repo's own prose, which an update would conflict with, and
|
|
66
|
+
# its frontmatter is plx's.
|
|
67
|
+
PLEXUS.md.jinja: born-once
|
|
68
|
+
|
|
69
|
+
birth:
|
|
70
|
+
- [git, init]
|
|
71
|
+
- [mise, trust]
|
|
72
|
+
- [mise, install]
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{% if publishes_packages %}{% raw %}name: on_pr
|
|
2
|
+
|
|
3
|
+
# Generated from plexus-ms/template-repo-turbo: edit the template, never this file.
|
|
4
|
+
# A package repo's pull-request mount, check and the changeset guard (§ 5 PLX-Delivery).
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read{% endraw %}{% if private_packages_scope %}
|
|
11
|
+
packages: read{% endif %}{% raw %}
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: on_pr-${{ github.ref }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
check:
|
|
19
|
+
uses: plexus-ms/tooling/.github/workflows/_check.yml@0.131.0
|
|
20
|
+
with:
|
|
21
|
+
strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
|
|
22
|
+
tasks: verify{% endraw %}{% if private_packages_scope %}
|
|
23
|
+
private-packages: true{% endif %}{% raw %}
|
|
24
|
+
|
|
25
|
+
changeset-status:
|
|
26
|
+
# `changeset version` consumed the release branch's changesets, and the bot's branches get theirs from the
|
|
27
|
+
# changeset job: the guard counts any file under a package, so a devDependency bump would trip it.
|
|
28
|
+
if: ${{ !startsWith(github.head_ref, 'changeset-release/') && !startsWith(github.head_ref, 'renovate/') }}
|
|
29
|
+
runs-on: ${{ (vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}') == 'github' && 'ubuntu-latest' || 'ci-small' }}
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v7
|
|
32
|
+
with:
|
|
33
|
+
fetch-depth: 0
|
|
34
|
+
- uses: jdx/mise-action@v5{% endraw %}{% if private_packages_scope %}{% raw %}
|
|
35
|
+
- name: Log in to the forge's package registry
|
|
36
|
+
env:
|
|
37
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
38
|
+
run: |
|
|
39
|
+
printf '//npm.pkg.github.com/:_authToken=%s\n' "$GITHUB_TOKEN" > "$RUNNER_TEMP/npmrc"
|
|
40
|
+
echo "NPM_CONFIG_USERCONFIG=$RUNNER_TEMP/npmrc" >> "$GITHUB_ENV"{% endraw %}{% endif %}{% raw %}
|
|
41
|
+
- run: pnpm install --frozen-lockfile
|
|
42
|
+
- run: pnpm exec changeset status --since=origin/main
|
|
43
|
+
|
|
44
|
+
changeset:
|
|
45
|
+
if: ${{ startsWith(github.head_ref, 'renovate/') }}
|
|
46
|
+
uses: plexus-ms/tooling/.github/workflows/_changeset.yml@0.131.0
|
|
47
|
+
with:
|
|
48
|
+
gh-client-id: ${{ vars.GH_CLIENT_ID }}
|
|
49
|
+
strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
|
|
50
|
+
secrets:
|
|
51
|
+
gh-private-key: ${{ secrets.GH_PRIVATE_KEY }}
|
|
52
|
+
op-service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
|
|
53
|
+
{% endraw %}{% else %}{% raw %}name: on_pr
|
|
54
|
+
|
|
55
|
+
# Generated from plexus-ms/template-repo-turbo: edit the template, never this file.
|
|
56
|
+
# An app repo's pull-request mount, check then verify (§ 2 PLX-Delivery).
|
|
57
|
+
|
|
58
|
+
on:
|
|
59
|
+
pull_request:
|
|
60
|
+
paths-ignore: ['**/*.md']
|
|
61
|
+
|
|
62
|
+
permissions:
|
|
63
|
+
contents: read
|
|
64
|
+
packages: write
|
|
65
|
+
actions: read
|
|
66
|
+
|
|
67
|
+
concurrency:
|
|
68
|
+
group: on_pr-${{ github.ref }}
|
|
69
|
+
cancel-in-progress: true
|
|
70
|
+
|
|
71
|
+
jobs:
|
|
72
|
+
check:
|
|
73
|
+
uses: plexus-ms/tooling/.github/workflows/_check.yml@0.131.0
|
|
74
|
+
with:
|
|
75
|
+
strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
|
|
76
|
+
turbo-cache: {% endraw %}{{ 'true' if ci_registry == 'own' else 'false' }}{% if private_packages_scope %}
|
|
77
|
+
private-packages: true{% endif %}{% raw %}
|
|
78
|
+
secrets:
|
|
79
|
+
op-service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
|
|
80
|
+
|
|
81
|
+
verify:
|
|
82
|
+
needs: check
|
|
83
|
+
uses: plexus-ms/tooling/.github/workflows/_verify.yml@0.131.0
|
|
84
|
+
with:
|
|
85
|
+
strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
|
|
86
|
+
registry: {% endraw %}{{ ci_registry }}{% raw %}
|
|
87
|
+
alerts-email: '{% endraw %}{{ alerts_email }}{% raw %}'{% endraw %}{% if private_packages_scope %}
|
|
88
|
+
private-packages: true{% endif %}{% raw %}
|
|
89
|
+
secrets:
|
|
90
|
+
op-service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
|
|
91
|
+
{% endraw %}{% endif %}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
{% if publishes_packages %}{% raw %}name: on_push
|
|
2
|
+
|
|
3
|
+
# Generated from plexus-ms/template-repo-turbo: edit the template, never this file.
|
|
4
|
+
# A package repo's trunk mount, check then publish; started by hand on a branch, snapshot versions of it (§ 5 PLX-Delivery).
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [main]
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
inputs:
|
|
11
|
+
snapshot:
|
|
12
|
+
description: The dist-tag the snapshot versions are published under, as in my-change
|
|
13
|
+
required: true
|
|
14
|
+
type: string
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: write
|
|
18
|
+
pull-requests: write{% endraw %}
|
|
19
|
+
{%- if package_registry == 'github' %}
|
|
20
|
+
packages: write
|
|
21
|
+
{%- else %}
|
|
22
|
+
id-token: write
|
|
23
|
+
{%- if private_packages_scope %}
|
|
24
|
+
packages: read
|
|
25
|
+
{%- endif %}
|
|
26
|
+
{%- endif %}{% raw %}
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
check:
|
|
30
|
+
uses: plexus-ms/tooling/.github/workflows/_check.yml@0.131.0
|
|
31
|
+
with:
|
|
32
|
+
strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
|
|
33
|
+
tasks: verify{% endraw %}{% if private_packages_scope %}
|
|
34
|
+
private-packages: true{% endif %}{% raw %}
|
|
35
|
+
|
|
36
|
+
publish:
|
|
37
|
+
needs: check
|
|
38
|
+
uses: plexus-ms/tooling/.github/workflows/_publish-package.yml@0.131.0
|
|
39
|
+
with:
|
|
40
|
+
strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
|
|
41
|
+
registry: {% endraw %}{{ package_registry }}{% raw %}
|
|
42
|
+
snapshot: ${{ inputs.snapshot }}
|
|
43
|
+
{% endraw %}{% else %}{% raw %}name: on_push
|
|
44
|
+
|
|
45
|
+
# Generated from plexus-ms/template-repo-turbo: edit the template, never this file.
|
|
46
|
+
# An app repo's environment-branch mount, check, verify, release (§§ 2 and 3 PLX-Delivery).
|
|
47
|
+
|
|
48
|
+
on:
|
|
49
|
+
# No paths filter: a branch created at a known commit pushes no files and would start nothing.
|
|
50
|
+
push:
|
|
51
|
+
branches: [main, develop]
|
|
52
|
+
workflow_dispatch:
|
|
53
|
+
|
|
54
|
+
permissions:
|
|
55
|
+
contents: read
|
|
56
|
+
packages: write
|
|
57
|
+
actions: read
|
|
58
|
+
|
|
59
|
+
jobs:
|
|
60
|
+
check:
|
|
61
|
+
concurrency:
|
|
62
|
+
group: on_push-verify-${{ github.ref }}
|
|
63
|
+
cancel-in-progress: true
|
|
64
|
+
uses: plexus-ms/tooling/.github/workflows/_check.yml@0.131.0
|
|
65
|
+
with:
|
|
66
|
+
strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
|
|
67
|
+
turbo-cache: {% endraw %}{{ 'true' if ci_registry == 'own' else 'false' }}{% if private_packages_scope %}
|
|
68
|
+
private-packages: true{% endif %}{% raw %}
|
|
69
|
+
secrets:
|
|
70
|
+
op-service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
|
|
71
|
+
|
|
72
|
+
verify:
|
|
73
|
+
needs: check
|
|
74
|
+
concurrency:
|
|
75
|
+
group: on_push-verify-${{ github.ref }}
|
|
76
|
+
cancel-in-progress: true
|
|
77
|
+
uses: plexus-ms/tooling/.github/workflows/_verify.yml@0.131.0
|
|
78
|
+
with:
|
|
79
|
+
strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
|
|
80
|
+
registry: {% endraw %}{{ ci_registry }}{% raw %}
|
|
81
|
+
deploy: true
|
|
82
|
+
alerts-email: '{% endraw %}{{ alerts_email }}{% raw %}'{% endraw %}{% if private_packages_scope %}
|
|
83
|
+
private-packages: true{% endif %}{% raw %}
|
|
84
|
+
secrets:
|
|
85
|
+
op-service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
|
|
86
|
+
|
|
87
|
+
release:
|
|
88
|
+
needs: verify{% endraw %}{% if display_versions %}{% raw %}
|
|
89
|
+
# Display versions (PLX-Releases): serialized per branch and never cancelled, so that two pushes to main
|
|
90
|
+
# never take the same number, and allowed to write the tag and the GitHub Release of the version it cuts.
|
|
91
|
+
concurrency:
|
|
92
|
+
group: on_push-release-${{ github.ref }}
|
|
93
|
+
cancel-in-progress: false
|
|
94
|
+
permissions:
|
|
95
|
+
contents: write
|
|
96
|
+
packages: write
|
|
97
|
+
actions: read{% endraw %}{% endif %}{% raw %}
|
|
98
|
+
uses: plexus-ms/tooling/.github/workflows/_release.yml@0.131.0
|
|
99
|
+
with:
|
|
100
|
+
strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
|
|
101
|
+
registry: {% endraw %}{{ ci_registry }}{% raw %}
|
|
102
|
+
overlay: {% endraw %}{{ ci_overlay }}{% raw %}
|
|
103
|
+
apps: ${{ needs.verify.outputs.apps }}
|
|
104
|
+
deploys: ${{ needs.verify.outputs.deploys }}
|
|
105
|
+
environment: ${{ needs.verify.outputs.environment }}{% endraw %}{% if display_versions %}
|
|
106
|
+
display-versions: true{% endif %}{% raw %}
|
|
107
|
+
secrets:
|
|
108
|
+
op-service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
|
|
109
|
+
{% endraw %}{% endif %}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{% raw %}name: plx-update
|
|
2
|
+
|
|
3
|
+
# Generated from plexus-ms/template-repo-turbo: edit the template, never this file.
|
|
4
|
+
# Mounts the update verb, `plx update` (§ 3 PLX-Updates).
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
schedule:
|
|
8
|
+
- cron: '23 6 * * *'
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
inputs:
|
|
11
|
+
version:
|
|
12
|
+
description: "The version to take (default: the newest)"
|
|
13
|
+
required: false
|
|
14
|
+
default: ''
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
update:
|
|
21
|
+
uses: plexus-ms/tooling/.github/workflows/_plx-update.yml@0.131.0
|
|
22
|
+
with:
|
|
23
|
+
version: ${{ inputs.version || '' }}
|
|
24
|
+
now: ${{ github.event_name == 'workflow_dispatch' }}
|
|
25
|
+
gh-client-id: ${{ vars.GH_CLIENT_ID }}
|
|
26
|
+
strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
|
|
27
|
+
secrets:
|
|
28
|
+
gh-private-key: ${{ secrets.GH_PRIVATE_KEY }}
|
|
29
|
+
op-service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
|
|
30
|
+
{% endraw %}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{% raw %}name: on_commit
|
|
2
|
+
|
|
3
|
+
# Generated from plexus-ms/template-repo-turbo: edit the template, never this file.
|
|
4
|
+
# An app repo's mount for a push to any other branch, check alone (§ 2 PLX-Delivery).
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches-ignore: [main, develop]
|
|
9
|
+
paths-ignore: ['**/*.md']
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read{% endraw %}{% if private_packages_scope %}
|
|
13
|
+
packages: read{% endif %}{% raw %}
|
|
14
|
+
|
|
15
|
+
concurrency:
|
|
16
|
+
group: on_commit-${{ github.ref }}
|
|
17
|
+
cancel-in-progress: true
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
check:
|
|
21
|
+
uses: plexus-ms/tooling/.github/workflows/_check.yml@0.131.0
|
|
22
|
+
with:
|
|
23
|
+
strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
|
|
24
|
+
turbo-cache: {% endraw %}{{ 'true' if ci_registry == 'own' else 'false' }}{% if private_packages_scope %}
|
|
25
|
+
private-packages: true{% endif %}{% raw %}
|
|
26
|
+
secrets:
|
|
27
|
+
op-service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
|
|
28
|
+
{% endraw %}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{% raw %}name: housekeeping
|
|
2
|
+
|
|
3
|
+
# Generated from plexus-ms/template-repo-turbo: edit the template, never this file.
|
|
4
|
+
# The retention of the candidates this repo leaves in the forge's registry (§ 8 PLX-Delivery).
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
schedule:
|
|
8
|
+
- cron: '41 4 * * *'
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
inputs:
|
|
11
|
+
dry_run:
|
|
12
|
+
description: Only list what would be deleted
|
|
13
|
+
type: boolean
|
|
14
|
+
default: false
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
# Mounted here, not in the operations repo: only this repo's own token may delete versions of its packages.
|
|
19
|
+
packages: write
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
housekeeping:
|
|
23
|
+
uses: plexus-ms/tooling/.github/workflows/_housekeeping.yml@0.131.0
|
|
24
|
+
with:
|
|
25
|
+
strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
|
|
26
|
+
registry: ghcr
|
|
27
|
+
dry-run: ${{ inputs.dry_run || false }}
|
|
28
|
+
{% endraw %}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{% if publishes_packages -%}
|
|
2
|
+
- A package repo of `{{ tenant }}`: it publishes the workspace packages under `packages/` to {{ "the forge's package registry, private to the tenant," if package_registry == 'github' else 'npm' }} from its trunk.
|
|
3
|
+
{% else -%}
|
|
4
|
+
- An app repo of `{{ tenant }}`: its apps under `apps/`, each with a marker of its own, and the workspace packages they share under `packages/`.
|
|
5
|
+
{% endif -%}
|
|
6
|
+
- The verbs answer at the root, `mise :dev`, `mise :build` and `mise :verify`, and hand over to Turborepo, which runs each project's `package.json` scripts in the order of the workspace graph.
|
|
7
|
+
{% if not publishes_packages and display_versions -%}
|
|
8
|
+
- Display versions (PLX-Releases): a production release that changes an app cuts the version tag `<major>.<minor>` with a GitHub Release, and the apps show their display version.
|
|
9
|
+
`major` above is the major the next version takes; raise it in the pull request that warrants it, and the minor counts up by itself.
|
|
10
|
+
{% endif -%}
|
|
11
|
+
- The Plexus version the repo is on is its `plx` pin in `mise.toml`; `plx update` takes in the template's changes.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
amends "package://github.com/jdx/hk/releases/download/v1.48.0/hk@1.48.0#/Config.pkl"
|
|
2
|
+
|
|
3
|
+
hooks {
|
|
4
|
+
["pre-commit"] {
|
|
5
|
+
fix = true
|
|
6
|
+
stash = true
|
|
7
|
+
steps {
|
|
8
|
+
["lint"] {
|
|
9
|
+
glob = List("**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "**/*.css", "**/*.json")
|
|
10
|
+
check = "mise :lint {{ files }}"
|
|
11
|
+
fix = "mise :lint --write {{ files }}"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
["pre-push"] {
|
|
16
|
+
steps {
|
|
17
|
+
["check"] {
|
|
18
|
+
check = "mise :check"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{% macro name_arg(verb) -%}
|
|
2
|
+
{%- if publishes_packages -%}
|
|
3
|
+
usage = 'arg "[name]" help="Package to {{ verb }}, by its directory name under packages/ (e.g. my-package, defaults to all)"'
|
|
4
|
+
{%- else -%}
|
|
5
|
+
usage = 'arg "[name]" help="App or package to {{ verb }}, by its directory name under apps/ or packages/ (e.g. my-app, defaults to all)"'
|
|
6
|
+
{%- endif %}
|
|
7
|
+
{%- endmacro -%}
|
|
8
|
+
{% macro scoped(verb) -%}
|
|
9
|
+
dir=
|
|
10
|
+
if [ -n "${usage_name:-}" ]; then
|
|
11
|
+
{%- if publishes_packages %}
|
|
12
|
+
case $usage_name in
|
|
13
|
+
*/* | . | ..) echo "{{ verb }}: $usage_name is not a directory name under packages/" >&2; exit 1 ;;
|
|
14
|
+
esac
|
|
15
|
+
[ ! -f "packages/$usage_name/package.json" ] || dir=packages/$usage_name
|
|
16
|
+
[ -n "$dir" ] || { echo "{{ verb }}: no package $usage_name under packages/" >&2; exit 1; }
|
|
17
|
+
{%- else %}
|
|
18
|
+
case $usage_name in
|
|
19
|
+
*/* | . | ..) echo "{{ verb }}: $usage_name is not a directory name under apps/ or packages/" >&2; exit 1 ;;
|
|
20
|
+
esac
|
|
21
|
+
for root in apps packages; do
|
|
22
|
+
[ -f "$root/$usage_name/package.json" ] || continue
|
|
23
|
+
[ -z "$dir" ] || { echo "{{ verb }}: $usage_name is both apps/$usage_name and packages/$usage_name; rename one to scope by name" >&2; exit 1; }
|
|
24
|
+
dir=$root/$usage_name
|
|
25
|
+
done
|
|
26
|
+
[ -n "$dir" ] || { echo "{{ verb }}: no app or package $usage_name under apps/ or packages/" >&2; exit 1; }
|
|
27
|
+
{%- endif %}
|
|
28
|
+
fi
|
|
29
|
+
{%- endmacro -%}
|
|
30
|
+
monorepo_root = true
|
|
31
|
+
|
|
32
|
+
[monorepo]
|
|
33
|
+
config_roots = [{% if not publishes_packages %}"apps/*", {% endif %}"packages/*"]
|
|
34
|
+
|
|
35
|
+
[tools]
|
|
36
|
+
node = "24"
|
|
37
|
+
hk = "latest"
|
|
38
|
+
python = "3.14"
|
|
39
|
+
uv = "latest"
|
|
40
|
+
copier = { version = "latest", uvx = true }
|
|
41
|
+
# The plx pins are written with each Plexus version, never by the update bot (§ 1 PLX-Updates);
|
|
42
|
+
# allow_low_downloads only waives npm's young-package heuristics.
|
|
43
|
+
"npm:@plexus-ms/cli" = { version = "0.131.0", allow_low_downloads = true }
|
|
44
|
+
{%- if not publishes_packages %}
|
|
45
|
+
"npm:@plexus-ms/cli-ci" = { version = "0.131.0", allow_low_downloads = true }
|
|
46
|
+
{%- endif %}
|
|
47
|
+
|
|
48
|
+
[settings]
|
|
49
|
+
# Not a version source: it lets config_roots match a project without a mise config of its own,
|
|
50
|
+
# without which `mise install --monorepo` fails in a repo whose roots are only packages.
|
|
51
|
+
idiomatic_version_file_enable_tools = ["node"]
|
|
52
|
+
|
|
53
|
+
[hooks]
|
|
54
|
+
# hk is absent on a CI runner whose mise installs only the tools a job names.
|
|
55
|
+
postinstall = "if command -v hk >/dev/null; then hk install --mise; fi && npx corepack enable"
|
|
56
|
+
|
|
57
|
+
[env]
|
|
58
|
+
_.path = ["{% raw %}{{config_root}}{% endraw %}/node_modules/.bin"]
|
|
59
|
+
|
|
60
|
+
{% if not publishes_packages -%}
|
|
61
|
+
[tasks.promote]
|
|
62
|
+
description = "Promote staging to prod: fast-forward main to what is on develop (§ 3 PLX-Delivery); refused unless it is a fast-forward"
|
|
63
|
+
run = 'git fetch -q origin && git push origin origin/develop:refs/heads/main'
|
|
64
|
+
|
|
65
|
+
{% endif -%}
|
|
66
|
+
[tasks.dev]
|
|
67
|
+
{%- if publishes_packages %}
|
|
68
|
+
description = "No-op: a package repo has no development environment to start; build builds its packages and test exercises them"
|
|
69
|
+
usage = 'arg "[name]" hide=#true'
|
|
70
|
+
run = 'echo "dev: nothing to start in a package repo"'
|
|
71
|
+
{%- else %}
|
|
72
|
+
depends = ["install"]
|
|
73
|
+
description = "Prepare a development environment and start it"
|
|
74
|
+
{{ name_arg("start") }}
|
|
75
|
+
run = '''
|
|
76
|
+
{{ scoped("dev") }}
|
|
77
|
+
turbo run dev ${dir:+--filter="./$dir"}
|
|
78
|
+
'''
|
|
79
|
+
{%- endif %}
|
|
80
|
+
|
|
81
|
+
[tasks.build]
|
|
82
|
+
depends = ["install"]
|
|
83
|
+
{%- if publishes_packages %}
|
|
84
|
+
description = "Build the packages, each after the workspace packages it depends on"
|
|
85
|
+
{%- else %}
|
|
86
|
+
description = "Build the production artifacts, an app after the workspace packages it depends on"
|
|
87
|
+
{%- endif %}
|
|
88
|
+
{{ name_arg("build") }}
|
|
89
|
+
run = '''
|
|
90
|
+
{{ scoped("build") }}
|
|
91
|
+
turbo run build ${dir:+--filter="{./$dir}..."}
|
|
92
|
+
'''
|
|
93
|
+
|
|
94
|
+
[tasks.verify]
|
|
95
|
+
description = "Perform all steps that verify code quality"
|
|
96
|
+
{{ name_arg("verify") }}
|
|
97
|
+
run = [
|
|
98
|
+
'mise run check ${usage_name:+"$usage_name"}',
|
|
99
|
+
'mise run test ${usage_name:+"$usage_name"}',
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
[tasks.install]
|
|
103
|
+
description = "Install and wire up project dependencies"
|
|
104
|
+
hide = true
|
|
105
|
+
run = "pnpm install"
|
|
106
|
+
sources = ["package.json", {% if not publishes_packages %}"apps/*/package.json", {% endif %}"packages/*/package.json", "pnpm-lock.yaml", "pnpm-workspace.yaml"]
|
|
107
|
+
outputs = ["node_modules/.pnpm/lock.yaml"]
|
|
108
|
+
|
|
109
|
+
[tasks.lint]
|
|
110
|
+
depends = ["install"]
|
|
111
|
+
description = "Lint and format the codebase"
|
|
112
|
+
usage = '''
|
|
113
|
+
flag "--write" help="Apply safe fixes and formatting in place"
|
|
114
|
+
arg "<paths>" var=#true default="." help="Files or directories to lint (defaults to the whole repo)"
|
|
115
|
+
'''
|
|
116
|
+
# usage shell-quotes var-arg values, so re-parse them via eval instead of bare expansion.
|
|
117
|
+
run = 'eval "set -- $usage_paths"; biome check ${usage_write:+--write} --no-errors-on-unmatched "$@"'
|
|
118
|
+
|
|
119
|
+
[tasks.check]
|
|
120
|
+
depends = ["install"]
|
|
121
|
+
description = "Run static checks on the codebase: lint and the contracts' checks (plx doctor), repo-wide, then each project's check script"
|
|
122
|
+
{{ name_arg("check") }}
|
|
123
|
+
run = '''
|
|
124
|
+
{{ scoped("check") }}
|
|
125
|
+
mise run lint
|
|
126
|
+
plx doctor
|
|
127
|
+
turbo run check ${dir:+--filter="{./$dir}..."}
|
|
128
|
+
'''
|
|
129
|
+
|
|
130
|
+
[tasks.test]
|
|
131
|
+
depends = ["install"]
|
|
132
|
+
description = "Run tests on the codebase"
|
|
133
|
+
{{ name_arg("test") }}
|
|
134
|
+
run = '''
|
|
135
|
+
{{ scoped("test") }}
|
|
136
|
+
turbo run test ${dir:+--filter="{./$dir}..."}
|
|
137
|
+
'''
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
packages:
|
|
2
|
+
{%- if not publishes_packages %}
|
|
3
|
+
- "apps/*"
|
|
4
|
+
{%- endif %}
|
|
5
|
+
- "packages/*"
|
|
6
|
+
catalog:
|
|
7
|
+
typescript: ^6
|
|
8
|
+
minimumReleaseAge: 4320
|
|
9
|
+
minimumReleaseAgeExclude:
|
|
10
|
+
- "@plexus-ms/*"
|
|
11
|
+
{%- if private_packages_scope %}
|
|
12
|
+
- "{{ private_packages_scope }}/*"
|
|
13
|
+
registries:
|
|
14
|
+
"{{ private_packages_scope }}": https://npm.pkg.github.com/
|
|
15
|
+
{%- endif %}
|
|
16
|
+
catalogs:
|
|
17
|
+
plexus:
|
|
18
|
+
"@plexus-ms/config": ^0.120.0
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
+
"extends": ["github>plexus-ms/tooling//renovate/default"{% if publishes_packages %}, "github>plexus-ms/tooling//renovate/library"{% endif %}]{% if pr_reviewers %},
|
|
4
|
+
"reviewers": [{% for r in pr_reviewers.split(',') %}"{{ r.strip() }}"{% if not loop.last %}, {% endif %}{% endfor %}]{% endif %}{% if private_packages_scope %},
|
|
5
|
+
"packageRules": [
|
|
6
|
+
{
|
|
7
|
+
"description": "The tenant's own private packages, from the forge's package registry (§ 5 PLX-Delivery): no release-age wait, as pnpm-workspace.yaml exempts them too; every update waits for a human.",
|
|
8
|
+
"matchDatasources": ["npm"],
|
|
9
|
+
"matchPackageNames": ["{{ private_packages_scope }}/**"],
|
|
10
|
+
"registryUrls": ["https://npm.pkg.github.com"],
|
|
11
|
+
"minimumReleaseAge": null
|
|
12
|
+
}
|
|
13
|
+
]{% endif %}
|
|
14
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://turborepo.com/schema.json",
|
|
3
|
+
"tasks": {
|
|
4
|
+
"build": {
|
|
5
|
+
"dependsOn": ["^build"],
|
|
6
|
+
"inputs": [
|
|
7
|
+
"$TURBO_DEFAULT$",
|
|
8
|
+
"!**/{README,AGENTS,PLEXUS}.md",
|
|
9
|
+
"!.copier-answers.yml",
|
|
10
|
+
"!docs/**",
|
|
11
|
+
"!docker/compose*.yaml"
|
|
12
|
+
],
|
|
13
|
+
"outputs": [{% if not publishes_packages %}".next/**", "!.next/cache/**", {% endif %}"dist/**"]
|
|
14
|
+
},
|
|
15
|
+
"check": {
|
|
16
|
+
"dependsOn": ["^build"],
|
|
17
|
+
"inputs": [
|
|
18
|
+
"$TURBO_DEFAULT$",
|
|
19
|
+
"!**/{README,AGENTS,PLEXUS}.md",
|
|
20
|
+
"!.copier-answers.yml",
|
|
21
|
+
"!docs/**",
|
|
22
|
+
"!docker/compose*.yaml"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"test": {
|
|
26
|
+
"dependsOn": ["build"],
|
|
27
|
+
"inputs": ["$TURBO_DEFAULT$", "!**/{README,AGENTS,PLEXUS}.md", "!.copier-answers.yml", "!docs/**"],
|
|
28
|
+
"passThroughEnv": ["CI", "DATABASE_URL", "E2E_*", "PLAYWRIGHT_*", "PW_TEST_*"]
|
|
29
|
+
},
|
|
30
|
+
"dev": {
|
|
31
|
+
"cache": false,
|
|
32
|
+
"persistent": true
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
package/dist/templates/repo-turbo/files/{% if not publishes_packages %}apps{% endif %}/.gitkeep
ADDED
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
|
|
3
|
+
"changelog": "@changesets/cli/changelog",
|
|
4
|
+
"commit": false,
|
|
5
|
+
"access": "{{ 'restricted' if package_registry == 'github' else 'public' }}",
|
|
6
|
+
"baseBranch": "main",
|
|
7
|
+
"updateInternalDependencies": "patch",
|
|
8
|
+
"fixed": [],
|
|
9
|
+
"linked": [],
|
|
10
|
+
"ignore": []
|
|
11
|
+
}
|