Skip to content

Commit

Permalink
Merge branch 'master' into status_speedup
Browse files Browse the repository at this point in the history
  • Loading branch information
sqrrrl authored Jan 23, 2025
2 parents df7df1b + 214b1d7 commit 4c339b2
Show file tree
Hide file tree
Showing 32 changed files with 431 additions and 1,461 deletions.
6 changes: 6 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
# the shebang is ignored, but nice for editors

use flake .

dotenv_if_exists .env.local
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
build:
runs-on: ubuntu-latest
env:
SCRIPT_ID: 1EwE84eZCSBPcaAiJzCnDjmxMVnLQrDyhSKq1oZY6q-3x4BIDHgQefCnL
PROJECT_ID: project-id-3961473932623644264
SCRIPT_ID: ${{ vars.TEST_SCRIPT_ID }}
PROJECT_ID: ${{ vars.TEST_PROJECT_ID }}
strategy:
matrix:
node-version: [12]
node-version: [22]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## [2.5.0](https://github.com/google/clasp/compare/v2.4.2...v2.5.0) (2025-01-09)


### Features

* Add support for custom redirect port in clasp login ([#1020](https://github.com/google/clasp/issues/1020)) ([d55832e](https://github.com/google/clasp/commit/d55832e59d63c480ae591f7d1ecba457ebfafb7b))


### Bug Fixes

* Don't write files on clone if unable to fetch project ([#824](https://github.com/google/clasp/issues/824)) ([b3b292a](https://github.com/google/clasp/commit/b3b292acfcc9bb191a3f4171601b8c420c187546))
* Rethrow error so command exits with error status ([#1019](https://github.com/google/clasp/issues/1019)) ([29ac629](https://github.com/google/clasp/commit/29ac62988b970b1905fe2601828bf7dcaac47b54))

## [2.4.2](https://github.com/google/clasp/compare/v2.4.1...v2.4.2) (2022-09-26)


Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The following command provide basic Apps Script project management.
clasp
```

- [`clasp login [--no-localhost] [--creds <file>] [--status]`](#login)
- [`clasp login [--no-localhost] [--creds <file>] [--status] [--redirect-port]`](#login)
- [`clasp logout`](#logout)
- [`clasp create [--title <title>] [--type <type>] [--rootDir <dir>] [--parentId <id>]`](#create)
- [`clasp clone <scriptId | scriptURL> [versionNumber] [--rootDir <dir>]`](#clone)
Expand Down Expand Up @@ -132,12 +132,14 @@ Logs the user in. Saves the client credentials to a `.clasprc.json` file.
- `--no-localhost`: Do not run a local server, manually enter code instead.
- `--creds <file>`: Use custom credentials used for `clasp run`. Saves a `.clasprc.json` file to current working directory. This file should be private!
- `--status`: Print who you are currently logged in as, if anyone.
- `--redirect-port <port>`: Specify a custom port for the local redirect server during the login process. Useful for environments where a specific port is required.

#### Examples

- `clasp login --no-localhost`
- `clasp login --creds creds.json`
- `clasp login --status`
- `clasp login --redirect-port 37473`

### Logout

Expand Down
15 changes: 14 additions & 1 deletion docs/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,20 @@ After seeing that message, you're ready to test out `clasp`!

### Run Tests

`clasp` has some unit tests that help detect errors. Build and run tests with these commands:
`clasp` has some unit tests that help detect errors.

The tests require an existing Apps Script project and corresponding GCP project. Follow the instructions in the
[Apps Script documentation](https://developers.google.com/apps-script/guides/cloud-platform-projects) to create
a script with a standard GCP project.

Once created, set the following environment variables. Replace the values with your corresponding script and project IDs.

```sh
SCRIPT_ID=15wKnP0deQOjCvCDmpkMo9npnosUYYvaLjNtIFEnOmNxxxxxxxx
PROJECT_ID=stable-century-447xxxxxxx
```

Build and run tests with these commands:

```sh
npm run build;
Expand Down
2 changes: 1 addition & 1 deletion docs/esmodules.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const preventTreeShakingPlugin = () => {
name: 'no-treeshaking',
resolveId(id, importer) {
if (!importer) {
// let's not theeshake entry points, as we're not exporting anything in Apps Script files
// let's not treeshake entry points, as we're not exporting anything in Apps Script files
return {id, moduleSideEffects: "no-treeshake" }
}
return null;
Expand Down
21 changes: 21 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/698fd43e541a6b8685ed408aaf7a63561018f9f8";
utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, utils }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
devShell = with pkgs; mkShell {
buildInputs = [
nodejs_22
nodePackages.prettier
];
};
}
);
}
Loading

0 comments on commit 4c339b2

Please sign in to comment.