@locale-labs/miniapp-builder 0.1.8-dev.3.4f92a66 → 0.1.8-dev.5.f1f1d6c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +27 -72
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,99 +1,54 @@
1
1
  # @locale-labs/miniapp-builder
2
2
 
3
- The official CLI tool to package and build Localé Mini-Apps.
3
+ CLI que empaqueta una mini-app de Localé en un único `index.html` self-contained, listo para deployar al Kernel.
4
4
 
5
- This tool takes your compiled assets (HTML, CSS, JS) and the Localé SDK, and bundles them into a **Single File Artifact** (`index.html`) ready for deployment to the Localé Kernel.
6
-
7
- ## 📦 Installation
8
-
9
- This package is usually installed as a dev dependency in your Mini-App project.
5
+ ## Instalar
10
6
 
11
7
  ```bash
12
8
  bun add -d @locale-labs/miniapp-builder
13
9
  ```
14
10
 
15
- ## 🚀 Usage
16
-
17
- Add a build script to your `package.json`:
11
+ Agregar al `package.json`:
18
12
 
19
13
  ```json
20
14
  {
21
15
  "scripts": {
22
- "build": "locale-miniapp-builder"
16
+ "build": "locale-miniapp-builder build",
17
+ "deploy": "locale-miniapp-builder deploy",
18
+ "dev": "locale-miniapp-builder dev"
23
19
  }
24
20
  }
25
21
  ```
26
22
 
27
- Or run it directly:
28
-
29
- ```bash
30
- bun x locale-miniapp-builder
31
- ```
32
-
33
- ## ⚙️ How it Works
34
-
35
- The builder acts as the **final step** in your build pipeline. It assumes previous steps (like `esbuild` or `tailwindcss`) have already run and placed their outputs in a `.temp/` directory.
36
-
37
- ### 1. Input Requirements
38
-
39
- The builder looks for the following files relative to your project root:
40
-
41
- - `.temp/index.html`: The base HTML structure.
42
- - `.temp/output.css`: Compiled Tailwind/CSS.
43
- - `.temp/alpine.js`: Compiled Application Logic (Alpine.js bundle).
44
-
45
- ### 2. The Process
46
-
47
- 1. **Reads Assets**: Loads the HTML, CSS, and JS files from the `.temp/` folder.
48
- 2. **Resolves SDK**: Automatically finds the installed version of `@locale-labs/miniapp-sdk`.
49
- 3. **Cleans HTML**: Removes development scripts (e.g., Tailwind CDN, unbundled Alpine.js tags).
50
- 4. **Inlines Everything**:
51
- - Injects CSS into a `<style>` block in `<head>`.
52
- - Injects the **Localé SDK** into a `<script>` block.
53
- - Injects your **App Bundle** into a `<script>` block.
23
+ ## Cómo funciona
54
24
 
55
- ### 3. Output
25
+ El builder es el último paso del pipeline. Asume que tu build previo (esbuild, tailwind, etc.) ya dejó archivos en `.temp/`:
56
26
 
57
- The result is a single, self-contained file:
58
-
59
- - `build/index.html`
60
-
61
- This file contains everything your Mini-App needs to run within the Localé Kernel's iframe sandbox.
62
-
63
- ## 🛠 Configuration
64
-
65
- Currently, the builder uses a "Zero Config" approach with opinionated defaults (expecting the `.temp/` structure).
66
-
67
- ### Debugging
68
-
69
- You can verify which SDK path is being resolved by looking at the console output during the build process. The builder checks:
70
-
71
- 1. `LOCALE_SDK_PATH` environment variable.
72
- 2. `node_modules/@locale-labs/miniapp-sdk`
73
- 3. Local fallback paths.
74
-
75
- ## 📦 Deployment
27
+ ```
28
+ .temp/
29
+ index.html # estructura HTML base
30
+ output.css # CSS compilado (Tailwind)
31
+ alpine.js # bundle de tu app
32
+ ```
76
33
 
77
- The builder can be deployed to npm using the `publish` GitHub Action. This will automatically build the package and publish it to the npm registry.
34
+ El comando `build` resuelve el SDK (`@locale-labs/miniapp-sdk` desde `node_modules` o `LOCALE_SDK_PATH`), inlinea CSS + SDK + tu bundle dentro del HTML, y genera:
78
35
 
79
- - When you push a commit to the `main` branch, the `publish` GitHub Action will be triggered and the package will be published to the npm registry.
80
- - When you push a commit to the `dev` branch, the `publish` GitHub Action will be triggered and the package will be published to the npm registry with the `beta` tag.
36
+ ```
37
+ build/index.html # artefacto único listo para subir
38
+ ```
81
39
 
82
- The package will be published to the npm registry with the version number that is specified in the `package.json` file (that is automatically bumped by the [`semantic-release`](https://github.com/semantic-release/semantic-release) plugin).
40
+ `deploy` toma ese HTML, lo sube a Supabase Storage del miniapp (`miniapp-builds/builds/<version>/index.html`) y registra la versión en el Core via la edge function `register_miniapp_version`. La versión se compone como `<package.json version>+<MINIAPP_GIT_SHA>` (build metadata semver).
83
41
 
84
- > [Commit Message Conventions](https://github.com/angular/angular/blob/main/contributing-docs/commit-message-guidelines.md)
42
+ ## Resolución del SDK
85
43
 
86
- - Patch/Fix release: `fix: update readme` (1.0.0 -> 1.0.1)
87
- - Minor/Feature release: `feat: add new feature` (1.0.0 -> 1.1.0)
88
- - Major release: (1.0.0 -> 2.0.0)
44
+ El builder busca el SDK en este orden:
89
45
 
90
- ```
91
- perf: improve performance of x
46
+ 1. `LOCALE_SDK_PATH` env var (útil para dev local).
47
+ 2. `node_modules/@locale-labs/miniapp-sdk`.
48
+ 3. Fallbacks locales.
92
49
 
93
- BREAKING CHANGE: The graphiteWidth option has been removed.
94
- The default graphite width of 10mm is always used for performance reasons.
95
- ```
50
+ Para desarrollo local con SDK linkeado: ver `dev:local` en una mini-app de referencia, p.ej. `locale-miniapp--mascotas-perdidas`.
96
51
 
97
- ---
52
+ ## Deploy del builder
98
53
 
99
- Developed with ❤️ by **Locale Labs**.
54
+ Ver [`DEPLOY.md`](./DEPLOY.md). Push a `dev` publica `@dev`, push a `main` publica `@latest`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@locale-labs/miniapp-builder",
3
- "version": "0.1.8-dev.3.4f92a66",
3
+ "version": "0.1.8-dev.5.f1f1d6c",
4
4
  "description": "Build tool for Localé Mini-Apps",
5
5
  "repository": {
6
6
  "type": "git",