Skip to content

Commit

Permalink
fix: migrate to newer action (#3)
Browse files Browse the repository at this point in the history
- migrate to newer supported action
- provide local just command to initiate release PRs from local
workstation
- Since this is a single package repo; when making git tags for
releases, don't include component name
  • Loading branch information
airtonix authored Nov 13, 2024
1 parent bb5b946 commit f768220
Show file tree
Hide file tree
Showing 9 changed files with 1,171 additions and 232 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ jobs:
releases_created: ${{ steps.release-please.outputs.releases_created }}
prs_created: ${{ steps.release-please.outputs.prs_created }}
steps:
- uses: google-github-actions/release-please-action@v4
- uses: googleapis/release-please-action@d1a8f221d7723166f48a584aebba00ef3f6febec # v4.1.4
id: release-please
with:
token: ${{secrets.RELEASE_PLEASE_TOKEN}}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
- name: Print Release Data
run: |
echo 'Release Data:'
Expand Down
Binary file modified .yarn/install-state.gz
Binary file not shown.
16 changes: 16 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,19 @@ docs:
publish TAG="next":
yarn npm publish \
--tag "{{TAG}}"

release TAG="":
#!/bin/bash
args=()
tag="{{TAG}}"

# if tag is provided then use arg --release-as
if [ -n "$tag" ]; then
args+=(--release-as "$tag")
fi

release-please release-pr \
--token $(gh auth token) \
--defaultBranch master \
--repo-url $(git remote get-url origin) \
"${args[@]}"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"open": "^10.1.0",
"prettier": "^3.2.2",
"puppeteer": "^22.11.2",
"release-please": "^16.14.4",
"remark": "15.0.1",
"ts-node": "10.9.1",
"tslib": "^2.3.0",
Expand Down
20 changes: 10 additions & 10 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"release-type": "node",
"tag-separator": "@",
"include-component-in-tag": true,
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"packages": {
".": {
"package-name": "@zenobius/remark-nomnoml"
}
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"release-type": "node",
"tag-separator": "@",
"include-component-in-tag": false,
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"packages": {
".": {
"package-name": "@zenobius/remark-nomnoml"
}
}
}
99 changes: 0 additions & 99 deletions src/__snapshots__/core-remark-nomnoml.spec.ts.snap

This file was deleted.

99 changes: 0 additions & 99 deletions src/__snapshots__/remark-nomnoml.spec.ts.snap

This file was deleted.

39 changes: 24 additions & 15 deletions src/remark-nomnoml.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,48 @@ import { remarkNomnoml } from './remark-nomnoml';
test.each([
{
name: 'simple',
wordsToSearch: ['Decorator pattern', 'Component', 'operation()'],
diagram:
'```nomnoml\n[<frame>Decorator pattern|Component||+ operation()]\n```',
},
{
name: 'simple with error',
diagram: '```nomnoml\n ] >```\n',
wordsToSearch: [],
invalid: true,
},
{
name: 'class diagram',
wordsToSearch: ['Decorator pattern', 'Component', 'operation()'],
diagram:
'```nomnoml\n[<frame>Decorator pattern|Component||+ operation()]\n```',
},
])('render nomnoml diagram: $name', async ({ diagram, invalid }) => {
const processor = remark();
processor.use(remarkNomnoml);
])(
'render nomnoml diagram: $name',
async ({ diagram, invalid, wordsToSearch }) => {
const processor = remark();
processor.use(remarkNomnoml);

const file = new VFile(diagram);
const file = new VFile(diagram);

if (invalid) {
await expect(() => {
return processor.process(file);
}).rejects.toThrow();
return;
}
if (invalid) {
await expect(() => {
return processor.process(file);
}).rejects.toThrow();
return;
}

expect(file.messages).toHaveLength(0);
expect(file.messages).toHaveLength(0);

await processor.process(file);
await processor.process(file);

expect(file.messages).toHaveLength(0);
expect(file.value).toMatchSnapshot();
});
expect(file.messages).toHaveLength(0);

for (const word of wordsToSearch) {
expect(file.toString()).toContain(word);
}
},
);

test('it should throw a vfile error if a diagram is invalid without error fallback', async () => {
const processor = remark().use(remarkNomnoml);
Expand Down
Loading

0 comments on commit f768220

Please sign in to comment.