Skip to content

Commit

Permalink
add /react and react example app
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherjbaker committed Jun 25, 2024
1 parent a364a8d commit ad1ac70
Show file tree
Hide file tree
Showing 22 changed files with 7,705 additions and 20 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
root: true,
extends: "@bitovi/eslint-config/node",
ignorePatterns: ["dist"],
rules: {
"@typescript-eslint/consistent-type-imports": [
"error",
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/example-basic-react.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Example - Basic React

on:
push:
workflow_dispatch:

jobs:
verify:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./examples/basic-react
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: Build core
working-directory: ./
run: npm run build

- name: Install dependencies
run: npm ci

- name: Typecheck
run: npm run typecheck
- name: ESLint
run: npm run eslint
- name: Prettier
run: npm run prettier
- name: depcheck
run: npm run depcheck

# - name: Test
# run: npm run test

- name: Build
run: npm run build
4 changes: 1 addition & 3 deletions .github/workflows/verify-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ jobs:
# run: npm run test

- name: Build
run: |
npm run clean
npm run build
run: npm run build

- name: Upload publish artifacts
if: github.event_name == 'workflow_dispatch'
Expand Down
2 changes: 1 addition & 1 deletion bin/dev.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning
#!/usr/bin/env -S node --loader ts-node/esm/transpile-only --no-warnings=ExperimentalWarning

import { execute } from "@oclif/core"

Expand Down
2 changes: 2 additions & 0 deletions examples/basic-react/.depcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignores:
- "@types/*"
1 change: 1 addition & 0 deletions examples/basic-react/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_OPTIMIZELY_SDK_KEY=your-optimizely-sdk-key
32 changes: 32 additions & 0 deletions examples/basic-react/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
root: true,
extends: "@bitovi/eslint-config/react",
ignorePatterns: ["dist", "*.html"],
rules: {
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "no-type-imports",
fixStyle: "inline-type-imports",
},
],
"import/order": [
"error",
{
"newlines-between": "always",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
groups: [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
],
},
],
},
}
14 changes: 14 additions & 0 deletions examples/basic-react/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Environment
/.env
/.env.*
!/.env.example

# Artifacts
/node_modules/
/dist/

# Cache and Logs
npm-debug.*
*.tsbuildinfo
.DS_Store
Thumbs.db
4 changes: 4 additions & 0 deletions examples/basic-react/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"semi": false,
"trailingComma": "all"
}
13 changes: 13 additions & 0 deletions examples/basic-react/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 ad1ac70

Please sign in to comment.