Skip to content

Commit 27fc312

Browse files
authored
Merge pull request #16 from contentlayerdev/changesets
WIP 0.0.28
2 parents c168a1b + b543361 commit 27fc312

File tree

72 files changed

+3639
-2259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+3639
-2259
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@1.6.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"linked": [["@contentlayer/*", "contentlayer", "next-contentlayer"]],
6+
"access": "public",
7+
"baseBranch": "main",
8+
"updateInternalDependencies": "patch",
9+
"ignore": ["examples-*"]
10+
}

.github/workflows/ci.yml

Lines changed: 11 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -12,49 +12,29 @@ jobs:
1212
os: [ubuntu-latest]
1313
runs-on: ${{ matrix.os }}
1414
steps:
15-
- uses: actions/checkout@v2
16-
with:
17-
submodules: true
18-
- uses: actions/setup-node@v1
19-
with:
20-
node-version: ${{ matrix.node-version }}
21-
cache: yarn
22-
- run: yarn install
15+
- uses: schickling-actions/checkout-and-install@main
2316
- run: yarn lint:check
2417

2518
test:
2619
strategy:
2720
matrix:
2821
node-version: [16.x]
22+
# Note tests are currently not run in Windows because the path seperator on Windows invalidates the test results 🙈
2923
os: [ubuntu-latest]
3024
runs-on: ${{ matrix.os }}
3125
steps:
32-
- uses: actions/checkout@v2
33-
with:
34-
submodules: true
35-
- uses: actions/setup-node@v2
36-
with:
37-
node-version: ${{ matrix.node-version }}
38-
cache: yarn
39-
- run: yarn install
26+
- uses: schickling-actions/checkout-and-install@main
4027
- run: yarn build
4128
- run: yarn test
4229

4330
build-example-starter:
4431
strategy:
4532
matrix:
4633
node-version: [16.x]
47-
os: [ubuntu-latest]
34+
os: [ubuntu-latest, windows-latest]
4835
runs-on: ${{ matrix.os }}
4936
steps:
50-
- uses: actions/checkout@v2
51-
with:
52-
submodules: true
53-
- uses: actions/setup-node@v2
54-
with:
55-
node-version: ${{ matrix.node-version }}
56-
cache: yarn
57-
- run: yarn install
37+
- uses: schickling-actions/checkout-and-install@main
5838
- run: yarn build
5939
- run: yarn build
6040
working-directory: examples/starter
@@ -63,17 +43,10 @@ jobs:
6343
strategy:
6444
matrix:
6545
node-version: [16.x]
66-
os: [ubuntu-latest]
46+
os: [ubuntu-latest, windows-latest]
6747
runs-on: ${{ matrix.os }}
6848
steps:
69-
- uses: actions/checkout@v2
70-
with:
71-
submodules: true
72-
- uses: actions/setup-node@v2
73-
with:
74-
node-version: ${{ matrix.node-version }}
75-
cache: yarn
76-
- run: yarn install
49+
- uses: schickling-actions/checkout-and-install@main
7750
- run: yarn build
7851
- run: yarn build
7952
working-directory: examples/playground-azimuth
@@ -82,17 +55,10 @@ jobs:
8255
strategy:
8356
matrix:
8457
node-version: [16.x]
85-
os: [ubuntu-latest]
58+
os: [ubuntu-latest, windows-latest]
8659
runs-on: ${{ matrix.os }}
8760
steps:
88-
- uses: actions/checkout@v2
89-
with:
90-
submodules: true
91-
- uses: actions/setup-node@v2
92-
with:
93-
node-version: ${{ matrix.node-version }}
94-
cache: yarn
95-
- run: yarn install
61+
- uses: schickling-actions/checkout-and-install@main
9662
- run: yarn build
9763
- run: yarn build
9864
working-directory: examples/gatsby-docs
@@ -101,17 +67,10 @@ jobs:
10167
strategy:
10268
matrix:
10369
node-version: [16.x]
104-
os: [ubuntu-latest]
70+
os: [ubuntu-latest, windows-latest]
10571
runs-on: ${{ matrix.os }}
10672
steps:
107-
- uses: actions/checkout@v2
108-
with:
109-
submodules: true
110-
- uses: actions/setup-node@v2
111-
with:
112-
node-version: ${{ matrix.node-version }}
113-
cache: yarn
114-
- run: yarn install
73+
- uses: schickling-actions/checkout-and-install@main
11574
- run: yarn build
11675
- run: yarn build
11776
working-directory: examples/mdx

