-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from syakoo/develop
Develop
- Loading branch information
Showing
54 changed files
with
1,128 additions
and
557 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
NEXT_PUBLIC_API_BASE_PATH="http://localhost:8000" | ||
NEXT_PUBLIC_API_KEY="dummy-api-key" | ||
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID= | ||
API_ADMIN_PASS="dummy-admin-pass" | ||
ENABLE_BUILD_CONTENTS= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
name: "component" | ||
root: "." | ||
output: "./src/**/*" | ||
ignore: [] | ||
questions: | ||
name: "コンポーネント名を入力してください" | ||
--- | ||
|
||
# `{{ inputs.name | pascal }}/index.ts` | ||
|
||
```typescript | ||
export { {{ inputs.name | pascal }} } from "./{{ inputs.name | pascal }}"; | ||
``` | ||
|
||
# `{{ inputs.name | pascal }}/{{ inputs.name | pascal }}.tsx` | ||
|
||
```tsx | ||
type {{ inputs.name | pascal }}Props = { | ||
children: React.ReactNode; | ||
}; | ||
|
||
export const {{ inputs.name | pascal }}: React.FC<{{ inputs.name | pascal }}Props> = ({ children }) => { | ||
return <div>{children}</div>; | ||
}; | ||
|
||
``` | ||
|
||
# `{{ inputs.name | pascal }}/{{ inputs.name | pascal }}.css.ts` | ||
|
||
```typescript | ||
|
||
``` | ||
|
||
# `{{ inputs.name | pascal }}/{{ inputs.name | pascal }}.stories.tsx` | ||
|
||
```tsx | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { {{ inputs.name | pascal }} } from "."; | ||
|
||
const meta = { | ||
component: {{ inputs.name | pascal }}, | ||
parameters: { | ||
layout: "fullscreen", | ||
}, | ||
} satisfies Meta<typeof {{ inputs.name | pascal }}>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
export const Sample: Story = { | ||
args: { | ||
children: <div>children</div>, | ||
}, | ||
}; | ||
|
||
``` | ||
|
||
# `{{ inputs.name | pascal }}/{{ inputs.name | pascal }}.test.tsx` | ||
|
||
```tsx | ||
import { composeStories } from "@storybook/react"; | ||
import { act, render } from "@testing-library/react"; | ||
|
||
import * as stories from "./{{ inputs.name | pascal }}.stories"; | ||
|
||
const { ...otherStories } = composeStories(stories); | ||
|
||
describe("{{ inputs.name | pascal }}", () => { | ||
const testCases = Object.values(otherStories).map( | ||
(Story) => [Story.storyName, Story] as const, | ||
); | ||
test.each(testCases)("renders %s", async (_, Story) => { | ||
const tree = render(<Story />); | ||
await act(async () => { | ||
if (Story.play) { | ||
await Story.play({ canvasElement: tree.container }); | ||
} | ||
}); | ||
|
||
expect(tree.baseElement).toMatchSnapshot(); | ||
}); | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
files: ["*"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
--- | ||
name: "env" | ||
root: "." | ||
output: "." | ||
ignore: [] | ||
--- | ||
|
||
# `.env.local` | ||
|
||
```bash | ||
NEXT_PUBLIC_API_BASE_PATH="http://localhost:8000" | ||
NEXT_PUBLIC_API_KEY="dummy-api-key" | ||
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID= | ||
API_ADMIN_PASS= | ||
ENABLE_BUILD_CONTENTS= | ||
ENABLE_BUILD_CONTENTS= | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
name: "writing" | ||
root: "./src/contents/writings" | ||
output: "." | ||
ignore: [] | ||
questions: | ||
id: "id を入力してください: (例 20231118)" | ||
type: | ||
message: "writing の種類はどれですか?" | ||
choices: | ||
- "diary" | ||
- "note" | ||
- "article" | ||
initial: "note" | ||
index: | ||
confirm: "検索結果に表示しますか?" | ||
initial: false | ||
--- | ||
|
||
# `{{ inputs.id }}/index.mdx` | ||
|
||
```mdx | ||
--- | ||
id: "{{ inputs.id }}" | ||
type: "{{ inputs.type }}" | ||
title: "Sample Writing" | ||
published: "{{ date "YYYY-MM-DD" }}" | ||
{{ inputs.index ? "" : "noindex: true" }} | ||
tags: | ||
- "雑記" | ||
--- | ||
|
||
導入文 | ||
|
||
## Sample title | ||
|
||
本文 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.