Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update to latest astro(4.5) #93

Merged
merged 5 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
version: 1.0.14
version: 1.0.30
- name: Install dependencies
run: bun i --no-save
- name: Install Playwright Browsers
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ echo "MICROCMS_API_KEY=${microcmsのAPI Key}" >> ./.env
pnpm run dev
```

`http://localhost:3000`にアクセス
`http://localhost:4321`にアクセス

## ご意見・質問など

Expand Down
5 changes: 4 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from "astro/config";
import { defineConfig, passthroughImageService } from "astro/config";

import tailwind from "@astrojs/tailwind";

Expand All @@ -19,4 +19,7 @@ export default defineConfig({
build: {
inlineStylesheets: "auto",
},
image: {
service: passthroughImageService(),
},
});
Binary file modified bun.lockb
Binary file not shown.
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/cloudflare": "^6.6.2",
"@astrojs/tailwind": "^4.0.0",
"astro": "^2.9.7",
"microcms-js-sdk": "^2.5.0",
"tailwindcss": "^3.3.3"
"@astrojs/cloudflare": "^9.1.0",
"@astrojs/tailwind": "^5.1.0",
"astro": "4.5",
"microcms-js-sdk": "^3.0.0",
"tailwindcss": "^3.3.3",
"typescript-eslint": "^7.2.0"
},
"devDependencies": {
"@playwright/test": "^1.36.2",
"@tailwindcss/typography": "^0.5.9",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@types/bun": "^1.0.8",
"eslint": "^8.46.0",
"eslint-config-prettier": "^8.9.0",
"eslint-config-standard-with-typescript": "^35.0.0",
"eslint-plugin-astro": "^0.27.2",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-astro": "^0.31.4",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.1.1",
"prettier": "^2.8.8",
"prettier-plugin-astro": "^0.10.0",
"typescript": "^5.1.6"
"prettier": "^3.2.5",
"prettier-plugin-astro": "^0.13.0",
"typescript": "^5.4.2"
}
}
6 changes: 3 additions & 3 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ const config: PlaywrightTestConfig = {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0,
/* 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",
},
/* start server when running the testing script */
webServer: {
command: "bun --bun run start",
url: "http://localhost:3000/",
command: "bun run start",
url: "http://localhost:4321/",
reuseExistingServer: !process.env.CI,
},

Expand Down
23 changes: 12 additions & 11 deletions src/library/postFetcher.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import { createClient, MicroCMSQueries } from "microcms-js-sdk";
import { createClient } from "microcms-js-sdk";
import type { MicroCMSQueries } from "microcms-js-sdk";
const client = createClient({
serviceDomain: import.meta.env.MICROCMS_SERVICE_DOMAIN,
apiKey: import.meta.env.MICROCMS_API_KEY,
serviceDomain: process.env.MICROCMS_SERVICE_DOMAIN as string,
apiKey: process.env.MICROCMS_API_KEY as string,
});

type Category = {
interface Category {
id: string;
createdAt: string;
updatedAt: string;
publishedAt: string;
revisedAt: string;
name: string;
};
type Eyecatch = {
}
interface Eyecatch {
url: string;
height: number;
width: number;
};
export type Post = {
}
export interface Post {
id: string;
createdAt: string;
updatedAt: string;
Expand All @@ -28,13 +29,13 @@ export type Post = {
category: Category;
content: string;
description: string;
};
export type PostResponse = {
}
export interface PostResponse {
totalCount: number;
offset: number;
limit: number;
contents: Post[];
};
}

/**
* 記事を複数件取得する
Expand Down
2 changes: 1 addition & 1 deletion src/test/topPageTest.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect } from "@playwright/test";

test("test", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.goto("http://localhost:4321/");
await page
.getByRole("link", {
name: "2022年12月19日 初めての投稿~このブログを作った経緯~ このブログの初めての投稿です。このブログを作った経緯とか、これから何に使うのかとかについて説明しています。今後ともよろしくお願いします。",
Expand Down
Loading