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
14 changes: 0 additions & 14 deletions .github/workflows/rbe-pr-main.yaml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/rbe-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "@iwsio/react-blog-examples: PR to main"

on:
pull_request:
branches: [ main ]

jobs:
testing:
if: ${{github.event.pull_request.draft == false && !contains(github.event.head_commit.message, '#skip') }}
uses: iwsllc/workflows/.github/workflows/test.yaml@v2
with:
registry-url: 'https://registry.npmjs.org'
scope: '@iwsio'
node-version-file: '.nvmrc'
cache: npm
install-command: npm ci
test-command: npm run test -w packages/fetch
20 changes: 0 additions & 20 deletions .github/workflows/rbe-publish.yaml

This file was deleted.

43 changes: 33 additions & 10 deletions .github/workflows/rbe-push-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,40 @@ on:
branches: [ main ]

jobs:
run-tests:
tests:
if: ${{ !contains(github.event.head_commit.message, '#skip') }}
uses: ./.github/workflows/rbe-test.yaml
secrets: inherit
set-version:
needs: run-tests
uses: iwsllc/workflows/.github/workflows/test.yaml@v2
with:
registry-url: 'https://registry.npmjs.org'
scope: '@iwsio'
cache: npm
node-version-file: '.nvmrc'
install-command: npm ci
test-command: npm run test -w package
version:
needs: tests
if: ${{ !contains(github.event.head_commit.message, '#skip') }}
uses: ./.github/workflows/rbe-version.yaml
secrets: inherit
uses: iwsllc/workflows/.github/workflows/version.yaml@v2
with:
ref: main
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
cache: npm
scope: '@iwsio'
version-command: npm version patch -ws --include-workspace-root
tag-includes-name: false
publish:
needs: version
if: ${{ !contains(github.event.head_commit.message, '#skip') }}
needs: set-version
uses: ./.github/workflows/rbe-publish.yaml
secrets: inherit
uses: iwsllc/workflows/.github/workflows/publish.yaml@v2
with:
ref: main
registry-url: 'https://registry.npmjs.org'
cache: npm
node-version-file: '.nvmrc'
scope: '@iwsio'
install-command: npm ci
build-command: npm run build -w package
publish-command: npm publish -w package --access public
secrets:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
20 changes: 0 additions & 20 deletions .github/workflows/rbe-test.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/rbe-version.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
22
20 changes: 20 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en" data-theme="light" style="line-height: 1rem;">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<script src="./src/index.tsx" type="module"></script>
</head>

<body class="flex flex-col h-screen" style="margin: 0;">
<noscript>You need to enable JavaScript to run this app.</noscript>
<main id="root" class="grow flex flex-col">
<span style="display: block; line-height: 1rem; margin-top: 2px;">🚀</span>
</main>
</body>

</html>
62 changes: 25 additions & 37 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,35 @@
{
"name": "@iwsio/react-blog-examples-demo",
"version": "3.2.0",
"version": "4.0.0-alpha.1",
"private": true,
"devDependencies": {
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"@types/node": "^20.14.10",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.19",
"css-loader": "^7.1.2",
"cssnano": "^7.0.4",
"daisyui": "^4.12.10",
"html-webpack-plugin": "^5.6.0",
"jsdom": "^24.1.0",
"mini-css-extract-plugin": "^2.9.0",
"postcss": "^8.4.39",
"postcss-cli": "^11.0.0",
"postcss-js": "^4.0.1",
"postcss-loader": "^8.1.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.24.1",
"rimraf": "^5.0.7",
"source-map-loader": "^5.0.0",
"style-loader": "^4.0.0",
"tailwindcss": "^3.4.4",
"terser-webpack-plugin": "^5.3.10",
"ts-loader": "^9.5.1",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"tslib": "^2.6.3",
"typescript": "^5.5.3",
"vitest": "^1.6.0",
"web-vitals": "^4.2.1",
"webpack": "^5.92.1",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4"
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
"@testing-library/user-event": "^14.6.1",
"@types/node": "^22.13.3",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.4",
"autoprefixer": "^10.4.20",
"classnames": "^2.5.1",
"cssnano": "^7.0.6",
"daisyui": "^4.12.23",
"jsdom": "^26.0.0",
"postcss": "^8.5.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-router": "^7.1.5",
"rimraf": "^6.0.1",
"tailwindcss": "^3.4.17",
"ts-loader": "^9.5.2",
"typescript": "^5.7.3",
"vite": "^6.1.0",
"vitest": "^3.0.5",
"web-vitals": "^4.2.4"
},
"type": "module",
"scripts": {
"start": "GITHUB_SHA=`git rev-parse HEAD` webpack-dev-server",
"start": "VITE_GITHUB_SHA=`git rev-parse HEAD` vite dev",
"lint": "eslint src",
"test": "VITEST_SEGFAULT_RETRY=3 vitest --run --passWithNoTests"
},
Expand Down
1 change: 1 addition & 0 deletions demo/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { render, screen } from '@testing-library/react'

import { App } from './App.js'

test('renders learn react link', () => {
Expand Down
4 changes: 2 additions & 2 deletions demo/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { JsonCsvExample } from '@iwsio/react-blog-examples/json-csv'

export const App = () => {
return (
<div className="w-[90%] m-auto">
<h1 className="text-3xl font-bold mb-5">@iwsio/json-csv-core</h1>
<div className="m-auto w-[90%]">
<h1 className="mb-5 text-3xl font-bold">@iwsio/json-csv-core</h1>
<JsonCsvExample />
</div>
)
Expand Down
1 change: 1 addition & 0 deletions demo/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const BUILD_SHA = import.meta.env.VITE_GITHUB_SHA
16 changes: 0 additions & 16 deletions demo/src/index.html

This file was deleted.

6 changes: 5 additions & 1 deletion demo/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import './stylesheets/index.css'

import { StrictMode } from 'react'
import ReactDOM from 'react-dom/client'

import { App } from './App.js'
import { BUILD_SHA } from './constants.js'
import reportWebVitals from './reportWebVitals.js'
import './stylesheets/index.css'

const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
Expand All @@ -11,6 +14,7 @@ const root = ReactDOM.createRoot(
root.render(
<StrictMode>
<App />
<span className="hidden">{BUILD_SHA}</span>
</StrictMode>
)

Expand Down
2 changes: 1 addition & 1 deletion demo/src/reportWebVitals.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { onCLS, onFID, onFCP, onLCP, onTTFB } from 'web-vitals'
import { onCLS, onFCP, onFID, onLCP, onTTFB } from 'web-vitals'

const reportWebVitals = (onPerfEntry?: any) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
Expand Down
19 changes: 17 additions & 2 deletions demo/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
/// <reference types="vitest" />
// import { resolve } from 'node:path'

import react from '@vitejs/plugin-react'
import { defineConfig } from 'vitest/config'

export default defineConfig({
export default defineConfig(({ mode }) => ({
plugins: [react()],
build: {
minify: mode === 'production',
sourcemap: mode !== 'production',
emptyOutDir: true,
outDir: './dist'
},
server: {
host: '0.0.0.0',
port: 3000,
strictPort: true,
allowedHosts: ['localhost']
},
test: {
globals: true,
mockReset: true,
environment: 'jsdom',
setupFiles: ['./setupTests']
}
})
}))
Loading
Loading