@crossdelta/platform-sdk 0.19.5 โ 0.19.6
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/bin/templates/nest-microservice/Dockerfile.hbs +2 -2
- package/bin/templates/workspace/.github/actions/generate-scope-matrix/action.yml +4 -0
- package/bin/templates/workspace/.github/actions/generate-scope-matrix/index.js +15 -0
- package/bin/templates/workspace/.github/actions/prepare-build-context/action.yml +10 -3
- package/bin/templates/workspace/.github/workflows/build-and-deploy.yml.hbs +5 -7
- package/bin/templates/workspace/infra/package.json.hbs +2 -2
- package/bin/templates/workspace/packages/contracts/package.json.hbs +2 -2
- package/bin/templates/workspace/turbo.json +1 -1
- package/package.json +3 -3
|
@@ -5,7 +5,7 @@ ARG BUN_VERSION={{bunVersion}}
|
|
|
5
5
|
FROM oven/bun:${BUN_VERSION}-alpine AS builder
|
|
6
6
|
WORKDIR /app
|
|
7
7
|
|
|
8
|
-
COPY package.json tsconfig*.json nest-cli.json ./
|
|
8
|
+
COPY bunfig.toml package.json tsconfig*.json nest-cli.json ./
|
|
9
9
|
COPY packages ./packages
|
|
10
10
|
COPY src ./src
|
|
11
11
|
|
|
@@ -20,7 +20,7 @@ RUN bun run build
|
|
|
20
20
|
FROM oven/bun:${BUN_VERSION}-alpine AS deps
|
|
21
21
|
WORKDIR /app
|
|
22
22
|
|
|
23
|
-
COPY package.json ./
|
|
23
|
+
COPY bunfig.toml package.json ./
|
|
24
24
|
COPY packages ./packages
|
|
25
25
|
|
|
26
26
|
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
@@ -7,6 +7,10 @@ inputs:
|
|
|
7
7
|
force-scope-short-names:
|
|
8
8
|
description: Optional short-name list to force into the matrix even if unchanged
|
|
9
9
|
required: false
|
|
10
|
+
force-all:
|
|
11
|
+
description: When true, include ALL discovered scopes regardless of changes
|
|
12
|
+
required: false
|
|
13
|
+
default: 'false'
|
|
10
14
|
outputs:
|
|
11
15
|
scopes:
|
|
12
16
|
description: JSON array describing scopes for the matrix strategy
|
|
@@ -317,6 +317,15 @@ const hasGitDiffChanges = (dir, changedFilesFromEvent, beforeRef, headRef) => {
|
|
|
317
317
|
const scopeHasChanges = (scopeDir, changedFilesFromEvent, beforeRef, headRef) =>
|
|
318
318
|
hasGitDiffChanges(scopeDir, changedFilesFromEvent, beforeRef, headRef)
|
|
319
319
|
|
|
320
|
+
/**
|
|
321
|
+
* Checks if the force-all input is enabled.
|
|
322
|
+
* @returns {boolean} True if all scopes should be force-included
|
|
323
|
+
*/
|
|
324
|
+
const isForceAll = () => {
|
|
325
|
+
const value = getInput('force-all')
|
|
326
|
+
return value === 'true' || value === '1' || value === 'yes'
|
|
327
|
+
}
|
|
328
|
+
|
|
320
329
|
/**
|
|
321
330
|
* Builds the final matrix array with change detection and forced scopes.
|
|
322
331
|
* @param {Map} scopeMap - Discovered scopes
|
|
@@ -327,6 +336,12 @@ const scopeHasChanges = (scopeDir, changedFilesFromEvent, beforeRef, headRef) =>
|
|
|
327
336
|
* @returns {Array<{name: string, shortName: string, dir: string, run: boolean}>} Matrix entries
|
|
328
337
|
*/
|
|
329
338
|
const buildMatrix = (scopeMap, changedFilesFromEvent, beforeRef, headRef, forcedShortNames) => {
|
|
339
|
+
if (isForceAll()) {
|
|
340
|
+
return Array.from(scopeMap.values())
|
|
341
|
+
.map((scope) => ({ ...scope, run: true }))
|
|
342
|
+
.sort((a, b) => a.name.localeCompare(b.name))
|
|
343
|
+
}
|
|
344
|
+
|
|
330
345
|
const enriched = Array.from(scopeMap.values())
|
|
331
346
|
.map((scope) => ({
|
|
332
347
|
...scope,
|
|
@@ -26,9 +26,6 @@ runs:
|
|
|
26
26
|
CONTEXT_DIR="out/${{ inputs.scope-short-name }}/full"
|
|
27
27
|
SCOPE_DIR="${{ inputs.scope-dir }}"
|
|
28
28
|
|
|
29
|
-
# Copy bun.lock from json folder
|
|
30
|
-
cp "out/${{ inputs.scope-short-name }}/json/bun.lock" "$CONTEXT_DIR/"
|
|
31
|
-
|
|
32
29
|
# Flatten: move service/app files to root of context
|
|
33
30
|
if [ -d "$CONTEXT_DIR/$SCOPE_DIR" ]; then
|
|
34
31
|
# Copy all files and directories from the scope dir to context root
|
|
@@ -89,6 +86,16 @@ runs:
|
|
|
89
86
|
if [ -d "packages" ] && [ -n "$(ls -A packages/ 2>/dev/null)" ]; then
|
|
90
87
|
jq '.workspaces = ["packages/*"]' package.json > package.json.tmp
|
|
91
88
|
mv package.json.tmp package.json
|
|
89
|
+
|
|
90
|
+
# Copy pre-built dist/ into private packages (turbo prune skips gitignored outputs)
|
|
91
|
+
for pkg_dir in packages/*/; do
|
|
92
|
+
pkg_basename=$(basename "$pkg_dir")
|
|
93
|
+
workspace_dist="$GITHUB_WORKSPACE/packages/$pkg_basename/dist"
|
|
94
|
+
if [ -d "$workspace_dist" ]; then
|
|
95
|
+
echo " copying dist/ for $pkg_basename"
|
|
96
|
+
cp -r "$workspace_dist" "$pkg_dir/dist"
|
|
97
|
+
fi
|
|
98
|
+
done
|
|
92
99
|
else
|
|
93
100
|
rm -rf packages
|
|
94
101
|
jq 'del(.workspaces)' package.json > package.json.tmp
|
|
@@ -10,10 +10,6 @@ on:
|
|
|
10
10
|
- 'bun.lock'
|
|
11
11
|
- '.github/workflows/**'
|
|
12
12
|
workflow_dispatch:
|
|
13
|
-
workflow_run:
|
|
14
|
-
workflows: ['๐ฆ Publish Packages']
|
|
15
|
-
types:
|
|
16
|
-
- completed
|
|
17
13
|
|
|
18
14
|
permissions:
|
|
19
15
|
contents: read
|
|
@@ -27,14 +23,13 @@ env:
|
|
|
27
23
|
SCOPE_ROOTS: apps,services
|
|
28
24
|
REGISTRY: ghcr.io/$\{{ github.repository_owner }}/$\{{ github.event.repository.name }}
|
|
29
25
|
PULUMI_STACK: $\{{ vars.PULUMI_STACK_BASE }}/$\{{ github.ref_name == 'main' && 'production' || github.ref_name }}
|
|
30
|
-
WORKFLOW_HEAD_SHA: $\{{ github.
|
|
31
|
-
WORKFLOW_BASE_SHA_INPUT: $\{{ github.
|
|
26
|
+
WORKFLOW_HEAD_SHA: $\{{ github.sha }}
|
|
27
|
+
WORKFLOW_BASE_SHA_INPUT: $\{{ github.event.before }}
|
|
32
28
|
|
|
33
29
|
jobs:
|
|
34
30
|
prepare-scopes:
|
|
35
31
|
name: ๐งช Prepare Scopes
|
|
36
32
|
runs-on: ubuntu-latest
|
|
37
|
-
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
|
|
38
33
|
outputs:
|
|
39
34
|
scopes: $\{{ steps.scope-generator.outputs.scopes }}
|
|
40
35
|
scope_count: $\{{ steps.scope-generator.outputs.scopes_count }}
|
|
@@ -83,6 +78,7 @@ jobs:
|
|
|
83
78
|
uses: ./.github/actions/generate-scope-matrix
|
|
84
79
|
with:
|
|
85
80
|
scope-roots: $\{{ env.SCOPE_ROOTS }}
|
|
81
|
+
force-all: $\{{ github.event_name == 'workflow_dispatch' }}
|
|
86
82
|
|
|
87
83
|
build:
|
|
88
84
|
if: needs.prepare-scopes.outputs.scope_count && needs.prepare-scopes.outputs.scope_count != '0'
|
|
@@ -169,6 +165,8 @@ jobs:
|
|
|
169
165
|
tags: |
|
|
170
166
|
$\{{ env.REGISTRY }}/$\{{ matrix.scope.shortName }}:$\{{ env.IMAGE_TAG }}
|
|
171
167
|
$\{{ env.REGISTRY }}/$\{{ matrix.scope.shortName }}:latest
|
|
168
|
+
cache-from: type=gha,scope=$\{{ matrix.scope.shortName }}
|
|
169
|
+
cache-to: type=gha,scope=$\{{ matrix.scope.shortName }},mode=max
|
|
172
170
|
secrets: |
|
|
173
171
|
NPM_TOKEN=$\{{ env.NPM_TOKEN }}
|
|
174
172
|
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"pulumi": "pulumi"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@crossdelta/cloudevents": "^0.6.
|
|
11
|
-
"@crossdelta/infrastructure": "^0.6.
|
|
10
|
+
"@crossdelta/cloudevents": "^0.6.7",
|
|
11
|
+
"@crossdelta/infrastructure": "^0.6.4",
|
|
12
12
|
"{{scope}}/contracts": "workspace:*",
|
|
13
13
|
"@pulumi/digitalocean": "^4.55.0",
|
|
14
14
|
"@pulumi/kubernetes": "^4.21.0",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"clean": "rm -rf dist"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@crossdelta/cloudevents": "^0.6.
|
|
23
|
-
"@crossdelta/infrastructure": "^0.6.
|
|
22
|
+
"@crossdelta/cloudevents": "^0.6.7",
|
|
23
|
+
"@crossdelta/infrastructure": "^0.6.4",
|
|
24
24
|
"zod": "^4.0.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crossdelta/platform-sdk",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.6",
|
|
4
4
|
"description": "Platform toolkit for event-driven microservices โ keeping code and infrastructure in lockstep.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -143,8 +143,8 @@
|
|
|
143
143
|
"zod": "^4.0.0"
|
|
144
144
|
},
|
|
145
145
|
"peerDependencies": {
|
|
146
|
-
"@crossdelta/cloudevents": "0.6.
|
|
147
|
-
"@crossdelta/infrastructure": "0.6.
|
|
146
|
+
"@crossdelta/cloudevents": "0.6.7",
|
|
147
|
+
"@crossdelta/infrastructure": "0.6.4",
|
|
148
148
|
"@nestjs/schematics": "^11.0.5",
|
|
149
149
|
"turbo": "^2.0.0"
|
|
150
150
|
},
|