Skip to content
Merged

Cli #391

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
a91999a
Update package.json to bump pnpm version to 10.25.0 and add new theme…
Stivenjs Dec 8, 2025
5aa0335
Add baseline-browser-mapping dependency and update package.json and p…
Stivenjs Dec 12, 2025
9743acb
Merge branch 'main' of https://github.com/Fasttify/fasttify into cli
Stivenjs Dec 12, 2025
d8cbdb3
Update pnpm-lock.yaml to remove deprecated baseline-browser-mapping v…
Stivenjs Dec 12, 2025
0d9def4
Refactor DomainResolver for improved caching and error handling
Stivenjs Dec 12, 2025
221e209
Add improved append and prepend filters to LiquidJS, enhance renderin…
Stivenjs Dec 12, 2025
5a72a71
Remove unnecessary comments from PaginateTag and RenderTag classes fo…
Stivenjs Dec 23, 2025
710ae7f
Refactor theme converter scripts to improve structure and update paths
Stivenjs Dec 23, 2025
a3db808
Update package.json to bump pnpm version from 10.25.0 to 10.26.1
Stivenjs Dec 23, 2025
ae8439d
Add liquid-forge-native package and update related configurations
Stivenjs Dec 23, 2025
772364e
Update pnpm-workspace.yaml and GitHub workflows for consistency and f…
Stivenjs Dec 23, 2025
609ff06
Refactor GitHub workflows to remove pnpm version specification and st…
Stivenjs Dec 23, 2025
7c8d02b
Enhance GitHub workflows for native filters with development and rele…
Stivenjs Dec 23, 2025
9f4292a
Remove deprecated workflows and code of conduct file; update GitHub w…
Stivenjs Dec 23, 2025
aaf01dd
Remove pnpm version specification from GitHub workflows for improved …
Stivenjs Dec 23, 2025
97b6471
Update GitHub workflows to ensure consistent newline formatting at th…
Stivenjs Dec 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ themes:
- packages/liquid-forge/**/*
- app/themes/**/*

# Filtros nativos (Rust)
native:
- packages/liquid-forge-native/**/*

# Documentación
documentation:
- docs/**/*
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.20.0

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ jobs:

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.20.0

- name: Configure Node.js
uses: actions/setup-node@v4
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.20.0

- name: setup node
uses: actions/setup-node@v4
Expand Down
5 changes: 0 additions & 5 deletions CODE_OF_CONDUCT.md

This file was deleted.

17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"packages/orders-app",
"packages/theme-editor",
"packages/tenant-domains",
"packages/theme-studio"
"packages/theme-studio",
"packages/liquid-forge-native"
],
"packageManager": "pnpm@10.20.0",
"packageManager": "pnpm@10.26.1",
"engines": {
"node": ">=20.18.3",
"pnpm": ">=10.18.0"
Expand Down Expand Up @@ -40,14 +41,16 @@
"email:compile": "tsx scripts/compile-email-templates.ts",
"email:test": "node scripts/test-email-system.js",
"email:dev": "pnpm run email:compile && pnpm run email:test",
"theme-converter:test": "tsx packages/liquid-forge/scripts/theme-converter/test/run-test.ts",
"theme-converter:test:simple": "tsx packages/liquid-forge/scripts/theme-converter/test/simple-test.ts",
"theme-converter:convert": "tsx packages/liquid-forge/scripts/theme-converter/cli/convert.ts",
"analyze": "ANALYZE=true pnpm run build",
"sandbox": "npx ampx sandbox --identifier xooty --stream-function-logs",
"sandbox:deploy": "npx ampx deploy",
"sandbox:logs": "npx ampx logs",
"upload-template": "node scripts/upload-base-template.js",
"license": "node scripts/add-license-header.js",
"license:check": "node scripts/check-license-header.js",
"convert": "tsx scripts/parser/shopify-to-fasttify-converter.ts"
"license:check": "node scripts/check-license-header.js"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,json,css,scss,md}": [
Expand Down Expand Up @@ -156,6 +159,7 @@
"axios": "^1.10.0",
"babel-jest": "^30.0.4",
"babel-plugin-react-compiler": "^1.0.0",
"baseline-browser-mapping": "^2.9.7",
"constructs": "^10.4.2",
"esbuild": "^0.25.6",
"eslint": "^9.37.0",
Expand All @@ -179,6 +183,9 @@
"overrides": {
"@types/react": "19.2.2",
"@types/react-dom": "19.2.2"
}
},
"ignoredBuiltDependencies": [
"core-js"
]
}
}
12 changes: 12 additions & 0 deletions packages/liquid-forge-native/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]

