doc-detective 3.4.1 → 3.5.0-dev.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/.github/FUNDING.yml +14 -14
- package/.github/dependabot.yml +11 -11
- package/.github/workflows/auto-dev-release.yml +173 -173
- package/.github/workflows/npm-test.yaml +96 -96
- package/.github/workflows/update-core.yaml +131 -131
- package/CONTRIBUTIONS.md +27 -27
- package/LICENSE +661 -661
- package/README.md +110 -110
- package/dev/dev.config.json +8 -8
- package/dev/dev.spec.json +30 -30
- package/dev/index.js +5 -5
- package/package.json +47 -47
- package/samples/.doc-detective.json +94 -94
- package/samples/doc-content-detect.md +10 -10
- package/samples/doc-content-inline-tests.md +23 -23
- package/samples/docker-hello.spec.json +15 -15
- package/samples/env +2 -2
- package/samples/http.spec.yaml +37 -37
- package/samples/kitten-search-detect.md +7 -7
- package/samples/kitten-search-inline.md +15 -15
- package/samples/kitten-search.spec.json +28 -28
- package/samples/local-gui.md +5 -5
- package/samples/tests.spec.json +70 -70
- package/samples/variables.env +4 -4
- package/scripts/bump-sync-version-core.js +110 -108
- package/src/checkDependencies.js +84 -84
- package/src/index.js +72 -72
- package/src/utils.js +1023 -1023
- package/test/artifacts/cleanup.spec.json +18 -18
- package/test/artifacts/config.json +6 -6
- package/test/artifacts/doc-content.md +23 -23
- package/test/artifacts/env +2 -2
- package/test/artifacts/httpRequest.spec.yaml +37 -37
- package/test/artifacts/runShell.spec.json +29 -29
- package/test/artifacts/setup.spec.json +18 -18
- package/test/artifacts/test.spec.json +46 -46
- package/test/resolvedTests.test.js +193 -193
- package/test/runTests.test.js +53 -53
- package/test/server/index.js +185 -185
- package/test/server/public/index.html +174 -174
- package/test/test-config.json +12 -12
- package/test/test-results.json +124 -124
- package/test/utils.test.js +298 -298
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
name: Update doc-detective-core version
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
repository_dispatch:
|
|
5
|
-
types:
|
|
6
|
-
- update-core-package-event
|
|
7
|
-
workflow_dispatch:
|
|
8
|
-
inputs:
|
|
9
|
-
version:
|
|
10
|
-
description: 'The doc-detective-core version.'
|
|
11
|
-
required: false
|
|
12
|
-
default: 'latest'
|
|
13
|
-
|
|
14
|
-
jobs:
|
|
15
|
-
update:
|
|
16
|
-
timeout-minutes: 10
|
|
17
|
-
permissions:
|
|
18
|
-
contents: write
|
|
19
|
-
runs-on: ubuntu-latest
|
|
20
|
-
steps:
|
|
21
|
-
- name: Checkout code
|
|
22
|
-
uses: actions/checkout@v4
|
|
23
|
-
with:
|
|
24
|
-
token: ${{ secrets.DD_DEP_UPDATE_TOKEN }}
|
|
25
|
-
|
|
26
|
-
- name: Set version variable
|
|
27
|
-
id: version
|
|
28
|
-
run: |
|
|
29
|
-
VERSION="${{ github.event.client_payload.version || github.event.inputs.version || 'latest' }}"
|
|
30
|
-
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
31
|
-
echo "Using version: $VERSION"
|
|
32
|
-
|
|
33
|
-
- name: Configure Git
|
|
34
|
-
run: |
|
|
35
|
-
git config --local user.email "action@github.com"
|
|
36
|
-
git config --local user.name "GitHub Action"
|
|
37
|
-
|
|
38
|
-
- name: Get version of doc-detective-common from core
|
|
39
|
-
id: common_version
|
|
40
|
-
run: |
|
|
41
|
-
COMMON_VERSION=$(npm view doc-detective-core@${{ steps.version.outputs.version }} dependencies --json | jq -r '.["doc-detective-common"]')
|
|
42
|
-
echo "common_version=$COMMON_VERSION" >> $GITHUB_OUTPUT
|
|
43
|
-
|
|
44
|
-
- name: Install specific versions of doc-detective-core and doc-detective-common
|
|
45
|
-
run: |
|
|
46
|
-
npm install doc-detective-core@${{ steps.version.outputs.version }} doc-detective-common@${{ steps.common_version.outputs.common_version }} || {
|
|
47
|
-
echo "Failed to install doc-detective-core@${{ steps.version.outputs.version }} or doc-detective-common@${{ steps.common_version.outputs.common_version }}"
|
|
48
|
-
exit 1
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
- name: Test the installation
|
|
52
|
-
run: |
|
|
53
|
-
npm test
|
|
54
|
-
|
|
55
|
-
- name: Stage changes
|
|
56
|
-
id: stage
|
|
57
|
-
run: |
|
|
58
|
-
git add package.json package-lock.json
|
|
59
|
-
if git diff --staged --quiet; then
|
|
60
|
-
echo "No changes to commit"
|
|
61
|
-
echo "has_changes=false" >> $GITHUB_OUTPUT
|
|
62
|
-
else
|
|
63
|
-
echo "has_changes=true" >> $GITHUB_OUTPUT
|
|
64
|
-
fi
|
|
65
|
-
|
|
66
|
-
- name: Bump or sync version
|
|
67
|
-
id: patch
|
|
68
|
-
if: steps.stage.outputs.has_changes == 'true'
|
|
69
|
-
run: |
|
|
70
|
-
node scripts/bump-sync-version-core.js
|
|
71
|
-
version=$(node -p 'require("./package.json").version') && echo "version=$version" >> $GITHUB_OUTPUT
|
|
72
|
-
|
|
73
|
-
- name: Install GitHub CLI
|
|
74
|
-
if: steps.stage.outputs.has_changes == 'true'
|
|
75
|
-
# Install GitHub CLI for fetching PRs and release notes
|
|
76
|
-
run: |
|
|
77
|
-
sudo apt-get update && sudo apt-get install -y gh jq
|
|
78
|
-
|
|
79
|
-
- name: Gather merged PRs since last release
|
|
80
|
-
id: merged_prs
|
|
81
|
-
run: |
|
|
82
|
-
# Get previous tag (before the new one)
|
|
83
|
-
PREV_TAG=$(git tag --sort=-creatordate | grep -v "v${{ steps.patch.outputs.version }}" | head -n1)
|
|
84
|
-
CURR_TAG="v${{ steps.patch.outputs.version }}"
|
|
85
|
-
echo "Previous tag: $PREV_TAG, Current tag: $CURR_TAG"
|
|
86
|
-
if [ -z "$PREV_TAG" ]; then
|
|
87
|
-
echo "No previous tag found. Skipping PR list."
|
|
88
|
-
echo "prs=No previous release found." >> $GITHUB_OUTPUT
|
|
89
|
-
else
|
|
90
|
-
PRS=$(gh pr list --state merged --search "merged:>=$(git log -1 --format=%aI $PREV_TAG)" --json number,title,url --jq '.[] | "- [#\(.number)](\(.url)): \(.title)"')
|
|
91
|
-
if [ -z "$PRS" ]; then
|
|
92
|
-
PRS=""
|
|
93
|
-
fi
|
|
94
|
-
echo "prs<<EOF" >> $GITHUB_OUTPUT
|
|
95
|
-
echo "$PRS" >> $GITHUB_OUTPUT
|
|
96
|
-
echo "EOF" >> $GITHUB_OUTPUT
|
|
97
|
-
fi
|
|
98
|
-
env:
|
|
99
|
-
GITHUB_TOKEN: ${{ secrets.DD_DEP_UPDATE_TOKEN }}
|
|
100
|
-
|
|
101
|
-
- name: Fetch doc-detective-core release notes
|
|
102
|
-
id: CORE_release
|
|
103
|
-
run: |
|
|
104
|
-
CORE_VERSION=${{ steps.version.outputs.version }}
|
|
105
|
-
# Remove ^ or ~ if present
|
|
106
|
-
CORE_VERSION_CLEAN=$(echo "$CORE_VERSION" | sed 's/^[^0-9]*//')
|
|
107
|
-
# Query GitHub API for release notes
|
|
108
|
-
RELEASE_INFO=$(gh release view "v$CORE_VERSION_CLEAN" --repo doc-detective/core --json body --jq .body || echo "No release notes found.")
|
|
109
|
-
echo "release_notes<<EOF" >> $GITHUB_OUTPUT
|
|
110
|
-
echo "$RELEASE_INFO" >> $GITHUB_OUTPUT
|
|
111
|
-
echo "EOF" >> $GITHUB_OUTPUT
|
|
112
|
-
env:
|
|
113
|
-
GITHUB_TOKEN: ${{ secrets.DD_DEP_UPDATE_TOKEN }}
|
|
114
|
-
|
|
115
|
-
- name: Create release with detailed notes
|
|
116
|
-
if: steps.stage.outputs.has_changes == 'true'
|
|
117
|
-
uses: softprops/action-gh-release@v2
|
|
118
|
-
with:
|
|
119
|
-
body: |
|
|
120
|
-
# What's new
|
|
121
|
-
|
|
122
|
-
- Updated doc-detective-core to v${{ steps.patch.outputs.version }}:
|
|
123
|
-
|
|
124
|
-
${{ steps.CORE_release.outputs.release_notes }}
|
|
125
|
-
|
|
126
|
-
${{ steps.merged_prs.outputs.prs }}
|
|
127
|
-
tag_name: "v${{ steps.patch.outputs.version }}"
|
|
128
|
-
name: "v${{ steps.patch.outputs.version }}"
|
|
129
|
-
generate_release_notes: false
|
|
130
|
-
token: ${{ secrets.DD_DEP_UPDATE_TOKEN }}
|
|
131
|
-
|
|
1
|
+
name: Update doc-detective-core version
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
repository_dispatch:
|
|
5
|
+
types:
|
|
6
|
+
- update-core-package-event
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
version:
|
|
10
|
+
description: 'The doc-detective-core version.'
|
|
11
|
+
required: false
|
|
12
|
+
default: 'latest'
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
update:
|
|
16
|
+
timeout-minutes: 10
|
|
17
|
+
permissions:
|
|
18
|
+
contents: write
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- name: Checkout code
|
|
22
|
+
uses: actions/checkout@v4
|
|
23
|
+
with:
|
|
24
|
+
token: ${{ secrets.DD_DEP_UPDATE_TOKEN }}
|
|
25
|
+
|
|
26
|
+
- name: Set version variable
|
|
27
|
+
id: version
|
|
28
|
+
run: |
|
|
29
|
+
VERSION="${{ github.event.client_payload.version || github.event.inputs.version || 'latest' }}"
|
|
30
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
31
|
+
echo "Using version: $VERSION"
|
|
32
|
+
|
|
33
|
+
- name: Configure Git
|
|
34
|
+
run: |
|
|
35
|
+
git config --local user.email "action@github.com"
|
|
36
|
+
git config --local user.name "GitHub Action"
|
|
37
|
+
|
|
38
|
+
- name: Get version of doc-detective-common from core
|
|
39
|
+
id: common_version
|
|
40
|
+
run: |
|
|
41
|
+
COMMON_VERSION=$(npm view doc-detective-core@${{ steps.version.outputs.version }} dependencies --json | jq -r '.["doc-detective-common"]')
|
|
42
|
+
echo "common_version=$COMMON_VERSION" >> $GITHUB_OUTPUT
|
|
43
|
+
|
|
44
|
+
- name: Install specific versions of doc-detective-core and doc-detective-common
|
|
45
|
+
run: |
|
|
46
|
+
npm install doc-detective-core@${{ steps.version.outputs.version }} doc-detective-common@${{ steps.common_version.outputs.common_version }} || {
|
|
47
|
+
echo "Failed to install doc-detective-core@${{ steps.version.outputs.version }} or doc-detective-common@${{ steps.common_version.outputs.common_version }}"
|
|
48
|
+
exit 1
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
- name: Test the installation
|
|
52
|
+
run: |
|
|
53
|
+
npm test
|
|
54
|
+
|
|
55
|
+
- name: Stage changes
|
|
56
|
+
id: stage
|
|
57
|
+
run: |
|
|
58
|
+
git add package.json package-lock.json
|
|
59
|
+
if git diff --staged --quiet; then
|
|
60
|
+
echo "No changes to commit"
|
|
61
|
+
echo "has_changes=false" >> $GITHUB_OUTPUT
|
|
62
|
+
else
|
|
63
|
+
echo "has_changes=true" >> $GITHUB_OUTPUT
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
- name: Bump or sync version
|
|
67
|
+
id: patch
|
|
68
|
+
if: steps.stage.outputs.has_changes == 'true'
|
|
69
|
+
run: |
|
|
70
|
+
node scripts/bump-sync-version-core.js
|
|
71
|
+
version=$(node -p 'require("./package.json").version') && echo "version=$version" >> $GITHUB_OUTPUT
|
|
72
|
+
|
|
73
|
+
- name: Install GitHub CLI
|
|
74
|
+
if: steps.stage.outputs.has_changes == 'true'
|
|
75
|
+
# Install GitHub CLI for fetching PRs and release notes
|
|
76
|
+
run: |
|
|
77
|
+
sudo apt-get update && sudo apt-get install -y gh jq
|
|
78
|
+
|
|
79
|
+
- name: Gather merged PRs since last release
|
|
80
|
+
id: merged_prs
|
|
81
|
+
run: |
|
|
82
|
+
# Get previous tag (before the new one)
|
|
83
|
+
PREV_TAG=$(git tag --sort=-creatordate | grep -v "v${{ steps.patch.outputs.version }}" | head -n1)
|
|
84
|
+
CURR_TAG="v${{ steps.patch.outputs.version }}"
|
|
85
|
+
echo "Previous tag: $PREV_TAG, Current tag: $CURR_TAG"
|
|
86
|
+
if [ -z "$PREV_TAG" ]; then
|
|
87
|
+
echo "No previous tag found. Skipping PR list."
|
|
88
|
+
echo "prs=No previous release found." >> $GITHUB_OUTPUT
|
|
89
|
+
else
|
|
90
|
+
PRS=$(gh pr list --state merged --search "merged:>=$(git log -1 --format=%aI $PREV_TAG)" --json number,title,url --jq '.[] | "- [#\(.number)](\(.url)): \(.title)"')
|
|
91
|
+
if [ -z "$PRS" ]; then
|
|
92
|
+
PRS=""
|
|
93
|
+
fi
|
|
94
|
+
echo "prs<<EOF" >> $GITHUB_OUTPUT
|
|
95
|
+
echo "$PRS" >> $GITHUB_OUTPUT
|
|
96
|
+
echo "EOF" >> $GITHUB_OUTPUT
|
|
97
|
+
fi
|
|
98
|
+
env:
|
|
99
|
+
GITHUB_TOKEN: ${{ secrets.DD_DEP_UPDATE_TOKEN }}
|
|
100
|
+
|
|
101
|
+
- name: Fetch doc-detective-core release notes
|
|
102
|
+
id: CORE_release
|
|
103
|
+
run: |
|
|
104
|
+
CORE_VERSION=${{ steps.version.outputs.version }}
|
|
105
|
+
# Remove ^ or ~ if present
|
|
106
|
+
CORE_VERSION_CLEAN=$(echo "$CORE_VERSION" | sed 's/^[^0-9]*//')
|
|
107
|
+
# Query GitHub API for release notes
|
|
108
|
+
RELEASE_INFO=$(gh release view "v$CORE_VERSION_CLEAN" --repo doc-detective/doc-detective-core --json body --jq .body || echo "No release notes found.")
|
|
109
|
+
echo "release_notes<<EOF" >> $GITHUB_OUTPUT
|
|
110
|
+
echo "$RELEASE_INFO" >> $GITHUB_OUTPUT
|
|
111
|
+
echo "EOF" >> $GITHUB_OUTPUT
|
|
112
|
+
env:
|
|
113
|
+
GITHUB_TOKEN: ${{ secrets.DD_DEP_UPDATE_TOKEN }}
|
|
114
|
+
|
|
115
|
+
- name: Create release with detailed notes
|
|
116
|
+
if: steps.stage.outputs.has_changes == 'true'
|
|
117
|
+
uses: softprops/action-gh-release@v2
|
|
118
|
+
with:
|
|
119
|
+
body: |
|
|
120
|
+
# What's new
|
|
121
|
+
|
|
122
|
+
- Updated doc-detective-core to v${{ steps.patch.outputs.version }}:
|
|
123
|
+
|
|
124
|
+
${{ steps.CORE_release.outputs.release_notes }}
|
|
125
|
+
|
|
126
|
+
${{ steps.merged_prs.outputs.prs }}
|
|
127
|
+
tag_name: "v${{ steps.patch.outputs.version }}"
|
|
128
|
+
name: "v${{ steps.patch.outputs.version }}"
|
|
129
|
+
generate_release_notes: false
|
|
130
|
+
token: ${{ secrets.DD_DEP_UPDATE_TOKEN }}
|
|
131
|
+
|
package/CONTRIBUTIONS.md
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
# How to contribute
|
|
2
|
-
|
|
3
|
-
`doc-detective` welcomes contributions of all sorts (as do all Doc Detective projects). If you can't contribute code, you can still help by reporting issues, suggesting new features, improving the documentation, or sponsoring the project. Please follow the guidelines below.
|
|
4
|
-
|
|
5
|
-
## Reporting issues
|
|
6
|
-
|
|
7
|
-
If you find a bug, report it on the [GitHub issue tracker](https://github.com/doc-detective/doc-detective/issues).
|
|
8
|
-
|
|
9
|
-
## Contributing code
|
|
10
|
-
|
|
11
|
-
To contribute code,
|
|
12
|
-
|
|
13
|
-
1. Fork the project.
|
|
14
|
-
2. Create a new branch.
|
|
15
|
-
3. Make your changes.
|
|
16
|
-
4. Submit a pull request to the `rc` (release candidate) branch.
|
|
17
|
-
5. Wait for your pull request to be reviewed.
|
|
18
|
-
6. Make any necessary changes to your pull request.
|
|
19
|
-
7. Your pull request will be merged once it has been reviewed and approved.
|
|
20
|
-
|
|
21
|
-
## License
|
|
22
|
-
|
|
23
|
-
By contributing to `doc-detective`, you agree that your contributions will be licensed under the [AGPL license](https://github.com/doc-detective/doc-detective/blob/main/LICENCE).
|
|
24
|
-
|
|
25
|
-
## Thank you
|
|
26
|
-
|
|
27
|
-
Thank you for your contributions! We appreciate your help in making the project better.
|
|
1
|
+
# How to contribute
|
|
2
|
+
|
|
3
|
+
`doc-detective` welcomes contributions of all sorts (as do all Doc Detective projects). If you can't contribute code, you can still help by reporting issues, suggesting new features, improving the documentation, or sponsoring the project. Please follow the guidelines below.
|
|
4
|
+
|
|
5
|
+
## Reporting issues
|
|
6
|
+
|
|
7
|
+
If you find a bug, report it on the [GitHub issue tracker](https://github.com/doc-detective/doc-detective/issues).
|
|
8
|
+
|
|
9
|
+
## Contributing code
|
|
10
|
+
|
|
11
|
+
To contribute code,
|
|
12
|
+
|
|
13
|
+
1. Fork the project.
|
|
14
|
+
2. Create a new branch.
|
|
15
|
+
3. Make your changes.
|
|
16
|
+
4. Submit a pull request to the `rc` (release candidate) branch.
|
|
17
|
+
5. Wait for your pull request to be reviewed.
|
|
18
|
+
6. Make any necessary changes to your pull request.
|
|
19
|
+
7. Your pull request will be merged once it has been reviewed and approved.
|
|
20
|
+
|
|
21
|
+
## License
|
|
22
|
+
|
|
23
|
+
By contributing to `doc-detective`, you agree that your contributions will be licensed under the [AGPL license](https://github.com/doc-detective/doc-detective/blob/main/LICENCE).
|
|
24
|
+
|
|
25
|
+
## Thank you
|
|
26
|
+
|
|
27
|
+
Thank you for your contributions! We appreciate your help in making the project better.
|