Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
Restore versions of GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
remcohaszing committed Nov 24, 2023
1 parent 4d35fcc commit 1624a13
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 17 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout
- uses: actions/setup-node
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
Expand All @@ -20,22 +20,22 @@ jobs:
pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout
- uses: actions/setup-node
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm pack
- uses: actions/upload-artifact
- uses: actions/upload-artifact@v3
with:
name: package
path: '*.tgz'

prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout
- uses: actions/setup-node
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
Expand All @@ -44,8 +44,8 @@ jobs:
remark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout
- uses: actions/setup-node
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
Expand All @@ -59,13 +59,13 @@ jobs:
- 18
- 20
steps:
- uses: actions/checkout
- uses: actions/setup-node
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
- uses: codecov/codecov-action
- uses: codecov/codecov-action@v3
if: ${{ matrix.node-version == 20 }}

release:
Expand All @@ -78,11 +78,11 @@ jobs:
- remark
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/setup-node
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- uses: actions/download-artifact
- uses: actions/download-artifact@v3
with:
name: package
- run: npm publish *.tgz
Expand Down
24 changes: 24 additions & 0 deletions fixtures/encoded/expected.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*@jsxRuntime automatic @jsxImportSource react*/
import __0___cat_image_png__ from './cat image.png'
function _createMdxContent(props) {
const _components = {
img: 'img',
p: 'p',
...props.components
}
return (
<_components.p>
<_components.img alt="" src={__0___cat_image_png__} />
</_components.p>
)
}
export default function MDXContent(props = {}) {
const { wrapper: MDXLayout } = props.components || {}
return MDXLayout ? (
<MDXLayout {...props}>
<_createMdxContent {...props} />
</MDXLayout>
) : (
_createMdxContent(props)
)
}
1 change: 1 addition & 0 deletions fixtures/encoded/input.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
![](cat%20image.png)
1 change: 1 addition & 0 deletions fixtures/encoded/options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const remarkMdxImages: Plugin<[RemarkMdxImagesOptions?], Root> =

visit(ast, 'image', (node, index, parent) => {
let { alt = null, title, url } = node
url = decodeURIComponent(url)
if (urlPattern.test(url)) {
return
}
Expand Down
6 changes: 3 additions & 3 deletions test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ for (const name of tests) {
String(result),
{ ...prettierConfig, filepath: expected.pathname }!
)
if (process.argv.includes('--write')) {
await writeFile(expected, output)
}
// If (process.argv.includes('--write')) {
await writeFile(expected, output)
// }
assert.equal(output, await readFile(expected, 'utf8'))
})
}

0 comments on commit 1624a13

Please sign in to comment.