Skip to content

Commit

Permalink
Upgrade Astro to v3 (#3)
Browse files Browse the repository at this point in the history
* Upgrade Astro to v3

* Upgrade other packages

* Change default port

* Fix image url with scheme
  • Loading branch information
narze authored Sep 2, 2023
1 parent 46dbefd commit 59c40ef
Show file tree
Hide file tree
Showing 5 changed files with 1,005 additions and 870 deletions.
8 changes: 4 additions & 4 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ function prependImageSrcPlugin() {
return (tree) => {
function visit(node) {
if (node.type === "image" && node.url) {
node.url = `/images/${node.url}`
// if node.url does not have scheme, prepend with /images/
if (!node.url.startsWith("http")) {
node.url = `/images/${node.url}`
}
}
if (node.children) {
node.children.forEach(visit)
Expand All @@ -32,7 +35,4 @@ export default defineConfig({
markdown: {
remarkPlugins: [prependImageSrcPlugin],
},
experimental: {
viewTransitions: true,
},
})
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,35 @@
"lint": "eslint 'src/**/*.{ts,svelte,astro}'"
},
"dependencies": {
"@astrojs/mdx": "^0.19.7",
"@astrojs/rss": "^2.4.3",
"@astrojs/sitemap": "^2.0.1",
"@astrojs/svelte": "^3.1.0",
"@astrojs/tailwind": "^4.0.0",
"astro": "^2.9.7",
"@astrojs/mdx": "^1.0.0",
"@astrojs/rss": "^3.0.0",
"@astrojs/sitemap": "^3.0.0",
"@astrojs/svelte": "^4.0.0",
"@astrojs/tailwind": "^5.0.0",
"astro": "^3.0.7",
"tailwindcss": "^3.3.3"
},
"devDependencies": {
"@giscus/svelte": "^2.3.0",
"@playwright/test": "^1.36.2",
"@playwright/test": "^1.37.1",
"@tailwindcss/typography": "^0.5.9",
"@types/tar": "^6.1.5",
"@typescript-eslint/parser": "^6.2.1",
"@typescript-eslint/parser": "^6.5.0",
"chokidar": "^3.5.3",
"eslint": "^8.46.0",
"eslint-plugin-astro": "^0.28.0",
"eslint-plugin-svelte": "^2.32.4",
"glob": "^10.3.3",
"eslint": "^8.48.0",
"eslint-plugin-astro": "^0.29.0",
"eslint-plugin-svelte": "^2.33.0",
"glob": "^10.3.4",
"gray-matter": "^4.0.3",
"npm-run-all": "^4.1.5",
"octokit": "^3.1.0",
"pagefind": "^0.12.0",
"remark": "^14.0.3",
"remark-frontmatter": "^4.0.1",
"rimraf": "^5.0.1",
"svelte": "^4.1.2",
"svelte": "^4.2.0",
"tar": "^6.1.15",
"tsx": "^3.12.7",
"tsx": "^3.12.8",
"unist-util-visit": "^5.0.0"
}
}
4 changes: 2 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://localhost:3000",
baseURL: "http://localhost:4321",

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
Expand Down Expand Up @@ -71,7 +71,7 @@ export default defineConfig({
/* Run preview server before starting the tests */
webServer: {
command: "npm run preview",
url: "http://localhost:3000",
url: "http://localhost:4321",
reuseExistingServer: !process.env.CI,
},
})
Loading

0 comments on commit 59c40ef

Please sign in to comment.