diff --git a/.clasp.json b/.clasp.json
index 941378d..2e69d42 100644
--- a/.clasp.json
+++ b/.clasp.json
@@ -1,4 +1,4 @@
{
"rootDir": "dist",
- "scriptId": "...paste scriptId here..."
+ "scriptId": "...add scriptId here..."
}
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 0000000..8dafe48
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,3 @@
+{
+ "parser": "babel-eslint"
+}
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 0000000..4fd0219
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1 @@
+engine-strict=true
\ No newline at end of file
diff --git a/.nvmrc b/.nvmrc
new file mode 100644
index 0000000..b009dfb
--- /dev/null
+++ b/.nvmrc
@@ -0,0 +1 @@
+lts/*
diff --git a/.prettierrc.json b/.prettierrc
similarity index 100%
rename from .prettierrc.json
rename to .prettierrc
diff --git a/README.md b/README.md
index d5452bb..3b11ee9 100644
--- a/README.md
+++ b/README.md
@@ -1,164 +1,132 @@
+
-## React + Google Apps Script
-*Use this demo project as your boilerplate React app for HTML dialogs in Google Sheets, Docs and Forms.*
+# React & Google Apps Script
+_Use this project as your boilerplate for React apps inside Google Sheets, Docs and Forms dialogs._
-This project uses labnol's excellent [apps-script-starter](https://github.com/labnol/apps-script-starter) as a starting point, adding support for React. It demonstrates how easy it is to build React apps that interact with Google Apps server-side scripts. Simply clone this project and modify the source code to get started developing with React for Google Apps Script client-side dialogs.
+This project uses labnol's excellent [apps-script-starter](https://github.com/labnol/apps-script-starter) as a starting point for developing server-side projects, and adds support for building React apps inside Google Sheets, Forms, and Docs dialogs. Simply clone this project and modify the source code to get started developing React apps with Google Apps Script.
-
-*The demo app for Google Sheets shows insertion/deletion/activation of sheets through React-built HTML dialog.*
+
+_The included demo React app for Google Sheets shows insertion, deletion and selection of sheets through the dialog window._
+
+
## Installation
-
+1. Clone the sample project and install dependencies:
+ ```bash
+ > git clone https://github.com/enuchi/React-Google-Apps-Script.git
+ > cd React-Google-Apps-Script
+ > npm install
+ ```
+2. Enable the Google Apps Script API for your account by visiting[(script.google.com/home/usersettings)](https://script.google.com/home/usersettings):
- 1. Clone the sample project and install dependencies:
- ```
- > git clone https://github.com/enuchi/React-Google-Apps-Script.git
- > cd React-Google-Apps-Script
- > npm install
- ```
- 2. Enable the Google Apps Script API [(script.google.com/home/usersettings)](https://script.google.com/home/usersettings):
-
+
-3. Log in to `clasp` to manage your Google Apps Scripts from the command line:
- ```
- > npm run login
- ```
-4. Create a new Google Sheets file and a bound Google Scripts project for your React project:
- ```
- > npm run setup
- Created new Google Sheet: https://drive.google.com/open?id=1lVQUPZ*************************************
- Created new Google Sheets Add-on script: https://script.google.com/d/1K7MPtCH*************************************-**/edit
- ```
- You've created a new Sheet and attached Script file! (But they're still empty for now.) See the notes below if you want to use an existing Google Sheet and Script instead of creating a new one.
-5. Build the app and deploy!
- ```
- > npm run deploy
- ```
- You can now visit your Google Sheet and see your new React app.
+3. Log in to `clasp`:
+ ```bash
+ > npm run login
+ ```
+ This will use `clasp` to manage your login credentials. `clasp` is [Google's tool](https://github.com/google/clasp) that helps you develop and manage Apps Script projects locally.
+4. Run the setup command to generate a new Google Sheets spreadsheet and bound Google Scripts project for your React project:
+
+ ```bash
+ > npm run setup
+
+ Created new Google Sheet: https://drive.google.com/open?id=1lVQUPZ*************************************
+ Created new Google Sheets Add-on script: https://script.google.com/d/1K7MPtCH*************************************-**/edit
+ ```
+
+ This will use `clasp` to create the new files, and save the project's ID to the `.clasp.json` file in your root directory. If you don't want to create a new spreadsheet and script, and instead want to use this React project with an existing project, [see the section below](#Using-an-existing-Sheet).
+
+ Okay, now you've created a new sheet and bound script project! (But they're still empty for now.)
+
+5. Deploy the app with the command below:
+ ```bash
+ > npm run deploy
+ ```
+ This will build and push your code to your script project. Open the new spreadsheet in Google Sheets and your new React app will be available from the menu bar!
### Using an existing Sheet
-The above installation instructions create a new Google Sheets spreadsheet and 'bound' Apps Script, and saves the credentials to a `.clasp.json` file in the root directory. If you want to use an existing sheet's script file, then simply copy the scriptId into the `.clasp.json` file as below. You can find the script's scriptId by opening your sheet, selecting **Tools > Script Editor**, then **File > Project properties**.
-Paste the `scriptId` into the `.clasp.json` file. *Make sure to include `"rootDir": "dist"` in this file:
-```
-// .clasp.json
-{"rootDir": "dist", "scriptId":"...paste scriptId here..."}
-```
+If you want to use an existing google script for your project:
+
+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**.
+
+2. Run the command below using your project's `scriptId`:
+
+ ```bash
+ # If your scriptId is 1K7MPtCHkjasdf93238234asdKFDF3sa9 then run
+ > npm run setup:use-id 1K7MPtCHkjasdf93238234asdKFDF3sa9
+ ```
+
+ This command will add the existing project's `scriptId` to your`.clasp.json` file. (You can also just edit the `.clasp.json` file directly. Make sure not to remove `"rootDir": "dist"` from the `.clasp.json` file.)
+
### Making changes to the code
-Modify the server-side and client-side source code in the `src` folder using ES6/7 and React. Change the scopes in `appsscript.json` if needed. When you're ready, build the app and deploy! You can run `npm run deploy` to build and deploy, or `npm run build` just to build the bundled files in the `./dist` directory.
+Modify the server-side and client-side source code in the `src` folder. [Add any additional scopes](https://developers.google.com/apps-script/concepts/scopes) to `appsscript.json` as needed. When you're ready, build the app and deploy! You can run `npm run deploy` to build and deploy, or `npm run build` just to build the bundled files in the `./dist` directory.
## The sample app
+
Insert/activate/delete sheets through a simple HTML dialog, built with React. Access the dialog through the new menu item that appears. You may need to refresh the spreadsheet and approve the app's permissions the first time you use it.
-## How it works
-"[Google Apps Script](https://en.wikipedia.org/wiki/Google_Apps_Script) is based on JavaScript 1.6 with some portions of 1.7 and 1.8 and provides subset of ECMAScript 5 API."
-
-That means many JavaScript tools used today in modern web development will not work in the Google Apps Script environment, including `let`/`const` declarations, arrow functions, spread operator, etc.
-
-This project circumvents those restrictions by transpiling newer code to older code that Google Apps Script understands using Babel, and also bundles separate files and modules using Webpack.
-
-On the client-side, Google Apps Scripts has restrictions on the way HTML dialogs are used. While in normal web development you can simply reference a separate css file, e.g.
-```
-
-```
-in the Google Apps Script environment you need to use [HTML templates](https://developers.google.com/apps-script/guides/html/templates), which can be cumbersome to work with. With this project, all files are bundled together by inlining .css and .js files. Using a transpiler and bundling tool also allows us to use JSX syntax, and external libraries such as React.
-
## Features
-- Support for JSX syntax:
-```
-return