npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

angular-to-appsscript

v0.3.0

Published

Convierte el dist de Angular en una Web App autocontenida de Google Apps Script

Readme

angular-to-appsscript

Orquestador que convierte el dist/ de cualquier proyecto Angular en una Web App autocontenida de Google Apps Script, con toda la configuración en objetos y un solo comando.

  • Paquete: angular-to-appsscript · MIT · 0.1.1
  • Binario: gas
  • Rol: lee tu gas.config.mjs, transforma el dist/ de Angular y escribe todo lo que Apps Script necesita en gas/.
  • Node: ≥ 18 · ESM ("type": "module")

Qué hace

| Paso | Qué ocurre | |---|---| | Resolver source.dist | Config explícita o autodetección de dist/*/browser | | Inline CSS | Los .css del dist/ entran dentro del <style> del HTML | | Bundlear JS | El JS se empaqueta con esbuild (minify, target, format desde config) | | Inline assets | Imágenes → data: URI (respetando inlineMaxKB) | | Embeber licencias | 3rdpartylicenses.txt → bloque <template> al final | | Verificar autocontención | Cero <script src> / <link href> locales, budgetKB.html | | Escribir gas/Index.html | HTML único autocontenido | | Escribir gas/WebApp.gs | doGet + include genéricos | | Escribir gas/Manifest.gs | GAS_MANIFEST con config de extensiones (para que lean su config) | | Escribir gas/appsscript.json | Manifiesto determinista desde la config | | Compilar domain[] | TS/JS puro → .gs IIFE vía gas-domain | | Inyectar extensions[] | Runtime de cada capacidad declarada |

Qué NO hace

  • ❌ No lee ni escribe Sheets, Drive ni expone endpoints (eso son gas-sheets, gas-drive, gas-api).
  • ❌ No tiene lógica de negocio ni conoce entidades de ningún proyecto (G4).
  • ❌ No hace clasp push ni clasp deploy.
  • ❌ No compila Angular: eso es ng build.

Instalación

npm install --save-dev angular-to-appsscript

Peer dependencies

| Paquete | Versión | Motivo | |---|---|---| | gas-contract | ^0.1.0 | Config-objeto, contrato GasExtension, verificación | | gas-domain | ^0.1.0 | Compilación de domain[] (lo instala npm si falta) |

Dependencies

esbuild (bundle JS), parse5 (parseo de index.html).

Comandos

| Comando | Qué hace | Código de salida | |---|---|---| | gas init | Crea gas.config.mjs y agrega scripts a package.json | 0 / 1 | | gas build | Compila Angular, convierte y escribe gas/ | 0 / 1 | | gas check | Verifica reglas de compatibilidad de la salida | 0 / 1 | | gas domain | Compila domain[] a .gs IIFE | 0 / 1 |

Códigos: 0 = éxito · 1 = error (mensaje a stderr con prefijo [gas]) · 2 = no implementado.

Pasos secuenciales

# 1. Instalar
npm install --save-dev angular-to-appsscript

# 2. Crear la config
npx gas init

# 3. Editar gas.config.mjs (app.title, domain[], extensions[])

# 4. Compilar todo
npm run gas:build        # = ng build && gas build && gas domain

# 5. Verificar
npm run gas:check        # todos PASS

# 6. Subir a Apps Script
clasp push gas/

gas init agrega estos scripts a tu package.json si no existen:

{
  "gas:init": "gas init",
  "gas:build": "npm run build && gas build && gas domain",
  "gas:check": "gas check"
}

Config

Se define en gas.config.mjs en la raíz del proyecto:

import { defineGasConfig } from 'angular-to-appsscript';

export default defineGasConfig({
  app: {
    title: 'Mi App',
    timeZone: 'America/Argentina/Buenos_Aires',
  },
  source: {
    framework: 'angular',   // 'angular' | 'astro'
    dist: 'auto',           // 'auto' | ruta explícita
    buildCommand: 'npm run build',
  },
  output: {
    mode: 'single',
    dir: 'gas',
    file: 'Index.html',
  },
  target: {
    css: { mode: 'inline', minify: false },
    js: { mode: 'bundle', format: 'esm', minify: true, target: 'es2022' },
    images: { inlineMaxKB: 1000, overLimit: 'error', mimeTypes: {} },
    licenses: { file: 'auto', embed: true },
    budgetKB: { html: 1000 },
  },
  domain: [
    {
      entry: 'src/app/core/domain/gas-validation.entry.ts',
      outfile: 'gas/Validation.gs',
      globalName: 'MyValidation',
    },
  ],
  extensions: [],   // capacidades: sheets(), drive(), api()
});

Los campos con default son opcionales. La forma completa está en gas-contract/gasConfigSchema y en doc/paquetes-appscript/02-angular-to-appsscript.md.

Qué genera en gas/

| Archivo | Origen | Editable a mano | |---|---|---| | Index.html | convertir() — transformación del dist/ | ❌ generado | | WebApp.gs | generarWebApp(config) — doGet + include | ❌ generado | | Manifest.gs | buildGasManifest() + serializarManifest() | ❌ generado | | appsscript.json | buildManifest() + serializarManifest() | ❌ generado | | *.gs de domain[] | gas-domain → buildDomain() | ❌ generado | | *.gs de extensions[] | runtime de cada capacidad | ❌ generado |

Nada en gas/ se edita a mano (G5). Regenerá con npm run gas:build.

Cómo se comunica con el resto

gas.config.mjs
     │
     ▼
┌─────────────────────────────┐
│  angular-to-appsscript      │  orquestador
│  gas init/build/check/domain│
└──────┬──────────┬───────────┘
       │          │
       ▼          ▼
 gas-contract   gas-domain      (peer deps)
       ▲          ▲
       │          │
  gas-sheets  gas-drive  gas-api   (extensions[], aportan runtime/*.gs)
  • gas-contract aporta loadConfig, defineGasConfig, verifyOutput, buildManifest.
  • gas-domain compila domain[].
  • Las capacidades (gas-sheets, gas-drive, gas-api) se declaran en extensions[]; cada una aporta su runtime/*.gs y su config viaja en GAS_MANIFEST.extensions.<nombre>.manifest.
  • Las capacidades NO se importan entre sí (R7): se leen por el manifest.

Reglas de la familia

  • G1 — Cero nombres de proyecto dentro del paquete.
  • G2 — Todo se declara en objetos; el código ejecuta lo declarado.
  • G3 — Separación de responsabilidades.
  • G4 — El proyecto posee su lógica de negocio.
  • G5 — Nada se edita a mano en la salida.

Licencia

MIT