Skip to content

Commit

Permalink
Visulaizer (#95)
Browse files Browse the repository at this point in the history
* wip

* wip

* update pnpm lock

* removed node assert

* visualizer done

* fixed playground

* rust free builds
  • Loading branch information
XantreDev authored Apr 3, 2024
1 parent caad84f commit 1a0af98
Show file tree
Hide file tree
Showing 23 changed files with 1,890 additions and 504 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
branches:
- main
pull_request:
types: [opened, synchronize]
paths-ignore:
- '**/*.md'
- "!.github/workflows/lint.yml"

branches:
- main

Expand Down Expand Up @@ -31,7 +36,7 @@ jobs:
workspaces: "packages/react/swc"
- run: pnpm build
env:
CARGO_DEBUG: "true"
SKIP_RUST: "true"
- run: pnpm test
lint:
name: Lint
Expand All @@ -54,7 +59,7 @@ jobs:
workspaces: "packages/react/swc"
- run: pnpm build
env:
CARGO_DEBUG: "true"
SKIP_RUST: "true"
- run: pnpm lint
- run: pnpm eslint
build:
Expand Down
18 changes: 18 additions & 0 deletions apps/transformer-playground/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
24 changes: 24 additions & 0 deletions apps/transformer-playground/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
30 changes: 30 additions & 0 deletions apps/transformer-playground/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
13 changes: 13 additions & 0 deletions apps/transformer-playground/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>preact signals react transform playground</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
42 changes: 42 additions & 0 deletions apps/transformer-playground/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "transformer-playground",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@babel/plugin-syntax-jsx": "^7.23.3",
"@babel/preset-env": "^7.24.3",
"@babel/standalone": "^7.24.3",
"@monaco-editor/react": "^4.6.0",
"@preact-signals/safe-react": "workspace:*",
"@preact-signals/utils": "workspace:*",
"assert": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"shiki": "^1.2.3"
},
"devDependencies": {
"@shikijs/monaco": "^1.2.3",
"@types/babel__standalone": "^7.1.7",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.19",
"daisyui": "^4.9.0",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"typescript": "^5.2.2",
"vite": "^5.2.0"
}
}
6 changes: 6 additions & 0 deletions apps/transformer-playground/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
Loading

0 comments on commit 1a0af98

Please sign in to comment.