create-blitzpack 0.1.17 → 0.1.18
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/index.js +69 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -229,7 +229,8 @@ var FEATURE_EXCLUSIONS = {
|
|
|
229
229
|
"apps/api/.dockerignore",
|
|
230
230
|
"apps/api/Dockerfile",
|
|
231
231
|
"apps/web/Dockerfile",
|
|
232
|
-
"deploy/docker"
|
|
232
|
+
"deploy/docker",
|
|
233
|
+
".github/workflows/docker-build.yml"
|
|
233
234
|
],
|
|
234
235
|
ciCd: [".github/workflows/cd.yml"]
|
|
235
236
|
};
|
|
@@ -958,6 +959,59 @@ jobs:
|
|
|
958
959
|
BETTER_AUTH_SECRET: 'test-secret-minimum-32-characters-long-for-ci'
|
|
959
960
|
BETTER_AUTH_URL: 'http://localhost:8080'
|
|
960
961
|
NEXT_PUBLIC_API_URL: 'http://localhost:8080/api'
|
|
962
|
+
|
|
963
|
+
`;
|
|
964
|
+
|
|
965
|
+
// src/docker-ci-workflow-template.ts
|
|
966
|
+
var DOCKER_CI_WORKFLOW_TEMPLATE = `name: Docker Build
|
|
967
|
+
|
|
968
|
+
on:
|
|
969
|
+
pull_request:
|
|
970
|
+
branches: [main, development]
|
|
971
|
+
push:
|
|
972
|
+
branches: [main]
|
|
973
|
+
|
|
974
|
+
# Cancel in-progress runs when a new commit is pushed
|
|
975
|
+
concurrency:
|
|
976
|
+
group: \${{ github.workflow }}-\${{ github.ref }}
|
|
977
|
+
cancel-in-progress: true
|
|
978
|
+
|
|
979
|
+
jobs:
|
|
980
|
+
build-api:
|
|
981
|
+
runs-on: ubuntu-latest
|
|
982
|
+
steps:
|
|
983
|
+
- uses: actions/checkout@v4
|
|
984
|
+
|
|
985
|
+
- name: Set up Docker Buildx
|
|
986
|
+
uses: docker/setup-buildx-action@v3
|
|
987
|
+
|
|
988
|
+
- name: Build API image
|
|
989
|
+
uses: docker/build-push-action@v6
|
|
990
|
+
with:
|
|
991
|
+
context: .
|
|
992
|
+
file: ./apps/api/Dockerfile
|
|
993
|
+
push: false
|
|
994
|
+
cache-from: type=gha
|
|
995
|
+
cache-to: type=gha,mode=max
|
|
996
|
+
|
|
997
|
+
build-web:
|
|
998
|
+
runs-on: ubuntu-latest
|
|
999
|
+
steps:
|
|
1000
|
+
- uses: actions/checkout@v4
|
|
1001
|
+
|
|
1002
|
+
- name: Set up Docker Buildx
|
|
1003
|
+
uses: docker/setup-buildx-action@v3
|
|
1004
|
+
|
|
1005
|
+
- name: Build Web image
|
|
1006
|
+
uses: docker/build-push-action@v6
|
|
1007
|
+
with:
|
|
1008
|
+
context: .
|
|
1009
|
+
file: ./apps/web/Dockerfile
|
|
1010
|
+
push: false
|
|
1011
|
+
build-args: |
|
|
1012
|
+
NEXT_PUBLIC_API_URL=http://localhost:8080/api
|
|
1013
|
+
cache-from: type=gha
|
|
1014
|
+
cache-to: type=gha,mode=max
|
|
961
1015
|
`;
|
|
962
1016
|
|
|
963
1017
|
// src/transform.ts
|
|
@@ -989,6 +1043,7 @@ var TESTING_FILE_PATTERNS = [
|
|
|
989
1043
|
var TS_CONFIG_FILE_PATTERN = /^tsconfig(?:\.[^.]+)?\.json$/;
|
|
990
1044
|
var AGENT_DOC_TARGETS = ["CLAUDE.md", "AGENTS.md"];
|
|
991
1045
|
var CI_WORKFLOW_RELATIVE_PATH = ".github/workflows/ci.yml";
|
|
1046
|
+
var DOCKER_CI_WORKFLOW_RELATIVE_PATH = ".github/workflows/docker-build.yml";
|
|
992
1047
|
var MARKER_FILES = [
|
|
993
1048
|
"apps/api/src/app.ts",
|
|
994
1049
|
"apps/api/src/plugins/services.ts",
|
|
@@ -1177,6 +1232,7 @@ async function applyFeatureTransforms(targetDir, features) {
|
|
|
1177
1232
|
await transformForNoTesting(targetDir);
|
|
1178
1233
|
}
|
|
1179
1234
|
await transformCiWorkflow(targetDir, disabledFeatures);
|
|
1235
|
+
await transformDockerCiWorkflow(targetDir, features);
|
|
1180
1236
|
await transformAgentDocs(targetDir, disabledFeatures);
|
|
1181
1237
|
}
|
|
1182
1238
|
async function transformForNoTesting(targetDir) {
|
|
@@ -1350,6 +1406,18 @@ async function transformCiWorkflow(targetDir, disabledFeatures) {
|
|
|
1350
1406
|
content = cleanEmptyLines(content).trimEnd() + "\n";
|
|
1351
1407
|
await fs2.writeFile(workflowPath, content, "utf-8");
|
|
1352
1408
|
}
|
|
1409
|
+
async function transformDockerCiWorkflow(targetDir, features) {
|
|
1410
|
+
const workflowPath = path3.join(targetDir, DOCKER_CI_WORKFLOW_RELATIVE_PATH);
|
|
1411
|
+
if (!features.dockerDeploy) {
|
|
1412
|
+
if (await fs2.pathExists(workflowPath)) {
|
|
1413
|
+
await fs2.remove(workflowPath);
|
|
1414
|
+
}
|
|
1415
|
+
return;
|
|
1416
|
+
}
|
|
1417
|
+
await fs2.ensureDir(path3.dirname(workflowPath));
|
|
1418
|
+
const content = DOCKER_CI_WORKFLOW_TEMPLATE.trimEnd() + "\n";
|
|
1419
|
+
await fs2.writeFile(workflowPath, content, "utf-8");
|
|
1420
|
+
}
|
|
1353
1421
|
|
|
1354
1422
|
// src/commands/create.ts
|
|
1355
1423
|
var ENV_FILES = [
|