Skip to content

Commit 10d2f3f

Browse files
feat: upgrade Astro to v4, vite v5 and storyblok/astro v4 (#94)
Signed-off-by: Edvinas Jurele <[email protected]>
1 parent 20a0a71 commit 10d2f3f

File tree

10 files changed

+24603
-21382
lines changed

10 files changed

+24603
-21382
lines changed

demo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"try": "npm run build & npm run preview"
1313
},
1414
"dependencies": {
15-
"@storyblok/astro": "^3.0.1",
16-
"astro": "^3.2.3"
15+
"@storyblok/astro": "^4.0.0",
16+
"astro": "^4.0.6"
1717
},
1818
"stackblitz": {
1919
"startCommand": "npm run start-stackblitz"

demo/src/layouts/Layout.astro

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface Props {
66
const { title } = Astro.props;
77
---
88

9-
<!DOCTYPE html>
9+
<!doctype html>
1010
<html lang="en">
1111
<head>
1212
<meta charset="UTF-8" />
@@ -25,7 +25,14 @@ const { title } = Astro.props;
2525
background-color: #f6f6f6;
2626
}
2727
code {
28-
font-family: Menlo, Monaco, Lucida Console, Liberation Mono,
29-
DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace;
28+
font-family:
29+
Menlo,
30+
Monaco,
31+
Lucida Console,
32+
Liberation Mono,
33+
DejaVu Sans Mono,
34+
Bitstream Vera Sans Mono,
35+
Courier New,
36+
monospace;
3037
}
3138
</style>

lib/package.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
},
2020
"license": "MIT",
2121
"author": "Edvinas Jurele",
22+
"type": "module",
2223
"exports": {
2324
".": {
2425
"import": "./dist/index.mjs",
@@ -42,7 +43,7 @@
4243
"build": "vite build",
4344
"dev": "vite build --watch",
4445
"prepublishOnly": "npm run build && cp ../README.md ./",
45-
"test": "npm run test:unit && npm run lint && npm run ts:check",
46+
"test": "npm run test:unit && npm run ts:check",
4647
"test:unit": "vitest run",
4748
"test:watch": "vitest watch",
4849
"ts:check": "tsc"
@@ -52,16 +53,19 @@
5253
"@semantic-release/git": "^10.0.1",
5354
"@semantic-release/github": "^9.0.3",
5455
"@semantic-release/npm": "^10.0.4",
55-
"@storyblok/js": "^2.1.3",
56-
"astro": "^2.7.0",
56+
"@storyblok/js": "^3.0.0",
57+
"astro": "^4.0.6",
5758
"semantic-release": "^21.1.1",
58-
"vite": "^4.3.1",
59-
"vite-plugin-dts": "^2.3.0"
59+
"vite": "^5.0.10",
60+
"vite-plugin-dts": "^3.6.4"
6061
},
61-
"publishConfig": {
62-
"access": "public"
62+
"peerDependencies": {
63+
"astro": "^3.0.0 || ^4.0.0"
6364
},
6465
"volta": {
6566
"node": "18.12.1"
67+
},
68+
"publishConfig": {
69+
"access": "public"
6670
}
6771
}

lib/src/utils/resolveRichTextToNodes.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ describe("resolveMark", () => {
848848
blue: "this-is-blue",
849849
red: "this-is-red",
850850
pink: "this-is-pink",
851-
}[color]);
851+
})[color];
852852

853853
return {
854854
props: {

lib/src/utils/resolveRichTextToNodes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {
1+
import type {
22
ComponentNode,
33
Mark,
44
Options,

lib/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
"extends": "astro/tsconfigs/base",
99
"$schema": "https://json.schemastore.org/tsconfig",
1010
"include": ["./*.astro", "./**/*.ts"],
11-
"exclude": ["node_modules/*", "./vite-plugin-*.ts", "dist"]
11+
"exclude": ["node_modules/*", "./vite*.ts", "dist"]
1212
}

lib/vite.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export default defineConfig(() => {
1616
plugins: [
1717
dts({
1818
outputDir: "dist/types",
19-
skipDiagnostics: false,
2019
}) as unknown as Plugin,
2120
],
2221
};

0 commit comments

Comments
 (0)