Skip to content

Commit 0309e3e

Browse files
authored
Merge pull request #1 from bolasim/master
Working API compatible Pylon package
2 parents 4b20b93 + 1fd9cbf commit 0309e3e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+12514
-0
lines changed

.changeset/config.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"ignore": ["playground", "nextjs-example"],
6+
"access": "public",
7+
"updateInternalDependencies": "patch",
8+
"baseBranch": "main",
9+
"bumpVersionsWithWorkspaceProtocolOnly": true
10+
}

.eslintrc.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
extends: ['react-app', 'plugin:prettier/recommended'],
3+
plugins: ['simple-import-sort'],
4+
settings: {
5+
react: {
6+
version: 'detect',
7+
},
8+
},
9+
rules: {
10+
'simple-import-sort/imports': 'error',
11+
'sort-imports': 'off',
12+
'import/order': 'off',
13+
'import/no-anonymous-default-export': 'off',
14+
},
15+
};
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: devrnt
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Codesandbox link**
21+
Include a codesandox will help us to investigate the issue quicker.
22+
23+
**Expected behavior**
24+
A clear and concise description of what you expected to happen.
25+
26+
**Screenshots**
27+
If applicable, add screenshots to help explain your problem.
28+
29+
**Desktop (please complete the following information):**
30+
- OS: [e.g. iOS]
31+
- Browser [e.g. chrome, safari]
32+
- Version [e.g. 22]
33+
34+
**Smartphone (please complete the following information):**
35+
- Device: [e.g. iPhone6]
36+
- OS: [e.g. iOS8.1]
37+
- Browser [e.g. stock browser, safari]
38+
- Version [e.g. 22]
39+
40+
**Additional context**
41+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: devrnt
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/dependabot.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "04:00"
8+
open-pull-requests-limit: 10
9+
ignore:
10+
- dependency-name: cypress
11+
versions:
12+
- 6.3.0
13+
- 6.7.1
14+
- 7.0.0
15+
- dependency-name: "@types/react"
16+
versions:
17+
- 17.0.3
18+
- dependency-name: husky
19+
versions:
20+
- 5.1.0
21+
- 5.1.2
22+
- dependency-name: np
23+
versions:
24+
- 7.4.0
25+
- dependency-name: typescript
26+
versions:
27+
- 4.1.4
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ main ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ main ]
20+
schedule:
21+
- cron: '45 18 * * 3'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-20.04
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
language: [ 'javascript' ]
32+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
33+
# Learn more:
34+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
35+
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v3
39+
40+
# Initializes the CodeQL tools for scanning.
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v1
43+
with:
44+
languages: ${{ matrix.language }}
45+
# If you wish to specify custom queries, you can do so here or in a config file.
46+
# By default, queries listed here will override any specified in a config file.
47+
# Prefix the list here with "+" to use these queries and those in the config file.
48+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
49+
50+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
51+
# If this step fails, then you should remove it and run the build manually (see below)
52+
- name: Autobuild
53+
uses: github/codeql-action/autobuild@v1
54+
55+
# ℹ️ Command-line programs to run using the OS shell.
56+
# 📚 https://git.io/JvXDl
57+
58+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
59+
# and modify them (or add more) to build your code if your project
60+
# uses a compiled language
61+
62+
#- run: |
63+
# make bootstrap
64+
# make release
65+
66+
- name: Perform CodeQL Analysis
67+
uses: github/codeql-action/analyze@v1

.github/workflows/deploy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy to Github Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-20.04
11+
strategy:
12+
matrix:
13+
node-version: [18.16]
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
- name: Install pnpm
19+
uses: pnpm/action-setup@v2
20+
with:
21+
version: 8.6.5
22+
23+
- name: Use Node ${{ matrix.node-version }}
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
cache: 'pnpm'
28+
29+
- name: Install dependencies
30+
run: pnpm install --frozen-lockfile
31+
32+
- name: Build playground
33+
run: pnpm build:playground
34+
35+
- name: Deploy
36+
uses: peaceiris/actions-gh-pages@v3
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: ./apps/playground/dist

.github/workflows/e2e-testing.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: End-to-end tests
2+
on: [pull_request]
3+
jobs:
4+
cypress-run:
5+
runs-on: ubuntu-20.04
6+
strategy:
7+
matrix:
8+
node-version: [18]
9+
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
14+
- name: Install pnpm
15+
uses: pnpm/action-setup@v2
16+
with:
17+
version: 8.6.5
18+
19+
- name: Use Node ${{ matrix.node-version }}
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: 'pnpm'
24+
25+
- name: Install dependencies
26+
run: pnpm install --frozen-lockfile
27+
28+
- name: Build
29+
run: pnpm build
30+
31+
- name: Cypress install
32+
run: ./node_modules/cypress/bin/cypress install
33+
34+
- name: Cypress run
35+
uses: cypress-io/github-action@v4
36+
with:
37+
install: false
38+
# build playground
39+
# build: pnpm dev:playground
40+
# start playground
41+
start: pnpm dev
42+
command: pnpm e2e
43+
# FIXME: this breaks it
44+
# wait-on: 'http://localhost:5173'
45+
# project: /packages/react-use-pylon
46+
47+
# after the test run completes
48+
# store videos and any screenshots
49+
# NOTE: screenshots will be generated only if E2E test failed
50+
# thus we store screenshots only on failures
51+
# Alternative: create and commit an empty cypress/screenshots folder
52+
# to always have something to upload
53+
- name: Upload Cypress artifacts
54+
uses: actions/upload-artifact@v3
55+
if: failure()
56+
with:
57+
name: cypress-screenshots
58+
path: ./apps/playground/cypress/screenshots

.github/workflows/main.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-20.04
6+
strategy:
7+
matrix:
8+
node-version: [18.16]
9+
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
14+
- name: Install pnpm
15+
uses: pnpm/action-setup@v2
16+
with:
17+
version: 8.6.5
18+
19+
- name: Use Node ${{ matrix.node-version }}
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: 'pnpm'
24+
25+
- name: Install dependencies
26+
run: pnpm install --frozen-lockfile
27+
28+
- name: Lint
29+
run: pnpm lint
30+
31+
- name: Test
32+
run: pnpm test
33+
34+
- name: Build
35+
run: pnpm build

.github/workflows/pull-request.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Compressed Size
2+
on: [pull_request]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-20.04
6+
strategy:
7+
matrix:
8+
node-version: [18.16]
9+
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
14+
- name: Install pnpm
15+
uses: pnpm/action-setup@v2
16+
with:
17+
version: 8.6.5
18+
19+
- name: Use Node ${{ matrix.node-version }}
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: 'pnpm'
24+
25+
- name: Install dependencies
26+
run: pnpm install --frozen-lockfile
27+
28+
- name: Build
29+
run: pnpm build
30+
31+
- uses: preactjs/compressed-size-action@v2
32+
with:
33+
repo-token: '${{ secrets.GITHUB_TOKEN }}'
34+
pattern: "packages/**/dist/**/*.?(m)js"

0 commit comments

Comments
 (0)