@crossdelta/platform-sdk 0.13.1 โ 0.13.2
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/package.json +1 -1
- package/bin/cli.js +0 -312
- package/bin/docs/generators/README.md +0 -56
- package/bin/docs/generators/code-style.md +0 -96
- package/bin/docs/generators/hono-bun.md +0 -181
- package/bin/docs/generators/hono-node.md +0 -194
- package/bin/docs/generators/nest.md +0 -358
- package/bin/docs/generators/service.md +0 -564
- package/bin/docs/generators/testing.md +0 -97
- package/bin/integration.collection.json +0 -18
- package/bin/templates/hono-microservice/Dockerfile.hbs +0 -16
- package/bin/templates/hono-microservice/biome.json.hbs +0 -3
- package/bin/templates/hono-microservice/src/index.ts.hbs +0 -18
- package/bin/templates/hono-microservice/tsconfig.json.hbs +0 -14
- package/bin/templates/nest-microservice/Dockerfile.hbs +0 -37
- package/bin/templates/nest-microservice/biome.json.hbs +0 -3
- package/bin/templates/nest-microservice/src/app.context.ts.hbs +0 -17
- package/bin/templates/nest-microservice/src/events/events.module.ts.hbs +0 -8
- package/bin/templates/nest-microservice/src/events/events.service.ts.hbs +0 -22
- package/bin/templates/nest-microservice/src/main.ts.hbs +0 -34
- package/bin/templates/workspace/.github/README.md +0 -70
- package/bin/templates/workspace/.github/actions/check-image-tag-exists/action.yml +0 -27
- package/bin/templates/workspace/.github/actions/check-image-tag-exists/index.js +0 -179
- package/bin/templates/workspace/.github/actions/check-path-changes/action.yml +0 -21
- package/bin/templates/workspace/.github/actions/check-path-changes/index.js +0 -192
- package/bin/templates/workspace/.github/actions/detect-skipped-services/action.yml +0 -38
- package/bin/templates/workspace/.github/actions/generate-scope-matrix/action.yml +0 -17
- package/bin/templates/workspace/.github/actions/generate-scope-matrix/index.js +0 -355
- package/bin/templates/workspace/.github/actions/prepare-build-context/action.yml +0 -49
- package/bin/templates/workspace/.github/actions/resolve-scope-tags/action.yml +0 -31
- package/bin/templates/workspace/.github/actions/resolve-scope-tags/index.js +0 -398
- package/bin/templates/workspace/.github/actions/setup-bun-install/action.yml.hbs +0 -57
- package/bin/templates/workspace/.github/copilot-chat-configuration.json +0 -49
- package/bin/templates/workspace/.github/copilot-instructions.md.hbs +0 -72
- package/bin/templates/workspace/.github/dependabot.yml +0 -18
- package/bin/templates/workspace/.github/workflows/build-and-deploy.yml.hbs +0 -228
- package/bin/templates/workspace/.github/workflows/lint-and-tests.yml.hbs +0 -32
- package/bin/templates/workspace/.github/workflows/publish-packages.yml +0 -154
- package/bin/templates/workspace/apps/.gitkeep +0 -0
- package/bin/templates/workspace/biome.json.hbs +0 -62
- package/bin/templates/workspace/bunfig.toml.hbs +0 -5
- package/bin/templates/workspace/docs/.gitkeep +0 -0
- package/bin/templates/workspace/editorconfig.hbs +0 -9
- package/bin/templates/workspace/gitignore.hbs +0 -15
- package/bin/templates/workspace/infra/Pulumi.dev.yaml.hbs +0 -5
- package/bin/templates/workspace/infra/Pulumi.yaml.hbs +0 -6
- package/bin/templates/workspace/infra/index.ts.hbs +0 -56
- package/bin/templates/workspace/infra/package.json.hbs +0 -21
- package/bin/templates/workspace/infra/services/.gitkeep +0 -0
- package/bin/templates/workspace/infra/tsconfig.json.hbs +0 -15
- package/bin/templates/workspace/npmrc.hbs +0 -2
- package/bin/templates/workspace/package.json.hbs +0 -51
- package/bin/templates/workspace/packages/.gitkeep +0 -0
- package/bin/templates/workspace/packages/contracts/README.md.hbs +0 -166
- package/bin/templates/workspace/packages/contracts/package.json.hbs +0 -22
- package/bin/templates/workspace/packages/contracts/src/events/index.ts +0 -16
- package/bin/templates/workspace/packages/contracts/src/index.ts +0 -10
- package/bin/templates/workspace/packages/contracts/src/stream-policies.ts.hbs +0 -40
- package/bin/templates/workspace/packages/contracts/tsconfig.json.hbs +0 -7
- package/bin/templates/workspace/pnpm-workspace.yaml.hbs +0 -5
- package/bin/templates/workspace/turbo.json +0 -37
- package/bin/templates/workspace/turbo.json.hbs +0 -29
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
name: ๐ Build and Deploy
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main]
|
|
6
|
-
paths:
|
|
7
|
-
- 'apps/*/**'
|
|
8
|
-
- 'services/*/**'
|
|
9
|
-
- 'infra/**'
|
|
10
|
-
- 'bun.lock'
|
|
11
|
-
- '.github/workflows/**'
|
|
12
|
-
workflow_run:
|
|
13
|
-
workflows: ['๐ฆ Publish Packages']
|
|
14
|
-
types:
|
|
15
|
-
- completed
|
|
16
|
-
|
|
17
|
-
permissions:
|
|
18
|
-
contents: read
|
|
19
|
-
packages: write
|
|
20
|
-
|
|
21
|
-
concurrency:
|
|
22
|
-
group: deploy-$\{{ github.ref }}
|
|
23
|
-
cancel-in-progress: false
|
|
24
|
-
|
|
25
|
-
env:
|
|
26
|
-
SCOPE_ROOTS: apps,services
|
|
27
|
-
REGISTRY: ghcr.io/$\{{ github.repository_owner }}/$\{{ github.event.repository.name }}
|
|
28
|
-
PULUMI_STACK: $\{{ vars.PULUMI_STACK_BASE }}/$\{{ github.ref_name == 'main' && 'production' || github.ref_name }}
|
|
29
|
-
WORKFLOW_HEAD_SHA: $\{{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.sha }}
|
|
30
|
-
WORKFLOW_BASE_SHA_INPUT: $\{{ github.event_name == 'workflow_run' && github.event.workflow_run.head_commit.id || github.event.before }}
|
|
31
|
-
|
|
32
|
-
jobs:
|
|
33
|
-
prepare-scopes:
|
|
34
|
-
name: ๐งช Prepare Scopes
|
|
35
|
-
runs-on: ubuntu-latest
|
|
36
|
-
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
|
|
37
|
-
outputs:
|
|
38
|
-
scopes: $\{{ steps.scope-generator.outputs.scopes }}
|
|
39
|
-
scope_count: $\{{ steps.scope-generator.outputs.scopes_count }}
|
|
40
|
-
infrastructure_changed: $\{{ steps.infra-check.outputs.changed }}
|
|
41
|
-
steps:
|
|
42
|
-
- uses: actions/checkout@v4
|
|
43
|
-
with:
|
|
44
|
-
fetch-depth: 0
|
|
45
|
-
ref: $\{{ env.WORKFLOW_HEAD_SHA }}
|
|
46
|
-
|
|
47
|
-
- name: Set commit range
|
|
48
|
-
run: |
|
|
49
|
-
set -euo pipefail
|
|
50
|
-
HEAD_SHA="${WORKFLOW_HEAD_SHA}"
|
|
51
|
-
BASE_SHA="${WORKFLOW_BASE_SHA_INPUT}"
|
|
52
|
-
NULL_SHA="0000000000000000000000000000000000000000"
|
|
53
|
-
if [ -z "$BASE_SHA" ] || [ "$BASE_SHA" = "$NULL_SHA" ]; then
|
|
54
|
-
if git rev-parse "${HEAD_SHA}^" >/dev/null 2>&1; then
|
|
55
|
-
BASE_SHA=$(git rev-parse "${HEAD_SHA}^")
|
|
56
|
-
else
|
|
57
|
-
BASE_SHA="$HEAD_SHA"
|
|
58
|
-
fi
|
|
59
|
-
fi
|
|
60
|
-
echo "GITHUB_SHA=$HEAD_SHA" >> "$GITHUB_ENV"
|
|
61
|
-
echo "GITHUB_EVENT_BEFORE=$BASE_SHA" >> "$GITHUB_ENV"
|
|
62
|
-
|
|
63
|
-
- name: Check for infrastructure changes
|
|
64
|
-
id: infra-check
|
|
65
|
-
uses: dorny/paths-filter@v3
|
|
66
|
-
with:
|
|
67
|
-
filters: |
|
|
68
|
-
changed:
|
|
69
|
-
- 'infra/**'
|
|
70
|
-
|
|
71
|
-
- name: Generate scope matrix
|
|
72
|
-
id: scope-generator
|
|
73
|
-
uses: ./.github/actions/generate-scope-matrix
|
|
74
|
-
with:
|
|
75
|
-
scope-roots: $\{{ env.SCOPE_ROOTS }}
|
|
76
|
-
|
|
77
|
-
build:
|
|
78
|
-
if: needs.prepare-scopes.outputs.scope_count && needs.prepare-scopes.outputs.scope_count != '0'
|
|
79
|
-
needs: prepare-scopes
|
|
80
|
-
runs-on: ubuntu-latest
|
|
81
|
-
strategy:
|
|
82
|
-
matrix:
|
|
83
|
-
scope: $\{{ fromJson(needs.prepare-scopes.outputs.scopes) }}
|
|
84
|
-
name: ๐ณ Build $\{{ matrix.scope.shortName }}
|
|
85
|
-
env:
|
|
86
|
-
DOCKER_BUILDKIT: 1
|
|
87
|
-
IMAGE_TAG: $\{{ github.sha }}
|
|
88
|
-
|
|
89
|
-
steps:
|
|
90
|
-
- uses: actions/checkout@v4
|
|
91
|
-
with:
|
|
92
|
-
fetch-depth: 2
|
|
93
|
-
ref: $\{{ env.WORKFLOW_HEAD_SHA }}
|
|
94
|
-
|
|
95
|
-
- name: Set scope metadata
|
|
96
|
-
run: |
|
|
97
|
-
echo "SCOPE_DIR=$\{{ matrix.scope.dir }}" >> $GITHUB_ENV
|
|
98
|
-
echo "scope_name=$\{{ matrix.scope.shortName }}" >> $GITHUB_OUTPUT
|
|
99
|
-
|
|
100
|
-
- name: Setup Bun and install dependencies
|
|
101
|
-
uses: ./.github/actions/setup-bun-install
|
|
102
|
-
with:
|
|
103
|
-
enable-cache: 'true'
|
|
104
|
-
cache-key: bun-$\{{ runner.os }}-$\{{ hashFiles('bun.lock') }}
|
|
105
|
-
cache-restore-keys: bun-$\{{ runner.os }}-
|
|
106
|
-
npm-token: $\{{ secrets.NPM_TOKEN }}
|
|
107
|
-
|
|
108
|
-
- name: Prune
|
|
109
|
-
run: |
|
|
110
|
-
bunx turbo prune --scope=$\{{ matrix.scope.name }} --docker --out-dir out/$\{{ matrix.scope.shortName }}
|
|
111
|
-
|
|
112
|
-
- name: Compute scope checksum
|
|
113
|
-
id: scope-checksum
|
|
114
|
-
run: |
|
|
115
|
-
set -euo pipefail
|
|
116
|
-
cd "out/$\{{ matrix.scope.shortName }}"
|
|
117
|
-
HASH=$(find . -type f -print0 | sort -z | xargs -0 sha256sum | sha256sum)
|
|
118
|
-
HASH=${HASH%% *}
|
|
119
|
-
echo "scope_hash=$HASH" >> $GITHUB_OUTPUT
|
|
120
|
-
|
|
121
|
-
- name: Use scope checksum as image tag
|
|
122
|
-
run: echo "IMAGE_TAG=$\{{ steps.scope-checksum.outputs.scope_hash }}" >> $GITHUB_ENV
|
|
123
|
-
|
|
124
|
-
- name: Check if image tag exists
|
|
125
|
-
id: tag-check
|
|
126
|
-
uses: ./.github/actions/check-image-tag-exists
|
|
127
|
-
with:
|
|
128
|
-
scope-short-name: $\{{ matrix.scope.shortName }}
|
|
129
|
-
image-tag: $\{{ env.IMAGE_TAG }}
|
|
130
|
-
github-token: $\{{ secrets.GITHUB_TOKEN }}
|
|
131
|
-
|
|
132
|
-
- name: Set up Docker Buildx
|
|
133
|
-
if: steps.tag-check.outputs.exists != 'true'
|
|
134
|
-
uses: docker/setup-buildx-action@v3
|
|
135
|
-
|
|
136
|
-
- name: Login to GitHub Packages (GHCR)
|
|
137
|
-
if: steps.tag-check.outputs.exists != 'true'
|
|
138
|
-
uses: docker/login-action@v3
|
|
139
|
-
with:
|
|
140
|
-
registry: ghcr.io
|
|
141
|
-
username: $\{{ github.actor }}
|
|
142
|
-
password: $\{{ secrets.GITHUB_TOKEN }}
|
|
143
|
-
|
|
144
|
-
- name: Prepare build context
|
|
145
|
-
if: steps.tag-check.outputs.exists != 'true'
|
|
146
|
-
uses: ./.github/actions/prepare-build-context
|
|
147
|
-
with:
|
|
148
|
-
scope-short-name: $\{{ matrix.scope.shortName }}
|
|
149
|
-
scope-dir: $\{{ matrix.scope.dir }}
|
|
150
|
-
|
|
151
|
-
- name: Build and push image
|
|
152
|
-
if: steps.tag-check.outputs.exists != 'true'
|
|
153
|
-
uses: docker/build-push-action@v5
|
|
154
|
-
env:
|
|
155
|
-
NPM_TOKEN: $\{{ secrets.NPM_TOKEN }}
|
|
156
|
-
with:
|
|
157
|
-
context: out/$\{{ matrix.scope.shortName }}/full
|
|
158
|
-
push: true
|
|
159
|
-
tags: |
|
|
160
|
-
$\{{ env.REGISTRY }}/$\{{ matrix.scope.shortName }}:$\{{ env.IMAGE_TAG }}
|
|
161
|
-
$\{{ env.REGISTRY }}/$\{{ matrix.scope.shortName }}:latest
|
|
162
|
-
secrets: |
|
|
163
|
-
NPM_TOKEN=$\{{ env.NPM_TOKEN }}
|
|
164
|
-
|
|
165
|
-
- name: Mark this scope as changed
|
|
166
|
-
run: |
|
|
167
|
-
mkdir -p .changed/$\{{ matrix.scope.shortName }}
|
|
168
|
-
echo "$\{{ matrix.scope.shortName }}" > .changed/$\{{ matrix.scope.shortName }}/scope.txt
|
|
169
|
-
printf '{"shortName":"%s","imageTag":"%s"}\n' "$\{{ matrix.scope.shortName }}" "$\{{ env.IMAGE_TAG }}" > .changed/$\{{ matrix.scope.shortName }}/metadata.json
|
|
170
|
-
|
|
171
|
-
- name: Upload change marker
|
|
172
|
-
uses: actions/upload-artifact@v4
|
|
173
|
-
with:
|
|
174
|
-
name: changed-$\{{ matrix.scope.shortName }}
|
|
175
|
-
path: .changed/$\{{ matrix.scope.shortName }}
|
|
176
|
-
|
|
177
|
-
deploy:
|
|
178
|
-
runs-on: ubuntu-latest
|
|
179
|
-
needs: [build, prepare-scopes]
|
|
180
|
-
if: |
|
|
181
|
-
always() &&
|
|
182
|
-
needs.prepare-scopes.result == 'success' &&
|
|
183
|
-
needs.build.result != 'failure' &&
|
|
184
|
-
(needs.prepare-scopes.outputs.scope_count != '0' || needs.prepare-scopes.outputs.infrastructure_changed == 'true')
|
|
185
|
-
name: ๐ Deploy
|
|
186
|
-
steps:
|
|
187
|
-
- uses: actions/checkout@v4
|
|
188
|
-
with:
|
|
189
|
-
ref: $\{{ env.WORKFLOW_HEAD_SHA }}
|
|
190
|
-
- name: Download all change markers
|
|
191
|
-
uses: actions/download-artifact@v4
|
|
192
|
-
with:
|
|
193
|
-
path: .artifacts
|
|
194
|
-
|
|
195
|
-
- name: Detect skipped services
|
|
196
|
-
id: detect_skipped
|
|
197
|
-
uses: ./.github/actions/detect-skipped-services
|
|
198
|
-
|
|
199
|
-
- name: Resolve scope image tags
|
|
200
|
-
id: resolve_scope_tags
|
|
201
|
-
uses: ./.github/actions/resolve-scope-tags
|
|
202
|
-
with:
|
|
203
|
-
markers-dir: .artifacts
|
|
204
|
-
scope-roots: $\{{ env.SCOPE_ROOTS }}
|
|
205
|
-
repository-owner: $\{{ github.repository_owner }}
|
|
206
|
-
allow-missing-scopes: $\{{ steps.detect_skipped.outputs.skipped-services }}
|
|
207
|
-
github-token: $\{{ secrets.GITHUB_TOKEN }}
|
|
208
|
-
|
|
209
|
-
- name: Setup Bun and install dependencies
|
|
210
|
-
uses: ./.github/actions/setup-bun-install
|
|
211
|
-
with:
|
|
212
|
-
enable-cache: 'true'
|
|
213
|
-
cache-key: bun-$\{{ runner.os }}-$\{{ hashFiles('bun.lock') }}
|
|
214
|
-
cache-restore-keys: bun-$\{{ runner.os }}-
|
|
215
|
-
npm-token: $\{{ secrets.NPM_TOKEN }}
|
|
216
|
-
|
|
217
|
-
- name: Pulumi up
|
|
218
|
-
uses: pulumi/actions@v6
|
|
219
|
-
with:
|
|
220
|
-
command: up
|
|
221
|
-
suppress-progress: true
|
|
222
|
-
comment-on-summary: true
|
|
223
|
-
stack-name: $\{{ env.PULUMI_STACK }}
|
|
224
|
-
work-dir: infra
|
|
225
|
-
env:
|
|
226
|
-
PULUMI_ACCESS_TOKEN: $\{{ secrets.PULUMI_ACCESS_TOKEN }}
|
|
227
|
-
DIGITALOCEAN_TOKEN: $\{{ secrets.DIGITALOCEAN_TOKEN }}
|
|
228
|
-
SCOPE_IMAGE_TAGS: $\{{ steps.resolve_scope_tags.outputs.scope_image_tags }}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
name: โ
Pull Request Checks
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
concurrency:
|
|
9
|
-
group: $\{{ github.workflow }}-$\{{ github.ref }}
|
|
10
|
-
cancel-in-progress: true
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
lint-and-test:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
env:
|
|
16
|
-
|
|
17
|
-
steps:
|
|
18
|
-
- name: Checkout code
|
|
19
|
-
uses: actions/checkout@v4
|
|
20
|
-
|
|
21
|
-
- name: Setup Bun and install dependencies
|
|
22
|
-
uses: ./.github/actions/setup-bun-install
|
|
23
|
-
with:
|
|
24
|
-
enable-cache: 'true'
|
|
25
|
-
cache-key: bun-$\{{ runner.os }}-$\{{ hashFiles('bun.lock') }}
|
|
26
|
-
cache-restore-keys: bun-$\{{ runner.os }}-
|
|
27
|
-
|
|
28
|
-
- name: Run Linter
|
|
29
|
-
run: bun run --if-present lint
|
|
30
|
-
|
|
31
|
-
- name: Run Tests
|
|
32
|
-
run: bun run --if-present test
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
name: ๐ฆ Publish Packages
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
paths:
|
|
8
|
-
- 'packages/*/**'
|
|
9
|
-
workflow_dispatch:
|
|
10
|
-
inputs:
|
|
11
|
-
package:
|
|
12
|
-
description: 'Package to publish (all, cloudevents, platform-sdk, infrastructure, telemetry)'
|
|
13
|
-
type: choice
|
|
14
|
-
default: all
|
|
15
|
-
options:
|
|
16
|
-
- all
|
|
17
|
-
- cloudevents
|
|
18
|
-
- platform-sdk
|
|
19
|
-
- infrastructure
|
|
20
|
-
- telemetry
|
|
21
|
-
|
|
22
|
-
permissions:
|
|
23
|
-
contents: write
|
|
24
|
-
|
|
25
|
-
jobs:
|
|
26
|
-
determine-packages:
|
|
27
|
-
if: github.actor != 'github-actions[bot]'
|
|
28
|
-
runs-on: ubuntu-latest
|
|
29
|
-
outputs:
|
|
30
|
-
packages: ${{ steps.detect.outputs.packages }}
|
|
31
|
-
count: ${{ steps.detect.outputs.count }}
|
|
32
|
-
steps:
|
|
33
|
-
- name: Checkout repository
|
|
34
|
-
uses: actions/checkout@v4
|
|
35
|
-
with:
|
|
36
|
-
fetch-depth: 0
|
|
37
|
-
|
|
38
|
-
- name: Determine packages to publish
|
|
39
|
-
id: detect
|
|
40
|
-
env:
|
|
41
|
-
EVENT_NAME: ${{ github.event_name }}
|
|
42
|
-
INPUT_PACKAGE: ${{ github.event.inputs.package || '' }}
|
|
43
|
-
BASE_SHA: ${{ github.event.before }}
|
|
44
|
-
HEAD_SHA: ${{ github.sha }}
|
|
45
|
-
run: |
|
|
46
|
-
set -euo pipefail
|
|
47
|
-
declare -a entries=()
|
|
48
|
-
|
|
49
|
-
add_entry() {
|
|
50
|
-
local name="$1"
|
|
51
|
-
local dir="$2"
|
|
52
|
-
entries+=("$(jq -n --arg name "$name" --arg dir "$dir" '{name:$name, dir:$dir}')")
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
|
|
56
|
-
mapfile -t dirs < <(find packages -mindepth 1 -maxdepth 1 -type d | sort)
|
|
57
|
-
for dir in "${dirs[@]}"; do
|
|
58
|
-
[ -f "$dir/package.json" ] || continue
|
|
59
|
-
is_private=$(jq -r '.private // false' "$dir/package.json")
|
|
60
|
-
[ "$is_private" = "true" ] && continue
|
|
61
|
-
pkg_name=$(jq -r '.name // empty' "$dir/package.json")
|
|
62
|
-
[ -n "$pkg_name" ] || continue
|
|
63
|
-
slug=$(basename "$dir")
|
|
64
|
-
if [ -z "$INPUT_PACKAGE" ] || [ "$INPUT_PACKAGE" = "all" ] || [ "$INPUT_PACKAGE" = "$slug" ]; then
|
|
65
|
-
add_entry "$pkg_name" "$dir"
|
|
66
|
-
fi
|
|
67
|
-
done
|
|
68
|
-
else
|
|
69
|
-
base="${BASE_SHA:-$(git rev-parse HEAD^)}"
|
|
70
|
-
[ "$base" = "0000000000000000000000000000000000000000" ] && base=$(git rev-parse HEAD^)
|
|
71
|
-
changed_dirs=$(git diff --name-only "$base" "$HEAD_SHA" -- 'packages/*' | cut -d/ -f1-2 | sort -u)
|
|
72
|
-
while IFS= read -r dir; do
|
|
73
|
-
[ -f "$dir/package.json" ] || continue
|
|
74
|
-
is_private=$(jq -r '.private // false' "$dir/package.json")
|
|
75
|
-
[ "$is_private" = "true" ] && continue
|
|
76
|
-
pkg_name=$(jq -r '.name // empty' "$dir/package.json")
|
|
77
|
-
[ -n "$pkg_name" ] && add_entry "$pkg_name" "$dir"
|
|
78
|
-
done <<< "$changed_dirs"
|
|
79
|
-
fi
|
|
80
|
-
|
|
81
|
-
if [ ${#entries[@]} -eq 0 ]; then
|
|
82
|
-
echo 'packages=[]' >> "$GITHUB_OUTPUT"
|
|
83
|
-
echo 'count=0' >> "$GITHUB_OUTPUT"
|
|
84
|
-
else
|
|
85
|
-
echo 'packages<<__PKGS__' >> "$GITHUB_OUTPUT"
|
|
86
|
-
printf '%s\n' "${entries[@]}" | jq -s '.' >> "$GITHUB_OUTPUT"
|
|
87
|
-
echo '__PKGS__' >> "$GITHUB_OUTPUT"
|
|
88
|
-
echo "count=${#entries[@]}" >> "$GITHUB_OUTPUT"
|
|
89
|
-
fi
|
|
90
|
-
|
|
91
|
-
publish:
|
|
92
|
-
name: Publish ${{ matrix.package.name }}
|
|
93
|
-
needs: determine-packages
|
|
94
|
-
if: needs.determine-packages.outputs.count != '0'
|
|
95
|
-
runs-on: ubuntu-latest
|
|
96
|
-
strategy:
|
|
97
|
-
max-parallel: 1
|
|
98
|
-
matrix:
|
|
99
|
-
package: ${{ fromJson(needs.determine-packages.outputs.packages) }}
|
|
100
|
-
steps:
|
|
101
|
-
- uses: actions/checkout@v4
|
|
102
|
-
|
|
103
|
-
- uses: oven-sh/setup-bun@v2
|
|
104
|
-
|
|
105
|
-
- name: Install dependencies
|
|
106
|
-
run: bun install
|
|
107
|
-
|
|
108
|
-
- name: Bump version (only if already published)
|
|
109
|
-
id: bump
|
|
110
|
-
working-directory: ${{ matrix.package.dir }}
|
|
111
|
-
run: |
|
|
112
|
-
CURRENT=$(jq -r '.version' package.json)
|
|
113
|
-
PUBLISHED=$(npm view "${{ matrix.package.name }}" version 2>/dev/null || echo "0.0.0")
|
|
114
|
-
|
|
115
|
-
# Only bump if current version already exists on npm
|
|
116
|
-
if [ "$CURRENT" = "$PUBLISHED" ]; then
|
|
117
|
-
NEW="${CURRENT%.*}.$((${CURRENT##*.} + 1))"
|
|
118
|
-
jq --arg v "$NEW" '.version = $v' package.json > tmp && mv tmp package.json
|
|
119
|
-
echo "version=$NEW" >> "$GITHUB_OUTPUT"
|
|
120
|
-
echo "bumped=true" >> "$GITHUB_OUTPUT"
|
|
121
|
-
echo "๐ฆ Bumped version: $CURRENT โ $NEW"
|
|
122
|
-
else
|
|
123
|
-
echo "version=$CURRENT" >> "$GITHUB_OUTPUT"
|
|
124
|
-
echo "bumped=false" >> "$GITHUB_OUTPUT"
|
|
125
|
-
echo "๐ฆ Using manual version: $CURRENT (npm has: $PUBLISHED)"
|
|
126
|
-
fi
|
|
127
|
-
|
|
128
|
-
- name: Build
|
|
129
|
-
run: bunx turbo run build --filter=${{ matrix.package.name }}
|
|
130
|
-
|
|
131
|
-
- name: Test
|
|
132
|
-
working-directory: ${{ matrix.package.dir }}
|
|
133
|
-
run: bun run --if-present test
|
|
134
|
-
|
|
135
|
-
- name: Security audit
|
|
136
|
-
run: bun audit || true
|
|
137
|
-
continue-on-error: true
|
|
138
|
-
|
|
139
|
-
- name: Publish
|
|
140
|
-
working-directory: ${{ matrix.package.dir }}
|
|
141
|
-
env:
|
|
142
|
-
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
143
|
-
run: bun publish --access=public --provenance --tolerate-republish
|
|
144
|
-
|
|
145
|
-
- name: Commit version bump
|
|
146
|
-
if: steps.bump.outputs.bumped == 'true'
|
|
147
|
-
env:
|
|
148
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
149
|
-
run: |
|
|
150
|
-
git config user.name "github-actions[bot]"
|
|
151
|
-
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
152
|
-
git add "${{ matrix.package.dir }}/package.json"
|
|
153
|
-
git diff --cached --quiet || git commit -m "chore(release): ${{ matrix.package.name }}@${{ steps.bump.outputs.version }}"
|
|
154
|
-
git pull --rebase origin ${{ github.ref_name }} && git push || true
|
|
File without changes
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
|
|
3
|
-
"formatter": {
|
|
4
|
-
"indentStyle": "space"
|
|
5
|
-
},
|
|
6
|
-
"assist": {
|
|
7
|
-
"actions": {
|
|
8
|
-
"source": {
|
|
9
|
-
"organizeImports": "on"
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"linter": {
|
|
14
|
-
"enabled": true,
|
|
15
|
-
"rules": {
|
|
16
|
-
"security": {
|
|
17
|
-
"recommended": true
|
|
18
|
-
},
|
|
19
|
-
"style": {
|
|
20
|
-
"recommended": true,
|
|
21
|
-
"useAsConstAssertion": "warn",
|
|
22
|
-
"noUselessElse": "error",
|
|
23
|
-
"useConst": "error",
|
|
24
|
-
"useImportType": "off"
|
|
25
|
-
},
|
|
26
|
-
"complexity": {
|
|
27
|
-
"recommended": true,
|
|
28
|
-
"noUselessEmptyExport": "error",
|
|
29
|
-
"noExcessiveCognitiveComplexity": {
|
|
30
|
-
"level": "warn",
|
|
31
|
-
"options": {
|
|
32
|
-
"maxAllowedComplexity": 15
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
"javascript": {
|
|
39
|
-
"formatter": {
|
|
40
|
-
"indentWidth": 2,
|
|
41
|
-
"quoteStyle": "single",
|
|
42
|
-
"semicolons": "asNeeded",
|
|
43
|
-
"lineWidth": 120,
|
|
44
|
-
"trailingCommas": "all",
|
|
45
|
-
"arrowParentheses": "always"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
"files": {
|
|
49
|
-
"includes": [
|
|
50
|
-
"**/src/**/*.ts",
|
|
51
|
-
"infra/**/*.ts",
|
|
52
|
-
"!apps/storefront",
|
|
53
|
-
"!**/vendor",
|
|
54
|
-
"!**/dist",
|
|
55
|
-
"!**/node_modules",
|
|
56
|
-
"!reports",
|
|
57
|
-
"!coverage",
|
|
58
|
-
"!stryker-tmp",
|
|
59
|
-
"!**/.stryker-tmp"
|
|
60
|
-
]
|
|
61
|
-
}
|
|
62
|
-
}
|
|
File without changes
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { join } from 'node:path'
|
|
2
|
-
import {
|
|
3
|
-
buildExternalUrls,
|
|
4
|
-
buildIngressRules,
|
|
5
|
-
buildInternalUrls,
|
|
6
|
-
buildServicePortEnvs,
|
|
7
|
-
buildServices,
|
|
8
|
-
buildServiceUrlEnvs,
|
|
9
|
-
discoverServices,
|
|
10
|
-
} from '@crossdelta/infrastructure'
|
|
11
|
-
import { App } from '@pulumi/digitalocean'
|
|
12
|
-
import { Config, getStack } from '@pulumi/pulumi'
|
|
13
|
-
|
|
14
|
-
const allServiceConfigs = discoverServices(join(__dirname, 'services'))
|
|
15
|
-
const serviceConfigs = allServiceConfigs.filter((config) => !config.skip)
|
|
16
|
-
const cfg = new Config()
|
|
17
|
-
const logtailToken = cfg.requireSecret('logtailToken')
|
|
18
|
-
const registryCredentials = cfg.requireSecret('registryCredentials')
|
|
19
|
-
|
|
20
|
-
const stack = getStack()
|
|
21
|
-
|
|
22
|
-
const doAppName = `{{projectName}}-${stack}`
|
|
23
|
-
|
|
24
|
-
const app = new App('{{projectName}}', {
|
|
25
|
-
spec: {
|
|
26
|
-
name: doAppName,
|
|
27
|
-
region: 'fra',
|
|
28
|
-
|
|
29
|
-
alerts: [{ rule: 'DEPLOYMENT_FAILED' }, { rule: 'DOMAIN_FAILED' }],
|
|
30
|
-
|
|
31
|
-
features: ['buildpack-stack=ubuntu-22'],
|
|
32
|
-
|
|
33
|
-
envs: [
|
|
34
|
-
...buildServiceUrlEnvs(serviceConfigs),
|
|
35
|
-
...buildServicePortEnvs(serviceConfigs),
|
|
36
|
-
],
|
|
37
|
-
|
|
38
|
-
services: buildServices({
|
|
39
|
-
serviceConfigs,
|
|
40
|
-
registryCredentials,
|
|
41
|
-
logtailToken,
|
|
42
|
-
}),
|
|
43
|
-
|
|
44
|
-
ingress: {
|
|
45
|
-
rules: buildIngressRules(serviceConfigs),
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
// Outputs
|
|
51
|
-
export const appId = app.id
|
|
52
|
-
export const appDefaultIngress = app.defaultIngress
|
|
53
|
-
export const internalUrls = buildInternalUrls(serviceConfigs)
|
|
54
|
-
export const serviceUrls = app.defaultIngress.apply((baseUrl) =>
|
|
55
|
-
buildExternalUrls(serviceConfigs, baseUrl ?? ''),
|
|
56
|
-
)
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "infra",
|
|
3
|
-
"private": true,
|
|
4
|
-
"scripts": {
|
|
5
|
-
"generate-env": "generate-env",
|
|
6
|
-
"lint": "biome lint --fix",
|
|
7
|
-
"pulumi": "pulumi"
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@crossdelta/infrastructure": "latest",
|
|
11
|
-
"@pulumi/digitalocean": "^4.55.0",
|
|
12
|
-
"@pulumi/kubernetes": "^4.21.0",
|
|
13
|
-
"@pulumi/pulumi": "^3.208.0",
|
|
14
|
-
"tsx": "^4.19.0"
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@biomejs/biome": "2.3.7",
|
|
18
|
-
"@types/node": "^24.10.1",
|
|
19
|
-
"typescript": "^5.9.3"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
File without changes
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"lib": ["ES2022"],
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"strict": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"forceConsistentCasingInFileNames": true,
|
|
11
|
-
"outDir": "./dist"
|
|
12
|
-
},
|
|
13
|
-
"include": ["**/*.ts"],
|
|
14
|
-
"exclude": ["node_modules"]
|
|
15
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{projectName}}",
|
|
3
|
-
"private": true,
|
|
4
|
-
"scripts": {
|
|
5
|
-
"dev": "pf dev",
|
|
6
|
-
"generate-env": "cd infra && bun run generate-env",
|
|
7
|
-
"build": "dotenv -e .env.local -- turbo run build",
|
|
8
|
-
"preview": "dotenv -e .env.local -- turbo run preview",
|
|
9
|
-
"lint": "turbo run lint",
|
|
10
|
-
"format": "turbo run format",
|
|
11
|
-
"pulumi": "cd infra && pulumi",
|
|
12
|
-
"test": "dotenv -e .env.local -- turbo run test"
|
|
13
|
-
},
|
|
14
|
-
"pf": {
|
|
15
|
-
"registry": "{{projectName}}/platform",
|
|
16
|
-
"commands": {
|
|
17
|
-
"pulumi": {
|
|
18
|
-
"cwd": "infra"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"paths": {
|
|
22
|
-
"services": {
|
|
23
|
-
"path": "services",
|
|
24
|
-
"watch": true
|
|
25
|
-
},
|
|
26
|
-
"apps": {
|
|
27
|
-
"path": "apps",
|
|
28
|
-
"watch": true
|
|
29
|
-
},
|
|
30
|
-
"packages": {
|
|
31
|
-
"path": "packages",
|
|
32
|
-
"watch": true
|
|
33
|
-
},
|
|
34
|
-
"contracts": {
|
|
35
|
-
"path": "packages/contracts"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"@crossdelta/cloudevents": "latest",
|
|
41
|
-
"@crossdelta/telemetry": "latest"
|
|
42
|
-
},
|
|
43
|
-
"devDependencies": {
|
|
44
|
-
"@biomejs/biome": "2.3.7",
|
|
45
|
-
"@crossdelta/platform-sdk": "latest",
|
|
46
|
-
"dotenv-cli": "^8.0.0",
|
|
47
|
-
"turbo": "^2.5.6"
|
|
48
|
-
},
|
|
49
|
-
"packageManager": "{{packageManagerVersion}}",
|
|
50
|
-
"workspaces": ["packages/*", "apps/*", "services/*", "infra"]
|
|
51
|
-
}
|
|
File without changes
|