Skip to content

Commit

Permalink
700 local clasp (google#702)
Browse files Browse the repository at this point in the history
* 2.1.0

* Low impact changes (google#619)

* dependencies clean-up

* types for child_process' spawnSync

* types for child_process' spawnSync + options fix

* linting

* Relative rootdir (google#620)

* relative rootDir support

* relative rootDir support (untrackedFiles behavior changed)

* relative rootDir doc changes

* Cleanup before next pr (google#621)

* prettier + sort imports

* splitLines types

* unused package 'connect'

* ucfirst, isOnline types

* ellipsize types

* redundant package 'fs-copy-file-sync'

* removing extra line

* // TODO

* packages dependencies update

* comment fix

* fixes

* nicer ellipsize typing

* better?

* Refactor `inquirer` package (google#622)

* regroup `inquirer` into a single file

* fix typo

* linting

* switch to `find-up`

* switch to `find-up` & `strip-bom`

* dependencies update

* findUp implementation fix

* enum accessor fix

* fs-extra & typescript dependency fix

* linting

* dependencies clean-up (again)

* non any cast

* minor edits

* local calsp & minor edits

* moving local clasp to own doc

* npm audit fix

Co-authored-by: Grant Timmerman <granttimmerman@gmail.com>
  • Loading branch information
PopGoesTheWza and grant authored Jan 13, 2020
1 parent fffdcea commit 29bac44
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 23 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ First download `clasp`:

```sh
npm install -g @google/clasp
# Alternatively: sudo npm i -g grpc @google/clasp --unsafe-perm
# Alternatively: sudo npm install -g grpc @google/clasp --unsafe-perm
```

Then enable the Google Apps Script API: https://script.google.com/home/usersettings
Expand Down Expand Up @@ -519,12 +519,19 @@ Specifies the files that should be pushed first, useful for scripts that rely on

## Troubleshooting

### Node Version
### NodeJS Version

The library requires **Node version >= 8.2.1**. Use this script to check your version and **upgrade Node if necessary**:
The library requires **NodeJS version >= 8.2.1**.

You can check your version of NodeJS with this command.

```sh
node -v
```

You can use these commands to upgrade NodeJS if necessary (**not on Windows**):

```sh
node -v # Check Node version
npm install -g npm # Update npm and npx
npx n latest # use the n package to update node
```
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ This folder contains advanced guides for `clasp`.

- [Develop clasp](/docs/develop.md): Build, Run, and Test the CLI.
- [Run](/docs/run.md): Execute Apps Script remotely with `clasp run`.
- [Running loaclly](/docs/running-locally.md): Install and use clasp as a local dependency.
- [Settings](/docs/settings.md): Set up JSON autocompletion and `.gs` syntax highlighting.
- [TypeScript](/docs/typescript.md): Learn how to develop Apps Script in TypeScript.
4 changes: 2 additions & 2 deletions docs/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ You can develop and test `clasp` on your computer by following these steps.
### After Making a Change

```sh
npm run build;
npm run build
clasp <command>
```

#### Build Errors?

If you're seeing build errors, try deleting `node_modules` and building `clasp` from scratch:
If you're seeing build errors, try deleting the local `node_modules` and re-building `clasp` from scratch:

```sh
rm package-lock.json
Expand Down
31 changes: 31 additions & 0 deletions docs/running-locally.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Using clasp as a local dependency

Typically `clasp` is installed as a global package for convinience when using the command line.

Still there may be occassions when you want a project to use a specific version of `clasp` (i.e. to prevent potential breaking changes in future version)

This can be achieved by simply adding clasp as a local dependency and a fixed version

```sh
npm install --save-exact @google/clasp
```

Optionally, you can specify an older version.

```sh
npm install --save-exact @google/clasp@1.7.0
```

After this, any npm scripts using `clasp`will use the **local** version

```json
"scripts": {
"push-project1": "cd src/GasProject1 && clasp push",
},
```

From the command line, within your project, use the `npx` tool in order to use the **local** version of `clasp` rather than any global one.

```sh
npx clasp --version
```
26 changes: 9 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 29bac44

Please sign in to comment.