Giter Club home page Giter Club logo

multi-clasp2's Introduction

multi-clasp2

This library is inspired by multi-clasp.

multi-clasp2 is meant to solve a specific problem: You have multiple google artifacts (sheets, docs, etc.) that all use the same Apps Script project.

You want them to share the same code, but making this Apps Script project into a library significantly slows its performance.

The solution is to maintain a reference to each artifact's Apps Script project, and simultaneously push changes to these projects so they can receive updates while maintaining their non-library performance.

Install

Install clasp:

npm install -g @google/clasp

Install multi-clasp2:

npm install -g multi-clasp2

Example File

Create a .multi-clasp.json file, which is just an array of JSON objects identical to the standard .clasp.json format.

You do not need a .clasp.json file anymore.

[
	{
		"scriptId": "1VBe_bo7OtOw1EQ_f86HBKSDEDdcGX3mYfCNIcp5L2tR1P-VAU8Sl7KX1",
		"rootDir": "build"
	},
	{
		"scriptId": "1VBe_bo7OtOw1EQ_f86HBKSDEDdcGX3mYfCNIcp5L2tR1P-VAU8Sl7KX2",
		"rootDir": "build"
	},
	{
		"scriptId": "1VBe_bo7OtOw1EQ_f86HBKSDEDdcGX3mYfCNIcp5L2tR1P-VAU8Sl7KX3",
		"rootDir": "build"
	}
]

Commands

The following clasp commands are supported. For the documentation refer to the official documentation

multi-clasp2's People

Contributors

fantonangeli avatar dependabot[bot] avatar

Stargazers

Elijah Passmore avatar Pablo avatar  avatar Ben avatar Clevrr avatar  avatar Denis avatar

Watchers

 avatar

multi-clasp2's Issues

[Request] Only Push and Update Selected File

Case:

I have an app script that has 3 files across 5 sheets, with these file structures:

  1. A.gs
  2. B.gs
  3. C.html

Now I want to update only A.gs and B.gs, which I already prepared without C.html in my folder, whenever I multi-clasp push --force, the C.html in those 5 sheets is missing or deleted, which is not correct since I only push 2 files A and B gs.

Request:

Can we only push the files that we changed? because on those C.html will have different values needed for those 5 different sheets thank you.

Accept other commands than push

Make other clasp commands available to multi-clasp like:
clasp status [--json]
clasp open [scriptId] [--webapp] [--creds] [--addon] [--deploymentId ]
clasp deployments
clasp deploy [--versionNumber ] [--description ] [--deploymentId ]
clasp undeploy [deploymentId] [--all]
clasp version [description]
clasp versions

Error with Node v20.14.0, but working properly Node 20.11.0

Command: multi-clasp push

Error with Node v20.14.0:

  1. CMD line output:
    Elaborating scriptId: 1SQ4GFr_5sXG7h4p3DjUhjaW7iPaOrzmy-_t_Y0xS9pFXryFTsMzxxxxx (1st scriptId in .multi-clasp.json file array)

npm error could not determine executable to run

npm error A complete log of this run can be found in: C:\Users\xxx\AppData\Local\npm-cache_logs\2024-06-24T16_57_10_576Z-debug-0.log

  1. Log file
    2024-06-24T16_57_10_576Z-debug-0.log
    2024-06-24T16_57_10_576Z-debug-0.log

With Node v20.11.0:
No error, everything works, clasp is called, the scripts are updated

OS: Windows 10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.