examples/gatsby-docs/contentlayer.config.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
// import rehypeShiki from '@leafac/rehype-shiki'
2-
// import { createRequire } from 'module'
1+
import rehypeShiki from '@stefanprobst/rehype-shiki'
2+
3+
import { createRequire } from 'module'
34
import { defineDocumentType, makeSource, defineNestedType, FieldDef } from 'contentlayer/source-files'
4-
// import * as path from 'path'
5-
// import * as shiki from 'shiki'
5+
import * as path from 'path'
6+
import * as shiki from 'shiki'
67

78
const Example = defineNestedType(() => ({
89
name: 'Example',
@@ -55,22 +56,19 @@ const Tutorial = defineDocumentType(() => ({
5556
}))
5657

5758
export default makeSource(async () => {
58-
// TODO re-enable once this is fixed https://github.com/leafac/rehype-shiki/issues/2
59-
60-
// const require = createRequire(import.meta.url)
61-
// const shikiPath = (dir: string) => path.join(require.resolve('shiki'), '..', '..', dir, path.sep)
62-
// const highlighter = await shiki.getHighlighter({
63-
// paths: { languages: shikiPath('languages'), themes: shikiPath('themes') },
64-
// theme: 'github-light',
65-
// })
59+
const require = createRequire(import.meta.url)
60+
const shikiPkgPath = (dir: string) => path.join(require.resolve('shiki'), '..', '..', dir, path.sep)
61+
const highlighter = await shiki.getHighlighter({
62+
paths: { languages: shikiPkgPath('languages'), themes: shikiPkgPath('themes') },
63+
theme: 'github-light',
64+
})
6665

6766
return {
6867
contentDirPath: 'gatsby/docs',
69-
// contentDirPath: path.join(process.cwd(), 'gatsby', 'docs'),
7068
documentTypes: [Reference, HowTo, Conceptual, Tutorial],
7169
onUnknownDocuments: 'skip-ignore',
7270
markdown: {
73-
// rehypePlugins: [[rehypeShiki as any, { highlighter }]],
71+
rehypePlugins: [[rehypeShiki, { highlighter }]],
7472
},
7573
}
7674
})

examples/gatsby-docs/gatsby

Submodule gatsby updated 849 files

examples/gatsby-docs/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@
77
"start": "next start"
88
},
99
"dependencies": {
10-
"next": "^11.1.2",
10+
"next": "^12.0.2",
1111
"react": "^17.0.2",
1212
"react-dom": "^17.0.2"
1313
},
1414
"devDependencies": {
1515
"@leafac/rehype-shiki": "^1.3.1",
16+
"@stefanprobst/rehype-shiki": "^2.0.4",
1617
"@types/react": "^17.0.21",
1718
"@types/react-dom": "^17.0.9",
1819
"contentlayer": "workspace:*",
1920
"eslint-config-next": "^11.0.1",
2021
"next-contentlayer": "workspace:*",
2122
"shiki": "^0.9.4",
22-
"typescript": "^4.4.3"
23+
"typescript": "^4.4.4"
2324
}
24-
}
25+
}

examples/mdx/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Usage
2+
3+
```sh
4+
curl https://codeload.github.com/contentlayerdev/contentlayer/tar.gz/main | \
5+
tar -xz --strip=2 contentlayer-main/examples/mdx
6+
```
File renamed without changes.

0 commit comments

Comments
 (0)