Skip to content

Commit

Permalink
chore: add blockly-react-ts example
Browse files Browse the repository at this point in the history
  • Loading branch information
alicialics committed Oct 1, 2023
1 parent 9686012 commit 5d676dd
Show file tree
Hide file tree
Showing 24 changed files with 5,533 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/blockly-react-ts/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vite.config.ts
32 changes: 32 additions & 0 deletions examples/blockly-react-ts/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:react/jsx-runtime",
],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: ["./tsconfig.json", "./tsconfig.node.json"],
tsconfigRootDir: __dirname,
},
plugins: ["react-refresh"],
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
settings: {
react: {
version: "detect",
},
},
};
24 changes: 24 additions & 0 deletions examples/blockly-react-ts/.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?
28 changes: 28 additions & 0 deletions examples/blockly-react-ts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[Home](../README.md)

# blockly-react-sample [![Built on Blockly](https://tinyurl.com/built-on-blockly)](https://github.com/google/blockly)

This sample shows how to load Blockly in a [React](https://reactjs.org/) project.

## Running the sample

### Installation

```
npm install
```

### Running

```
npm run start
```

### Browse

Open [http://localhost:5173/](http://localhost:5173/)

## Community projects

[react-blockly](https://github.com/nbudin/react-blockly):
A React component that embeds Blockly. It uses the official [Blockly npm package](https://www.npmjs.com/package/blockly).
13 changes: 13 additions & 0 deletions examples/blockly-react-ts/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>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading

0 comments on commit 5d676dd

Please sign in to comment.