Skip to content

Commit

Permalink
feat: provide online sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Gumball12 committed Mar 9, 2024
1 parent cc42c08 commit 32cb177
Show file tree
Hide file tree
Showing 15 changed files with 3,674 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish-sandbox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: publish-sandbox

on:
push:
branches:
- main

jobs:
publish-sandbox:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20

- uses: pnpm/[email protected]
with:
version: 8

- uses: actions/cache@v3
id: pnpm-cache
with:
path: node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- if: steps.pnpm-cache.outputs.cache-hit != 'true'
run: pnpm install

- run: pnpm run build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./demo/dist
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

![logo](./docs/logo-extended.png)

> Check out the [Online Sandbox](https://gumball12.github.io/google-spreadsheet-dts/)!
This library automatically generates TypeScript types (`*.d.ts`) by parsing Google Sheets.

## 💫 Features
Expand Down
18 changes: 18 additions & 0 deletions demo/.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 demo/.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?
13 changes: 13 additions & 0 deletions demo/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" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="google-spreadsheet-dts" />
<title>google-spreadsheet-dts</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
38 changes: 38 additions & 0 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "google-spreadsheet-dts-demo",
"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"
},
"dependencies": {
"@handsontable/react": "^14.1.0",
"google-spreadsheet-dts": "0.0.11",
"handsontable": "^14.1.0",
"highlight.js": "^11.9.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-use": "^17.5.0"
},
"devDependencies": {
"@iconify/json": "^2.2.190",
"@types/react": "^18.2.56",
"@types/react-dom": "^18.2.19",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"@unocss/preset-icons": "^0.58.5",
"@unocss/preset-wind": "^0.58.5",
"@unocss/reset": "^0.58.5",
"@vitejs/plugin-react-swc": "^3.5.0",
"classnames": "^2.5.1",
"eslint": "^8.56.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"typescript": "^5.2.2",
"unocss": "^0.58.5",
"vite": "^5.1.4"
}
}
Loading

0 comments on commit 32cb177

Please sign in to comment.