Skip to content

Commit

Permalink
hello, open source world
Browse files Browse the repository at this point in the history
  • Loading branch information
al3xnag committed Sep 8, 2024
1 parent 7edde00 commit 4e5e17e
Show file tree
Hide file tree
Showing 210 changed files with 24,191 additions and 3 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Tests

on:
push:
branches: ['**']
pull_request:
branches: ['**']

jobs:
vitest:
name: Vitest
runs-on: ubuntu-latest
# https://github.com/orgs/community/discussions/26940
# https://github.com/zopefoundation/meta/issues/145
if: github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name !=
github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run tests
run: pnpm test:vitest

playwright:
name: Playwright
runs-on: ubuntu-latest
# https://github.com/orgs/community/discussions/26940
# https://github.com/zopefoundation/meta/issues/145
if: github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name !=
github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Test Build
run: pnpm test:playwright:web-server:build
env:
NODE_OPTIONS: '--max-old-space-size=8192'
- name: Install Playwright Browsers
run: pnpm -F jsrepl exec playwright install --with-deps
- name: Start Supabase
run: pnpm -F jsrepl supabase:start
- name: Run Playwright tests
run: pnpm -F jsrepl test:playwright
env:
NODE_OPTIONS: '--max-old-space-size=8192'
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
98 changes: 98 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.build

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt
.output

# Nuxt generate
dist

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# IDE / Editor
.idea

# Service worker
sw.*

# macOS
.DS_Store

# Vim swap files
*.swp

# Vercel
.vercel

# Turborepo
.turbo
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm exec lint-staged
3 changes: 3 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
'**/*': 'prettier --write --ignore-unknown',
}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers = true
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pnpm-lock.yaml
public/e.js
database.types.ts
test-results/
playwright-report/
20 changes: 20 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 100,

"importOrder": ["^node:", "<THIRD_PARTY_MODULES>", "^[./]"],
"importOrderSortSpecifiers": true,

"plugins": ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"],

"overrides": [
{
"files": "*.md",
"options": {
"proseWrap": "always"
}
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"css.customData": [".vscode/tailwind.json"]
}
55 changes: 55 additions & 0 deletions .vscode/tailwind.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"version": 1.1,
"atDirectives": [
{
"name": "@tailwind",
"description": "Use the `@tailwind` directive to insert Tailwind's `base`, `components`, `utilities` and `screens` styles into your CSS.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#tailwind"
}
]
},
{
"name": "@apply",
"description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that you’d like to extract to a new component.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#apply"
}
]
},
{
"name": "@responsive",
"description": "You can generate responsive variants of your own classes by wrapping their definitions in the `@responsive` directive:\n```css\n@responsive {\n .alert {\n background-color: #E53E3E;\n }\n}\n```\n",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#responsive"
}
]
},
{
"name": "@screen",
"description": "The `@screen` directive allows you to create media queries that reference your breakpoints by **name** instead of duplicating their values in your own CSS:\n```css\n@screen sm {\n /* ... */\n}\n```\n…gets transformed into this:\n```css\n@media (min-width: 640px) {\n /* ... */\n}\n```\n",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#screen"
}
]
},
{
"name": "@variants",
"description": "Generate `hover`, `focus`, `active` and other **variants** of your own utilities by wrapping their definitions in the `@variants` directive:\n```css\n@variants hover, focus {\n .btn-brand {\n background-color: #3182CE;\n }\n}\n```\n",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#variants"
}
]
}
]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

**JavaScript REPL & Playground**

Quickly test and share your code snippets.
Ideal for learning and prototyping.
Quickly test and share your code snippets. Ideal for learning and prototyping.

![demo](https://github.com/user-attachments/assets/d6a12ee5-4227-4b3a-860c-48de845ccb0b)

## Links

- Website: https://jsrepl.io
- [Issues](https://github.com/jsrepl/jsrepl.io/issues)
- [Discussions](https://github.com/jsrepl/jsrepl.io/discussions)
Expand Down
47 changes: 47 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "jsrepl.io",
"description": "JavaScript REPL & Playground",
"private": true,
"type": "module",
"license": "MIT",
"homepage": "https://jsrepl.io",
"author": {
"name": "Aleksei Nagovitsyn",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "git+https://github.com/jsrepl/jsrepl.io.git"
},
"scripts": {
"prepare": "husky",
"build": "turbo run build",
"dev": "turbo run dev",
"preview": "turbo run preview",
"lint": "turbo run lint",
"test": "turbo run test",
"test:vitest": "turbo run test:vitest",
"test:vitest:watch": "turbo run test:vitest:watch",
"test:playwright": "turbo run test:playwright",
"test:playwright:web-server:build": "turbo run test:playwright:web-server:build",
"test:playwright:web-server:start": "turbo run test:playwright:web-server:start",
"format": "prettier . --write"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"prettier": "3.3.2",
"prettier-plugin-tailwindcss": "^0.6.5",
"turbo": "^2.1.1"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=18"
},
"pnpm": {
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
}
}
5 changes: 5 additions & 0 deletions packages/jsrepl/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SUPABASE_URL=
SUPABASE_KEY=
SUPABASE_SERVICE_KEY=
JSREPL_PREVIEW_URL=http://localhost:5199
JSREPL_CUSTOM_APP_VERSION=
5 changes: 5 additions & 0 deletions packages/jsrepl/.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SUPABASE_URL=http://127.0.0.1:54321
SUPABASE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
SUPABASE_SERVICE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU
JSREPL_PREVIEW_URL=http://localhost:5199
JSREPL_CUSTOM_APP_VERSION=9.9.9
3 changes: 3 additions & 0 deletions packages/jsrepl/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public/e.js
test-results/
playwright-report/
6 changes: 6 additions & 0 deletions packages/jsrepl/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import baseConfig from '../../.lintstagedrc.js'

export default {
...baseConfig,
'**/*': 'eslint --fix',
}
16 changes: 16 additions & 0 deletions packages/jsrepl/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<template>
<div>
<TooltipProvider>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>

<Toaster />
</TooltipProvider>
</div>
</template>

<script setup lang="ts">
import Toaster from '@/components/ui/toast/Toaster.vue'
import { TooltipProvider } from '@/components/ui/tooltip'
</script>
Loading

0 comments on commit 4e5e17e

Please sign in to comment.