[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "target-feature=+crt-static"]

[profile.release]
lto = true
codegen-units = 1
opt-level = 3
strip = true

27 changes: 27 additions & 0 deletions packages/liquid-forge-native/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Rust
target/
Cargo.lock
**/*.rs.bk
*.pdb

# NAPI
*.node
index.js
index.d.ts

# Build artifacts
*.dylib
*.so
*.dll

# IDE
.idea/
.vscode/
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db

22 changes: 22 additions & 0 deletions packages/liquid-forge-native/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Source files
src/
benches/
target/
Cargo.toml
Cargo.lock
build.rs
rust-toolchain.toml

# Tests and docs
*.md
!README.md

# CI/CD
.github/
.cargo/

# Development
*.log
npm-debug.log*
.DS_Store

40 changes: 40 additions & 0 deletions packages/liquid-forge-native/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[package]
name = "liquid-forge-native"
version = "1.0.0"
edition = "2021"
authors = ["Fasttify LLC"]
license = "Apache-2.0"
description = "High-performance Rust filters for Liquid template engine"

[lib]
crate-type = ["cdylib"]

[dependencies]
# NAPI-RS for Node.js bindings
napi = "2.16"
napi-derive = "2.16"

# Core dependencies
regex = "1.10"
once_cell = "1.19"
unicode-normalization = "0.1"

[build-dependencies]
napi-build = "2.1"

[profile.release]
lto = true
codegen-units = 1
opt-level = 3
strip = true

[profile.dev]
opt-level = 0

[[bench]]
name = "filters_bench"
harness = false

[dev-dependencies]
criterion = "0.5"

111 changes: 111 additions & 0 deletions packages/liquid-forge-native/QUICKSTART.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Quick Start - Filtros Nativos

Guía rápida de 5 minutos para empezar a usar los filtros nativos.

## 1. Instalar Rust

```bash
# Windows
winget install Rustlang.Rustup

# macOS/Linux
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

## 2. Compilar

```bash
cd packages/liquid-forge-native
npm install
npm run build
```

**Salida esperada:**

```
✓ Build completed successfully
```

## 3. Verificar

```bash
# Ver que se generó el archivo .node
ls *.node

# Ejecutar ejemplo
node examples/usage.js
```

**Deberías ver:**

```
✓ Filtros nativos cargados correctamente
🧪 Ejemplos de Filtros Nativos
...
✨ Todos los filtros funcionan correctamente!
```

## 4. Benchmark

```bash
node examples/benchmark.js
```

**Deberías ver mejoras de 5-7x en rendimiento** 🚀

## 5. Usar en tu Código

Los filtros se cargan **automáticamente** en `liquid-forge`:

```typescript
// No necesitas cambiar nada en tu código
import { liquidEngine } from '@fasttify/liquid-forge';

const html = await liquidEngine.render(template, context);
// ✓ Ya está usando filtros nativos si están compilados
```

## Verificar que Está Funcionando

```typescript
import { isUsingNativeFilters } from '@fasttify/liquid-forge/lib/native-filters';

console.log('Filtros nativos:', isUsingNativeFilters() ? 'ON' : 'OFF');
```

## Solución de Problemas

**Error: Cannot find module**

```bash
# Solución: Compilar el módulo
cd packages/liquid-forge-native
npm run build
```

**Error: linker not found (Windows)**

```bash
# Solución: Instalar Visual Studio Build Tools
# https://visualstudio.microsoft.com/downloads/
```

**Error: xcrun (macOS)**

```bash
# Solución:
xcode-select --install
```

## Siguiente Paso

Lee la documentación completa en:

- [INSTALLATION.md](./INSTALLATION.md) - Guía detallada de instalación
- [../liquid-forge/NATIVE_FILTERS.md](../liquid-forge/NATIVE_FILTERS.md) - Documentación de uso

## ¿Preguntas?

- Los filtros nativos son **opcionales** - si no están compilados, usa JavaScript automáticamente
- Son **100% compatibles** - misma API, mismos resultados
- Son **mucho más rápidos** - 5-7x mejora de rendimiento
Loading
Loading