Skip to content

Commit fad7a4e

Browse files
committed
WIP: new weibsite with astro
1 parent 867dff2 commit fad7a4e

Some content is hidden

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

50 files changed

+1837
-3076
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ typings/
8989
# next.js build output
9090
.next
9191

92-
lib
9392
dist
9493
.npmrc
9594
*.tsbuildinfo

docs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
website/src/content/docs

examples/next-with-app-dir/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
},
1111
"dependencies": {
1212
"@orgajs/next": "workspace:^",
13-
"@types/node": "20.1.0",
14-
"@types/react": "18.2.0",
15-
"@types/react-dom": "18.2.1",
16-
"eslint": "8.39.0",
17-
"eslint-config-next": "13.3.4",
18-
"next": "13.3.2",
13+
"@types/node": "20.2.1",
14+
"@types/react": "18.2.6",
15+
"@types/react-dom": "18.2.4",
16+
"eslint": "8.41.0",
17+
"eslint-config-next": "13.4.3",
18+
"next": "13.4.3",
1919
"react": "^18.2.0",
2020
"react-dom": "^18.2.0",
2121
"rehype-pretty-code": "^0.9.5",

examples/next/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"@orgajs/loader": "workspace:^",
1212
"@orgajs/next": "workspace:^",
1313
"@orgajs/react": "workspace:^",
14-
"eslint-config-next": "^13.4.1",
15-
"next": "^13.4.1",
14+
"eslint-config-next": "^13.4.3",
15+
"next": "^13.4.3",
1616
"react": "^18.2.0",
1717
"react-dom": "^18.2.0"
1818
},

examples/webpack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"babel-loader": "^9.1.2",
1717
"react": "^18.2.0",
1818
"react-dom": "^18.2.0",
19-
"webpack": "^5.82.0",
19+
"webpack": "^5.83.1",
2020
"webpack-cli": "^5.0.2",
2121
"webpack-dev-server": "^4.13.3"
2222
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"chalk": "^4.1.0",
1212
"cross-env": "^7.0.3",
1313
"del-cli": "^3.0.1",
14-
"eslint": "^8.40.0",
14+
"eslint": "^8.41.0",
1515
"eslint-config-prettier": "^8.8.0",
1616
"eslint-import-resolver-typescript": "^3.5.5",
1717
"eslint-plugin-import": "^2.27.5",

packages/astro/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
"@orgajs/rollup": "workspace:^"
2424
},
2525
"devDependencies": {
26-
"astro": "^2.4.1"
26+
"astro": "^2.5.0"
2727
}
2828
}

packages/gatsby-plugin-orga/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
"@types/estree": "^1.0.1",
4545
"@types/estree-jsx": "^1.0.0",
4646
"@types/fs-extra": "^9.0.12",
47-
"@types/node": "^20.1.0",
48-
"@types/react": "^17.0.20",
49-
"@types/react-dom": "^17.0.9",
47+
"@types/node": "^20.2.1",
48+
"@types/react": "^18.2.6",
49+
"@types/react-dom": "^18.2.4",
5050
"@types/unist": "2.0.6",
5151
"del-cli": "^3.0.1",
5252
"gatsby": "^3.14.3",

packages/gatsby-transformer-orga/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"devDependencies": {
4242
"@types/fs-extra": "^9.0.12",
4343
"@types/lodash": "^4.14.172",
44-
"@types/node": "^20.1.0",
44+
"@types/node": "^20.2.1",
4545
"@types/unist": "2.0.6",
4646
"gatsby": "^3.14.3"
4747
}

packages/loader/lib/index.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* @typedef {import('webpack').LoaderContext<unknown>} LoaderContext
3+
*/
4+
import { createProcessor } from '@orgajs/orgx'
5+
import path from 'path'
6+
7+
/**
8+
* @param {string} source
9+
* @param {LoaderContext['callback']} callback
10+
* @this {LoaderContext}
11+
*/
12+
export async function loader(source, callback) {
13+
const processor = createProcessor({
14+
development: this.mode === 'development',
15+
...this.getOptions(),
16+
})
17+
18+
try {
19+
const file = await processor.process({
20+
value: source,
21+
path: this.resourcePath,
22+
})
23+
callback(null, file.value, file.map)
24+
} catch (error) {
25+
const fpath = path.relative(this.context, this.resourcePath)
26+
error.message = `${fpath}:${error.name}: ${error.message}`
27+
callback(error)
28+
}
29+
}

0 commit comments

Comments
 (0)