Skip to content

Commit

Permalink
deploy formule to gh pages
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrc committed Feb 21, 2024
1 parent 4902e0d commit c3ea38d
Show file tree
Hide file tree
Showing 5 changed files with 1,569 additions and 680 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build and deploy demo
on: [push]
permissions:
contents: write
jobs:
build-and-deploy-demo:
name: Build and deploy demo
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./formule-demo
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 18.x

- name: Install
run: yarn

- name: Build
run: yarn build

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: formule-demo/dist
6 changes: 4 additions & 2 deletions formule-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"name": "formule-demo",
"private": true,
"version": "0.0.0",
"homepage": "https://cern-sis.github.io/react-formule",
"scripts": {
"dev": "vite",
"dev": "vite --config vite.config.local.ts",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
Expand All @@ -14,7 +15,8 @@
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"react-formule": "latest"
},
"devDependencies": {
"@types/react": "^18.2.15",
Expand Down
11 changes: 11 additions & 0 deletions formule-demo/vite.config.local.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { resolve } from "path";
import viteConfig from "./vite.config.ts";

// Enables hmr in development without having to rebuild the library
viteConfig.resolve = {
alias: {
"react-formule": resolve(__dirname, "../src/index.ts"),
},
};

export default viteConfig;
19 changes: 8 additions & 11 deletions formule-demo/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { resolve } from 'path'

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";

// https://vitejs.dev/config/
export default defineConfig({
Expand All @@ -14,10 +12,9 @@ export default defineConfig({
host: true,
port: 3030,
},
// Enables hmr in development without having to rebuild the library
resolve: {
alias: {
"react-formule": resolve(__dirname, '../src/index.ts'),
}
}
})
// FIXME: remove after we change the squirrelly import
// see https://github.com/squirrellyjs/squirrelly/issues/240#issuecomment-1816104837
build: {
commonjsOptions: { transformMixedEsModules: true },
},
});
Loading

0 comments on commit c3ea38d

Please sign in to comment.