You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* update to @google/[email protected]
- Add npm run open command
- Update readme to explain how to add existing script and document which works with npm run open
- Remove npm run setup:use-id command
Copy file name to clipboardExpand all lines: README.md
+36-32
Original file line number
Diff line number
Diff line change
@@ -104,17 +104,21 @@ Alternatively, you can use an existing Google Spreadsheet and Script file instea
104
104
<details>
105
105
<summary>See instructions here for using an existing project.</summary>
106
106
107
-
1. Copy your existing script project's `scriptId`. You can find it by opening your spreadsheet, selecting **Tools > Script Editor** from the menubar, then **File > Project properties**.
108
-
109
-
2. Run the command below using your project's `scriptId`:
107
+
You will need to update the `.clasp.json` file in the root of this project with the following three key/value pairs:
-`scriptId`: Your existing script project's `scriptId`. You can find it by opening your spreadsheet, selecting **Tools > Script Editor** from the menubar, then **File > Project properties**, and it will be listed as "Script ID".
114
118
115
-
This command will add the existing project's `scriptId` to your`.clasp.json` file. See [here](https://github.com/google/clasp#setting) for working with `clasp`.
119
+
-`parentId`: An array with a single string, the ID of the parent file (spreadsheet, doc, etc.) that the script project is bound to. You can get this ID from the url, where the format is usually `https://docs.google.com/spreadsheets/d/{id}/edit`. This allows you to run `npm run open` and open your file directly from the command line.
-`rootDir`: This should always be `"./dist"`, i.e. the local build folder that is used to store project files.
118
122
119
123
</details>
120
124
@@ -132,7 +136,7 @@ npm run deploy
132
136
133
137
The deploy command will build all necessary files using production settings, including all server code (Google Apps Script code), client code (React bundle), and config files. All bundled files will be outputted to the `dist/` folder, then pushed to the Google Apps Script project.
134
138
135
-
Now open Google Sheets and navigate to your new spreadsheet (e.g. the file "My React Project"). Make sure to refresh the page if you already had it open. You will now see a new menu item appear containing your app!
139
+
Now open Google Sheets and navigate to your new spreadsheet (e.g. the file "My React Project"). You can also run `npm run open`. Make sure to refresh the page if you already had it open. You will now see a new menu item appear containing your app!
The start command will create and deploy a development build, and serve your local files.
181
185
@@ -200,17 +204,17 @@ You will need to use the "standalone" version of React DevTools since our React
200
204
201
205
1. In your repo install the React DevTools package as a dev dependency:
202
206
203
-
```bash
204
-
npm install -D react-devtools
205
-
```
207
+
```bash
208
+
npm install -D react-devtools
209
+
```
206
210
207
211
2. In a new terminal window run `npx react-devtools` to launch the DevTools standalone app.
208
212
209
213
3. Add `<script src="http://localhost:8097"></script>` to the top of your `<head>` in your React app, e.g. in the [index.html](https://github.com/enuchi/React-Google-Apps-Script/blob/e73e51e56e99903885ef8dd5525986f99038d8bf/src/client/dialog-demo-bootstrap/index.html) file in the sample Bootstrap app.
210
214
211
215
4. Deploy your app (`npm run deploy:dev`) and you should see DevTools tool running and displaying your app hierarchy.
0 commit comments