Skip to content

Commit

Permalink
ADd client and server README.jp.md
Browse files Browse the repository at this point in the history
  • Loading branch information
YukiFujisawa committed Oct 1, 2022
1 parent a08237e commit 9076e0d
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/client/README.jp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Client (React アプリのソースコード)

このディレクトリは、クライアント側の React アプリのソースコードを保存する場所です。

アプリは複数のダイアログ ウィンドウを開くメニュー項目を作成するため、ここには複数のディレクトリがあります。 各ダイアログは個別のアプリを開くため、ここの各ディレクトリは独自の個別の React アプリを表します。 webpack 構成は、React アプリごとに個別のバンドルを生成します。

## 要件

以下、React アプリごとに必要になります。:

- アプリをロードするエントリポイント`index.js`ファイル
- バンドルされた React アプリを読み込むためのテンプレート HTML ファイル

[webpack.config.js](../../webpack.config.js) で次のように宣言する必要があります。

- **name**: webpack コンソールに出力する名前です。例:`CLIENT - Dialog Demo`
- **entry**: アプリのエントリ ポイントへのパス。例:`./src/client/dialog-demo/index.js`
- **filename**: 生成される html ファイルの名前。 サーバー コードはこのファイル名を参照して、アプリをダイアログ ウィンドウに読み込みます。例:`dialog-demo`
- **template**: アプリの HTML テンプレートへのパス。 例:`./src/client/dialog-demo/index.html`

### エントリポイントの追加または削除

Your app or use case may only require a single dialog or sidebar, or you may want to add more than are included in the sample app.

アプリまたはユースケースで必要なダイアログまたはサイドバーは、1 つだけの場合もあれば、サンプルアプリに含まれている以上のダイアログ、サイドバーを追加したい場合もあります。

エントリポイントを編集するには、次のことを行う必要があります:

1. Create or remove the entrypoint directories in the client source code. For instance, you can remove `./src/client/sidebar-about-page` altogether, or copy it and modify the source code. See above [requirements](#requirements).

クライアントのソースコードで、エントリポイントディレクトリを作成または削除します。 たとえば、`./src/client/sidebar-about-page`を削除したり、コピーしてソースコードを変更したりできます。 上記の [要件](#要件) を参照してください。

2. Modify the server-side code to load the correct menu items and expose the correct public functions:

3. サーバー側のコードを変更して、正しいメニュー項目をロードし、正しい public 関数を公開します。

- [ui file](../server/ui.js)
- [index file](../server/index.js)

4. [webpack 設定ファイル](../../webpack.config.js)`clientEntrypoints` 構成を変更します。
23 changes: 23 additions & 0 deletions src/server/README.jp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Server (our Google Apps Script code)

このディレクトリは、Google サーバーで実行される Google Apps Script のコードを保存する場所です。

## Requirements

サーバーコードには次のものが必要です。

- アプリをロードするエントリポイント(`index.ts`という名前のファイル)。
- 以下のようにエントリポイントで、public 関数を`import``export`する必要があります。

```javascript
import { someFunction } from './ui';
export { someFunction };
```

[ui.js](./ui.js)ファイルを参照すると、メニューにメニュー項目を追加する方法、開発設定を適切に設定する方法がわかります。

## ビルド

ここのサーバー側コードは、[v8 ランタイム](https://developers.google.com/apps-script/guides/v8-runtime) と互換性のある設定を使用してコンパイルされます。

設定(権限設定、ランタイムなど)を切り替える場合は、[appsscript.json](../../appsscript.json)ファイルを更新してください。

0 comments on commit 9076e0d

Please sign in to comment.