@decocms/start 3.0.0 → 4.1.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/.agents/skills/deco-to-tanstack-migration/SKILL.md +1 -1
- package/.agents/skills/deco-to-tanstack-migration/references/worker-cloudflare.md +32 -135
- package/.agents/skills/deco-to-tanstack-migration/templates/package-json.md +2 -5
- package/.cursor/rules/migration-tooling-policy.mdc +32 -48
- package/CODEOWNERS +4 -12
- package/MIGRATION_TOOLING_PLAN.md +9 -13
- package/package.json +2 -3
- package/scripts/migrate/phase-scaffold.ts +9 -12
- package/scripts/migrate/phase-verify.ts +3 -5
- package/scripts/migrate/templates/package-json.ts +6 -9
- package/src/sdk/logger.test.ts +53 -0
- package/src/sdk/logger.ts +58 -3
- package/src/vite/plugin.js +32 -18
- package/src/vite/plugin.test.js +54 -0
- package/.github/workflows/deploy.yml +0 -141
- package/.github/workflows/preview.yml +0 -200
- package/.github/workflows/sync-secrets.yml +0 -171
- package/deploy/README.md +0 -121
- package/deploy/wrangler-template.jsonc +0 -46
- package/scripts/deploy/build-wrangler-config.mjs +0 -47
- package/scripts/deploy/jsonc.mjs +0 -76
- package/scripts/deploy/site-registry.mjs +0 -95
- package/scripts/deploy/wrangler-wrapper.mjs +0 -118
- package/scripts/migrate/templates/github-workflows.ts +0 -159
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
// Caller workflow stubs for new sites (v3, D6.2 architecture). Each stub mints
|
|
2
|
-
// a short-lived `decocms-deployer` GitHub App installation token and uses it
|
|
3
|
-
// to call the corresponding reusable workflow under
|
|
4
|
-
// `decocms/deco-start/.github/workflows/`. The customer repo holds no deploy
|
|
5
|
-
// logic of its own AND no Cloudflare credentials -- only the App ID + private
|
|
6
|
-
// key as deco-sites org-level secrets (`DECOCMS_DEPLOYER_APP_ID` and
|
|
7
|
-
// `DECOCMS_DEPLOYER_APP_PRIVATE_KEY`).
|
|
8
|
-
//
|
|
9
|
-
// See `deploy/README.md` and the migration-tooling-policy rule (D6.2) for the
|
|
10
|
-
// full trust model.
|
|
11
|
-
|
|
12
|
-
const DEPLOY_YML = `name: Deploy
|
|
13
|
-
|
|
14
|
-
# Triggers decocms/deco-start's central deploy workflow via App-token.
|
|
15
|
-
|
|
16
|
-
on:
|
|
17
|
-
push:
|
|
18
|
-
branches: [main]
|
|
19
|
-
|
|
20
|
-
permissions:
|
|
21
|
-
contents: read
|
|
22
|
-
|
|
23
|
-
jobs:
|
|
24
|
-
trigger:
|
|
25
|
-
runs-on: ubuntu-latest
|
|
26
|
-
steps:
|
|
27
|
-
- uses: actions/create-github-app-token@v1
|
|
28
|
-
id: app-token
|
|
29
|
-
with:
|
|
30
|
-
app-id: \${{ secrets.DECOCMS_DEPLOYER_APP_ID }}
|
|
31
|
-
private-key: \${{ secrets.DECOCMS_DEPLOYER_APP_PRIVATE_KEY }}
|
|
32
|
-
owner: decocms
|
|
33
|
-
repositories: deco-start
|
|
34
|
-
- env:
|
|
35
|
-
GH_TOKEN: \${{ steps.app-token.outputs.token }}
|
|
36
|
-
run: |
|
|
37
|
-
gh workflow run deploy.yml \\
|
|
38
|
-
--repo decocms/deco-start \\
|
|
39
|
-
--ref v3 \\
|
|
40
|
-
-f site_owner=\${GITHUB_REPOSITORY%%/*} \\
|
|
41
|
-
-f site_name=\${GITHUB_REPOSITORY##*/}
|
|
42
|
-
`;
|
|
43
|
-
|
|
44
|
-
const PREVIEW_YML = `name: Preview
|
|
45
|
-
|
|
46
|
-
# Triggers decocms/deco-start's central preview workflow via App-token.
|
|
47
|
-
|
|
48
|
-
on:
|
|
49
|
-
pull_request:
|
|
50
|
-
types: [opened, synchronize, reopened]
|
|
51
|
-
push:
|
|
52
|
-
branches: ['env/**']
|
|
53
|
-
|
|
54
|
-
permissions:
|
|
55
|
-
contents: read
|
|
56
|
-
|
|
57
|
-
jobs:
|
|
58
|
-
trigger:
|
|
59
|
-
runs-on: ubuntu-latest
|
|
60
|
-
steps:
|
|
61
|
-
- id: meta
|
|
62
|
-
run: |
|
|
63
|
-
if [ "\${{ github.event_name }}" = "pull_request" ]; then
|
|
64
|
-
echo "alias=pr-\${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
|
|
65
|
-
echo "sha=\${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT"
|
|
66
|
-
else
|
|
67
|
-
REF="\${GITHUB_REF#refs/heads/env/}"
|
|
68
|
-
echo "alias=$(echo "$REF" | sed 's|[^a-z0-9-]|-|g')" >> "$GITHUB_OUTPUT"
|
|
69
|
-
echo "sha=\${{ github.sha }}" >> "$GITHUB_OUTPUT"
|
|
70
|
-
fi
|
|
71
|
-
- uses: actions/create-github-app-token@v1
|
|
72
|
-
id: app-token
|
|
73
|
-
with:
|
|
74
|
-
app-id: \${{ secrets.DECOCMS_DEPLOYER_APP_ID }}
|
|
75
|
-
private-key: \${{ secrets.DECOCMS_DEPLOYER_APP_PRIVATE_KEY }}
|
|
76
|
-
owner: decocms
|
|
77
|
-
repositories: deco-start
|
|
78
|
-
- env:
|
|
79
|
-
GH_TOKEN: \${{ steps.app-token.outputs.token }}
|
|
80
|
-
run: |
|
|
81
|
-
gh workflow run preview.yml \\
|
|
82
|
-
--repo decocms/deco-start \\
|
|
83
|
-
--ref v3 \\
|
|
84
|
-
-f site_owner=\${GITHUB_REPOSITORY%%/*} \\
|
|
85
|
-
-f site_name=\${GITHUB_REPOSITORY##*/} \\
|
|
86
|
-
-f site_sha=\${{ steps.meta.outputs.sha }} \\
|
|
87
|
-
-f alias=\${{ steps.meta.outputs.alias }} \\
|
|
88
|
-
-f pr_number=\${{ github.event.pull_request.number || '' }}
|
|
89
|
-
`;
|
|
90
|
-
|
|
91
|
-
const REGEN_BLOCKS_YML = `name: Regenerate blocks.gen.json
|
|
92
|
-
|
|
93
|
-
# Thin caller for decocms/deco-start's central regen-blocks workflow.
|
|
94
|
-
# This one stays as workflow_call: it runs in the caller's runner context
|
|
95
|
-
# (writes back to the storefront repo) and needs no Cloudflare credentials.
|
|
96
|
-
|
|
97
|
-
on:
|
|
98
|
-
push:
|
|
99
|
-
branches: [main]
|
|
100
|
-
paths:
|
|
101
|
-
- ".deco/blocks/**"
|
|
102
|
-
|
|
103
|
-
permissions:
|
|
104
|
-
contents: write
|
|
105
|
-
|
|
106
|
-
jobs:
|
|
107
|
-
regen:
|
|
108
|
-
uses: decocms/deco-start/.github/workflows/regen-blocks.yml@v3
|
|
109
|
-
secrets: inherit
|
|
110
|
-
`;
|
|
111
|
-
|
|
112
|
-
const SYNC_SECRETS_YML = `name: Sync worker secrets
|
|
113
|
-
|
|
114
|
-
# Triggers decocms/deco-start's central sync-secrets workflow via App-token.
|
|
115
|
-
# The actual SECRET_* values live in deco-start's '\${repo-basename}-secrets'
|
|
116
|
-
# environment, NOT in this repo. See deco-start's deploy/README.md.
|
|
117
|
-
|
|
118
|
-
on:
|
|
119
|
-
workflow_dispatch:
|
|
120
|
-
inputs:
|
|
121
|
-
mode:
|
|
122
|
-
description: "dry-run = print diff only | apply = set secrets on worker"
|
|
123
|
-
required: true
|
|
124
|
-
default: "dry-run"
|
|
125
|
-
type: choice
|
|
126
|
-
options: [dry-run, apply]
|
|
127
|
-
|
|
128
|
-
permissions:
|
|
129
|
-
contents: read
|
|
130
|
-
|
|
131
|
-
jobs:
|
|
132
|
-
trigger:
|
|
133
|
-
runs-on: ubuntu-latest
|
|
134
|
-
steps:
|
|
135
|
-
- uses: actions/create-github-app-token@v1
|
|
136
|
-
id: app-token
|
|
137
|
-
with:
|
|
138
|
-
app-id: \${{ secrets.DECOCMS_DEPLOYER_APP_ID }}
|
|
139
|
-
private-key: \${{ secrets.DECOCMS_DEPLOYER_APP_PRIVATE_KEY }}
|
|
140
|
-
owner: decocms
|
|
141
|
-
repositories: deco-start
|
|
142
|
-
- env:
|
|
143
|
-
GH_TOKEN: \${{ steps.app-token.outputs.token }}
|
|
144
|
-
run: |
|
|
145
|
-
gh workflow run sync-secrets.yml \\
|
|
146
|
-
--repo decocms/deco-start \\
|
|
147
|
-
--ref v3 \\
|
|
148
|
-
-f site_name=\${GITHUB_REPOSITORY##*/} \\
|
|
149
|
-
-f mode=\${{ inputs.mode }}
|
|
150
|
-
`;
|
|
151
|
-
|
|
152
|
-
export function generateGithubWorkflows(): Record<string, string> {
|
|
153
|
-
return {
|
|
154
|
-
".github/workflows/deploy.yml": DEPLOY_YML,
|
|
155
|
-
".github/workflows/preview.yml": PREVIEW_YML,
|
|
156
|
-
".github/workflows/regen-blocks.yml": REGEN_BLOCKS_YML,
|
|
157
|
-
".github/workflows/sync-secrets.yml": SYNC_SECRETS_YML,
|
|
158
|
-
};
|
|
159
|
-
}
|