Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
53 changes: 28 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
# This is a basic workflow to help you get started with Actions

name: build library

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
pull_request:
branches:
- main
branches: [main]
push:
branches:
- main
branches: [main]
workflow_dispatch:

permissions:
contents: read

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
strategy:
matrix:
include:
- node: 22
react: 18
- node: 22
react: 19
- node: 24
react: 19
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '20.x'

- name: install deps
run: yarn

- name: build library
run: yarn build
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Check React 18 compatibility
if: matrix.react == 18
run: pnpm add --save-dev react@18.3.1 react-dom@18.3.1
- run: pnpm test:coverage
- run: pnpm build
- run: pnpm test:package
69 changes: 48 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
{
"name": "template-to-react",
"description": "compile html string template to react component",
"description": "Compile HTML templates with prop placeholders into React JSX or JavaScript source at build time",
"author": {
"name": "Saiya",
"url": "https://evecalm.com/"
},
"keywords": [
"react",
"template",
"jsx",
"html",
"string",
"transpiler",
"html-to-react",
"html-to-jsx",
"html-template",
"template",
"compiler",
"converter"
"code-generation",
"build-time",
"react-component"
],
"files": [
"dist"
Expand All @@ -21,33 +25,56 @@
"type": "git",
"url": "https://github.com/oe/template-to-react"
},
"version": "0.1.1",
"version": "0.2.0",
"type": "module",
"main": "dist/index.umd.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"dev": "vite serve example",
"build": "tsc && vite build",
"test": "vitest --coverage --watch",
"prepublish": "yarn vitest && yarn build"
"build": "pnpm typecheck && vite build",
"test": "vitest run",
"test:watch": "vitest --watch",
"test:coverage": "vitest run --coverage",
"test:package": "node scripts/check-package.mjs",
"prepublishOnly": "pnpm test:coverage && pnpm build && pnpm test:package",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@types/node": "^20.14.2",
"@types/node": "^22.20.5",
"@types/pegjs": "^0.10.6",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"@vitest/coverage-v8": "^1.6.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tsx": "^4.15.5",
"typescript": "^5.2.2",
"vite": "^5.2.11",
"vite-plugin-dts": "^3.9.1",
"vitest": "^1.6.0"
"@types/react": "^19.2.0",
"@types/react-dom": "^19.2.0",
"@vitejs/plugin-react": "^6.1.1",
"@vitest/coverage-v8": "5.0.3",
"react": "^19.3.0",
"react-dom": "^19.3.0",
"typescript": "~5.9.3",
"vite": "^8.3.2",
"vitest": "5.0.3",
"unplugin-dts": "^1.1.2",
"@microsoft/api-extractor": "^7.59.3"
},
"dependencies": {
"pegjs": "^0.10.0"
},
"license": "MIT",
"packageManager": "pnpm@12.8.1",
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.umd.cjs"
}
},
"./*": "./*"
},
"homepage": "https://github.com/oe/template-to-react#readme",
"bugs": {
"url": "https://github.com/oe/template-to-react/issues"
}
}
Loading
Loading