pipecraft 0.0.0-releaseit → 0.26.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/README.md +126 -108
- package/dist/cli/index.d.ts +69 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +94 -22
- package/dist/cli/index.js.map +1 -1
- package/dist/generators/init.tpl.d.ts +70 -0
- package/dist/generators/init.tpl.d.ts.map +1 -1
- package/dist/generators/init.tpl.js +100 -8
- package/dist/generators/init.tpl.js.map +1 -1
- package/dist/generators/workflows.tpl.d.ts +86 -0
- package/dist/generators/workflows.tpl.d.ts.map +1 -1
- package/dist/generators/workflows.tpl.js +101 -9
- package/dist/generators/workflows.tpl.js.map +1 -1
- package/dist/templates/actions/calculate-version.yml.tpl.d.ts +47 -0
- package/dist/templates/actions/calculate-version.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/calculate-version.yml.tpl.js +72 -3
- package/dist/templates/actions/calculate-version.yml.tpl.js.map +1 -1
- package/dist/templates/actions/create-pr.yml.tpl.d.ts +14 -0
- package/dist/templates/actions/create-pr.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/create-pr.yml.tpl.js +22 -2
- package/dist/templates/actions/create-pr.yml.tpl.js.map +1 -1
- package/dist/templates/actions/create-release.yml.tpl.d.ts +18 -0
- package/dist/templates/actions/create-release.yml.tpl.d.ts.map +1 -0
- package/dist/templates/actions/create-release.yml.tpl.js +141 -0
- package/dist/templates/actions/create-release.yml.tpl.js.map +1 -0
- package/dist/templates/actions/create-tag.yml.tpl.d.ts +14 -0
- package/dist/templates/actions/create-tag.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/create-tag.yml.tpl.js +22 -2
- package/dist/templates/actions/create-tag.yml.tpl.js.map +1 -1
- package/dist/templates/actions/detect-changes.yml.tpl.d.ts +70 -0
- package/dist/templates/actions/detect-changes.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/detect-changes.yml.tpl.js +98 -2
- package/dist/templates/actions/detect-changes.yml.tpl.js.map +1 -1
- package/dist/templates/actions/manage-branch.yml.tpl.d.ts +14 -0
- package/dist/templates/actions/manage-branch.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/manage-branch.yml.tpl.js +22 -2
- package/dist/templates/actions/manage-branch.yml.tpl.js.map +1 -1
- package/dist/templates/actions/promote-branch.yml.tpl.d.ts +14 -0
- package/dist/templates/actions/promote-branch.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/promote-branch.yml.tpl.js +50 -7
- package/dist/templates/actions/promote-branch.yml.tpl.js.map +1 -1
- package/dist/templates/workflows/pipeline-path-based.yml.tpl.d.ts +114 -1
- package/dist/templates/workflows/pipeline-path-based.yml.tpl.d.ts.map +1 -1
- package/dist/templates/workflows/pipeline-path-based.yml.tpl.js +479 -74
- package/dist/templates/workflows/pipeline-path-based.yml.tpl.js.map +1 -1
- package/dist/types/index.d.ts +231 -8
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +9 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/ast-path-operations.d.ts.map +1 -1
- package/dist/utils/ast-path-operations.js +24 -11
- package/dist/utils/ast-path-operations.js.map +1 -1
- package/dist/utils/config.d.ts +63 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +71 -0
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/github-setup.d.ts +323 -2
- package/dist/utils/github-setup.d.ts.map +1 -1
- package/dist/utils/github-setup.js +551 -23
- package/dist/utils/github-setup.js.map +1 -1
- package/dist/utils/idempotency.d.ts +147 -7
- package/dist/utils/idempotency.d.ts.map +1 -1
- package/dist/utils/idempotency.js +143 -15
- package/dist/utils/idempotency.js.map +1 -1
- package/dist/utils/logger.d.ts +134 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +153 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/preflight.d.ts +223 -12
- package/dist/utils/preflight.d.ts.map +1 -1
- package/dist/utils/preflight.js +216 -16
- package/dist/utils/preflight.js.map +1 -1
- package/dist/utils/versioning.d.ts +160 -8
- package/dist/utils/versioning.d.ts.map +1 -1
- package/dist/utils/versioning.js +179 -15
- package/dist/utils/versioning.js.map +1 -1
- package/package.json +26 -5
- package/.claude/settings.local.json +0 -35
- package/.github/actions/calculate-version/action.yml +0 -106
- package/.github/actions/create-pr/action.yml +0 -122
- package/.github/actions/create-release/action.yml +0 -74
- package/.github/actions/create-tag/action.yml +0 -94
- package/.github/actions/detect-changes/action.yml +0 -62
- package/.github/actions/manage-branch/action.yml +0 -113
- package/.github/actions/promote-branch/action.yml +0 -352
- package/.github/example/workflows/job.analyze.code.yml +0 -26
- package/.github/example/workflows/job.analyze.docker.yml +0 -32
- package/.github/example/workflows/job.app.api.deploy.yml +0 -127
- package/.github/example/workflows/job.app.api.test.yml +0 -102
- package/.github/example/workflows/job.app.docs.deploy.yml +0 -40
- package/.github/example/workflows/job.app.docs.test.yml +0 -50
- package/.github/example/workflows/job.app.web.deploy.yml +0 -96
- package/.github/example/workflows/job.app.web.test.yml +0 -49
- package/.github/example/workflows/job.changes.yml +0 -82
- package/.github/example/workflows/job.create-pr.yml +0 -96
- package/.github/example/workflows/job.env-check.yml +0 -43
- package/.github/example/workflows/job.fast-forward.yml +0 -103
- package/.github/example/workflows/job.lint.yml +0 -64
- package/.github/example/workflows/job.pr-name.yml +0 -70
- package/.github/example/workflows/job.pr-squash-name.yml +0 -27
- package/.github/example/workflows/job.tag.yml +0 -38
- package/.github/example/workflows/job.version.yml +0 -99
- package/.github/example/workflows/lib.plugin-base.publish.yml +0 -59
- package/.github/example/workflows/pipe.yml +0 -178
- package/.github/example/workflows/scripts/fastforward.sh +0 -51
- package/.github/example/workflows/scripts/pipe-cleaner.sh +0 -70
- package/.github/scripts/fastforward.sh +0 -51
- package/.github/scripts/pipe-cleaner.sh +0 -70
- package/.github/workflows/pipeline.yml +0 -220
- package/.github/workflows/pr-title-check.yml +0 -70
- package/.github/workflows/publish.yml +0 -39
- package/.pipecraftrc.json +0 -78
- package/.release-it.cjs +0 -71
- package/PIPELINE_TESTING_PLAN.md +0 -499
- package/TRUNK_FLOW_PLAN.md +0 -401
- package/assets/logo_banner.png +0 -0
- package/assets/logo_banner.webp +0 -0
- package/docs/USER_JOURNEY_ERRORS.md +0 -352
- package/eslint.config.js +0 -77
- package/examples/basic-config.json +0 -41
- package/examples/monorepo-config.json +0 -49
- package/examples/usage.md +0 -289
- package/scripts/debug-workflows.sh +0 -339
- package/scripts/parse-pipeline.js +0 -29
- package/scripts/test-job-order.cjs +0 -140
- package/scripts/validate-pipeline.cjs +0 -379
- package/scripts/verify-job-order.sh +0 -30
- package/src/cli/index.ts +0 -414
- package/src/generators/init.tpl.ts +0 -126
- package/src/generators/workflows.tpl.ts +0 -80
- package/src/templates/actions/calculate-version.yml.tpl.ts +0 -124
- package/src/templates/actions/create-pr.yml.tpl.ts +0 -147
- package/src/templates/actions/create-tag.yml.tpl.ts +0 -112
- package/src/templates/actions/detect-changes.yml.tpl.ts +0 -87
- package/src/templates/actions/manage-branch.yml.tpl.ts +0 -132
- package/src/templates/actions/promote-branch.yml.tpl.ts +0 -364
- package/src/templates/workflows/pipeline-path-based.yml.tpl.ts +0 -706
- package/src/types/index.ts +0 -64
- package/src/utils/README-ast-path-operations.md +0 -390
- package/src/utils/ast-path-operations.ts +0 -581
- package/src/utils/config.ts +0 -64
- package/src/utils/github-setup.ts +0 -558
- package/src/utils/idempotency.ts +0 -215
- package/src/utils/preflight.ts +0 -306
- package/src/utils/versioning.ts +0 -244
- package/tests/README.md +0 -229
- package/tests/TEST_STRUCTURE.md +0 -256
- package/tests/act/run-act-tests.sh +0 -345
- package/tests/debugging/debug-utils.ts +0 -538
- package/tests/debugging/debug-workflow.test.ts +0 -339
- package/tests/debugging/debug-workflows.sh +0 -339
- package/tests/debugging/iterative-debug.ts +0 -652
- package/tests/debugging/run-debug-tests.sh +0 -431
- package/tests/fixtures/basic-config.json +0 -51
- package/tests/fixtures/invalid-config.json +0 -9
- package/tests/fixtures/pipeline-generated.yml +0 -235
- package/tests/fixtures/pipeline-preserve-comments.yml +0 -245
- package/tests/fixtures/pipeline-user-modified.yml +0 -245
- package/tests/fixtures/test-config.json +0 -58
- package/tests/github-live/README.md +0 -250
- package/tests/github-local/JOB_WORKFLOW_TESTS.md +0 -296
- package/tests/github-local/README.md +0 -240
- package/tests/github-local/run-all-tests.sh +0 -422
- package/tests/github-local/test-job-workflows.sh +0 -631
- package/tests/github-local/test-pipeline-workflow.sh +0 -440
- package/tests/integration/generators.test.ts +0 -578
- package/tests/integration/path-based-template.test.ts +0 -510
- package/tests/integration/simple-path-based.test.ts +0 -415
- package/tests/setup.ts +0 -56
- package/tests/unit/ast-path-operations-extended.test.ts +0 -302
- package/tests/unit/cli.test.ts +0 -541
- package/tests/unit/config-extended.test.ts +0 -412
- package/tests/unit/config.test.ts +0 -152
- package/tests/unit/github-setup.test.ts +0 -189
- package/tests/unit/idempotency-isolated.test.ts +0 -297
- package/tests/unit/job-order.test.ts +0 -157
- package/tests/unit/pipeline-path-based.test.ts +0 -511
- package/tests/unit/validate-pipeline.test.ts +0 -384
- package/tests/unit/versioning-extended.test.ts +0 -279
- package/tests/unit/versioning.test.ts +0 -241
- package/tsconfig.debug.json +0 -17
- package/tsconfig.json +0 -28
- package/vitest.config.ts +0 -51
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
name: "PR Title Format Check"
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request_target:
|
|
5
|
-
types:
|
|
6
|
-
- opened
|
|
7
|
-
- edited
|
|
8
|
-
- synchronize
|
|
9
|
-
- reopened
|
|
10
|
-
pull_request:
|
|
11
|
-
types:
|
|
12
|
-
- opened
|
|
13
|
-
- edited
|
|
14
|
-
- synchronize
|
|
15
|
-
- reopened
|
|
16
|
-
|
|
17
|
-
permissions:
|
|
18
|
-
pull-requests: read
|
|
19
|
-
|
|
20
|
-
jobs:
|
|
21
|
-
main:
|
|
22
|
-
name: Validate PR title
|
|
23
|
-
runs-on: ubuntu-latest
|
|
24
|
-
steps:
|
|
25
|
-
- uses: amannn/action-semantic-pull-request@v5
|
|
26
|
-
id: lint_pr_title
|
|
27
|
-
env:
|
|
28
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
29
|
-
with:
|
|
30
|
-
# Configure which types are allowed (newline-delimited).
|
|
31
|
-
# Default: https://github.com/commitizen/conventional-commit-types
|
|
32
|
-
types: |
|
|
33
|
-
fix
|
|
34
|
-
feat
|
|
35
|
-
docs
|
|
36
|
-
style
|
|
37
|
-
chore
|
|
38
|
-
refactor
|
|
39
|
-
perf
|
|
40
|
-
test
|
|
41
|
-
ci
|
|
42
|
-
build
|
|
43
|
-
revert
|
|
44
|
-
major
|
|
45
|
-
requireScope: false
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- uses: marocchino/sticky-pull-request-comment@v2
|
|
49
|
-
# When the previous steps fails, the workflow would stop. By adding this
|
|
50
|
-
# condition you can continue the execution with the populated error message.
|
|
51
|
-
if: always() && (steps.lint_pr_title.outputs.error_message != null)
|
|
52
|
-
with:
|
|
53
|
-
header: pr-title-lint-error
|
|
54
|
-
message: |
|
|
55
|
-
Hey there and thank you for opening this pull request! 👋🏼
|
|
56
|
-
|
|
57
|
-
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
|
|
58
|
-
|
|
59
|
-
Details:
|
|
60
|
-
|
|
61
|
-
```
|
|
62
|
-
${{ steps.lint_pr_title.outputs.error_message }}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
# Delete a previous comment when the issue has been resolved
|
|
66
|
-
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
|
|
67
|
-
uses: marocchino/sticky-pull-request-comment@v2
|
|
68
|
-
with:
|
|
69
|
-
header: pr-title-lint-error
|
|
70
|
-
delete: true
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
name: Publish to npm
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
release:
|
|
5
|
-
types: [published]
|
|
6
|
-
workflow_dispatch:
|
|
7
|
-
inputs:
|
|
8
|
-
tag:
|
|
9
|
-
description: 'Release tag to publish (e.g., v1.2.3)'
|
|
10
|
-
required: true
|
|
11
|
-
type: string
|
|
12
|
-
|
|
13
|
-
permissions:
|
|
14
|
-
contents: read
|
|
15
|
-
id-token: write # Required for OIDC
|
|
16
|
-
|
|
17
|
-
jobs:
|
|
18
|
-
publish:
|
|
19
|
-
runs-on: ubuntu-latest
|
|
20
|
-
steps:
|
|
21
|
-
- uses: actions/checkout@v4
|
|
22
|
-
with:
|
|
23
|
-
ref: ${{ github.event.release.tag_name || inputs.tag }}
|
|
24
|
-
|
|
25
|
-
- uses: actions/setup-node@v4
|
|
26
|
-
with:
|
|
27
|
-
node-version: 22
|
|
28
|
-
registry-url: 'https://registry.npmjs.org'
|
|
29
|
-
|
|
30
|
-
- name: Install dependencies
|
|
31
|
-
run: npm ci
|
|
32
|
-
|
|
33
|
-
- name: Build package
|
|
34
|
-
run: npm run build
|
|
35
|
-
|
|
36
|
-
- name: Publish to npm
|
|
37
|
-
run: npm publish --provenance --access public
|
|
38
|
-
env:
|
|
39
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.pipecraftrc.json
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"ciProvider": "github",
|
|
3
|
-
"mergeStrategy": "fast-forward",
|
|
4
|
-
"requireConventionalCommits": true,
|
|
5
|
-
"initialBranch": "develop",
|
|
6
|
-
"finalBranch": "main",
|
|
7
|
-
"branchFlow": [
|
|
8
|
-
"develop",
|
|
9
|
-
"staging",
|
|
10
|
-
"main"
|
|
11
|
-
],
|
|
12
|
-
"autoMerge": {
|
|
13
|
-
"staging": true,
|
|
14
|
-
"main": true
|
|
15
|
-
},
|
|
16
|
-
"semver": {
|
|
17
|
-
"bumpRules": {
|
|
18
|
-
"feat": "minor",
|
|
19
|
-
"fix": "patch",
|
|
20
|
-
"breaking": "major"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"actions": {
|
|
24
|
-
"onDevelopMerge": [
|
|
25
|
-
"runTests",
|
|
26
|
-
"fastForwardToStaging"
|
|
27
|
-
],
|
|
28
|
-
"onStagingMerge": [
|
|
29
|
-
"runTests",
|
|
30
|
-
"calculateVersion",
|
|
31
|
-
"createOrFastForwardToMain"
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
"domains": {
|
|
35
|
-
"core": {
|
|
36
|
-
"paths": [
|
|
37
|
-
"src/**"
|
|
38
|
-
],
|
|
39
|
-
"test": true,
|
|
40
|
-
"deploy": true,
|
|
41
|
-
"remoteTest": true,
|
|
42
|
-
"description": "PipeCraft core changes"
|
|
43
|
-
},
|
|
44
|
-
"test": {
|
|
45
|
-
"paths": [
|
|
46
|
-
"tests/**"
|
|
47
|
-
],
|
|
48
|
-
"test": true,
|
|
49
|
-
"description": "PipeCraft test changes"
|
|
50
|
-
},
|
|
51
|
-
"cicd": {
|
|
52
|
-
"paths": [
|
|
53
|
-
".github/**"
|
|
54
|
-
],
|
|
55
|
-
"test": true,
|
|
56
|
-
"description": "PipeCraft CI/CD changes"
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
"versioning": {
|
|
60
|
-
"enabled": true,
|
|
61
|
-
"releaseItConfig": ".release-it.cjs",
|
|
62
|
-
"conventionalCommits": true,
|
|
63
|
-
"autoTag": true,
|
|
64
|
-
"autoPush": false,
|
|
65
|
-
"changelog": true,
|
|
66
|
-
"bumpRules": {
|
|
67
|
-
"feat": "minor",
|
|
68
|
-
"fix": "patch",
|
|
69
|
-
"breaking": "major"
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
"rebuild": {
|
|
73
|
-
"enabled": true,
|
|
74
|
-
"skipIfUnchanged": true,
|
|
75
|
-
"forceRegenerate": false,
|
|
76
|
-
"cacheFile": ".pipecraft-cache.json"
|
|
77
|
-
}
|
|
78
|
-
}
|
package/.release-it.cjs
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
"git": {
|
|
3
|
-
"requireCleanWorkingDir": false,
|
|
4
|
-
"commit": false,
|
|
5
|
-
"pushArgs": ["--tags"],
|
|
6
|
-
"tagMatch": "v[0-9]*.[0-9]*.[0-9]*" // Required to exclude non-versioning tags
|
|
7
|
-
},
|
|
8
|
-
"github": {
|
|
9
|
-
"release": true,
|
|
10
|
-
"releaseName": "Release ${version}"
|
|
11
|
-
},
|
|
12
|
-
"npm": {
|
|
13
|
-
"ignoreVersion": true,
|
|
14
|
-
"publish": false,
|
|
15
|
-
"skipChecks": true
|
|
16
|
-
},
|
|
17
|
-
"hooks": {
|
|
18
|
-
"after:release": "echo ${version} > .release-version"
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"plugins": {
|
|
23
|
-
"@release-it/conventional-changelog": {
|
|
24
|
-
"whatBump": (commits,options)=>{
|
|
25
|
-
let defaults = {
|
|
26
|
-
test: 'ignore',
|
|
27
|
-
build: 'ignore',
|
|
28
|
-
|
|
29
|
-
ci: 'patch',
|
|
30
|
-
docs: 'patch',
|
|
31
|
-
chore: 'minor',
|
|
32
|
-
style: 'patch',
|
|
33
|
-
fix: 'patch',
|
|
34
|
-
perf: 'patch',
|
|
35
|
-
refactor: 'patch',
|
|
36
|
-
|
|
37
|
-
feat: 'minor',
|
|
38
|
-
major: 'major',
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
let types = (options?.preset?.types || [])
|
|
42
|
-
.reduce((a, v) => {
|
|
43
|
-
return { ...a, [v.type]: v.release}
|
|
44
|
-
}, {})
|
|
45
|
-
|
|
46
|
-
types = Object.assign({},defaults,types)
|
|
47
|
-
let breakings = 0
|
|
48
|
-
let features = 0
|
|
49
|
-
let levelSet = ['major','minor','patch','ignore']
|
|
50
|
-
let level = Math.min.apply(Math, commits.map(commit => {
|
|
51
|
-
let level = levelSet.indexOf(types[commit.type])
|
|
52
|
-
level = level<0?3:level
|
|
53
|
-
if (commit.notes.length > 0) {
|
|
54
|
-
breakings += commit.notes.length
|
|
55
|
-
}
|
|
56
|
-
if(commit.type === 'feat'){
|
|
57
|
-
features += 1;
|
|
58
|
-
}
|
|
59
|
-
return level
|
|
60
|
-
}))
|
|
61
|
-
return {
|
|
62
|
-
level: level,
|
|
63
|
-
reason: breakings === 1
|
|
64
|
-
? `There is ${breakings} BREAKING CHANGE and ${features} features`
|
|
65
|
-
: `There are ${breakings} BREAKING CHANGES and ${features} features`
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|