Skip to content

The open alternative to Salesforce, designed for AI.

2.6 KB
Raw Blame
---
title: フロントエンドコマンド
---

## 便利なコマンド

### アプリの開始

```bash
npx nx start twenty-front
```

### APIのGraphQLスキーマに基づいてGraphQLスキーマを再生成する

```bash
npx nx run twenty-front:graphql:generate --configuration=metadata
```

または

```bash
npx nx run twenty-front:graphql:generate
```

### リント

```bash
npx nx run twenty-front:lint # pass --fix to fix lint errors
```

## 翻訳

```bash
npx nx run twenty-front:lingui:extract
npx nx run twenty-front:lingui:compile
```

### テスト

```bash
npx nx run twenty-front:test # run jest tests
npx nx run twenty-front:storybook:serve:dev # run storybook
npx nx run twenty-front:storybook:test # run tests # (needs yarn storybook:serve:dev to be running)
npx nx run twenty-front:storybook:coverage # (needs yarn storybook:serve:dev to be running)
```

## 技術スタック

プロジェクトは、最小限のボイラープレートコードを持つシンプルでクリーンなスタックを持っています。

**アプリ**

* [React](https://react.dev/)
* [Apollo](https://www.apollographql.com/docs/)
* [GraphQL Codegen](https://the-guild.dev/graphql/codegen)
* [Jotai](https://jotai.org/)
* [TypeScript](https://www.typescriptlang.org/)

**テスト**

* [Jest](https://jestjs.io/)
* [Storybook](https://storybook.js.org/)

**ツール**

* [Yarn](https://yarnpkg.com/)
* [Craco](https://craco.js.org/docs/)
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)

## アーキテクチャ

### ルーティング

[React Router](https://reactrouter.com/)はルーティングを処理します。

不要な [re-renders](/ja/developers/contribute/capabilities/frontend-development/best-practices-front#managing-re-renders) を避けるために、すべてのルーティングロジックは `PageChangeEffect` の `useEffect` にあります。

### 状態管理

[Jotai](https://jotai.org/)は状態管理を行います。

状態管理に関する詳細な情報は[ベストプラクティス](/ja/developers/contribute/capabilities/frontend-development/best-practices-front#state-management)を参照してください。

## テスト

[Jest](https://jestjs.io/)はユニットテストのツールであり、[Storybook](https://storybook.js.org/)はコンポーネントテスト用です。

Jestは主にユーティリティ関数のテスト用で、コンポーネントのテスト自体ではありません。

Storybookは、独立したコンポーネントの挙動をテストし、デザインシステムを表示するためのものです。