Skip to content

Commit 30bda56

Browse files
authored
Merge pull request #619 from devrnt/revamp
Revamp
2 parents 36a854a + 2e47d3f commit 30bda56

File tree

138 files changed

+11472
-25943
lines changed

Some content is hidden

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

138 files changed

+11472
-25943
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/config@2.0.0/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"ignore": ["playground", "gatsby-example", "nextjs-example"],
6+
"access": "public",
7+
"updateInternalDependencies": "patch",
8+
"baseBranch": "main",
9+
"bumpVersionsWithWorkspaceProtocolOnly": true
10+
}

.changeset/wet-avocados-report.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-use-intercom': patch
3+
---
4+
5+
Restructure project and change build pipeline

.eslintrc.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
module.exports = {
2-
extends: [
3-
'react-app',
4-
'prettier/@typescript-eslint',
5-
'plugin:prettier/recommended',
6-
],
2+
extends: ['react-app', 'plugin:prettier/recommended'],
73
plugins: ['simple-import-sort'],
84
settings: {
95
react: {
@@ -13,6 +9,7 @@ module.exports = {
139
rules: {
1410
'simple-import-sort/imports': 'error',
1511
'sort-imports': 'off',
16-
'import/order': 'off'
17-
}
12+
'import/order': 'off',
13+
'import/no-anonymous-default-export': 'off',
14+
},
1815
};

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ master ]
16+
branches: [ main ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ master ]
19+
branches: [ main ]
2020
schedule:
2121
- cron: '45 18 * * 3'
2222

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ name: Deploy to Github Pages
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77

88
jobs:
99
deploy:
1010
runs-on: ubuntu-20.04
1111
strategy:
1212
matrix:
13-
node-version: [18]
13+
node-version: [18.14]
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v3
@@ -39,4 +39,4 @@ jobs:
3939
uses: peaceiris/actions-gh-pages@v3
4040
with:
4141
github_token: ${{ secrets.GITHUB_TOKEN }}
42-
publish_dir: ./playground/dist
42+
publish_dir: ./apps/playground/dist

.github/workflows/e2e-testing.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-20.04
66
strategy:
77
matrix:
8-
node-version: [16,18]
8+
node-version: [18]
99

1010
steps:
1111
- name: Checkout
@@ -25,14 +25,34 @@ jobs:
2525
- name: Install dependencies
2626
run: pnpm install --frozen-lockfile
2727

28+
- name: Build
29+
run: pnpm build
30+
2831
- name: Cypress install
2932
run: ./node_modules/cypress/bin/cypress install
3033

3134
- name: Cypress run
32-
uses: cypress-io/github-action@v5
35+
uses: cypress-io/github-action@v4
3336
with:
3437
install: false
35-
start: pnpm start:playground
36-
wait-on: 'http://localhost:1234'
37-
browser: chrome
38-
headless: true
38+
# build playground
39+
# build: pnpm dev:playground
40+
# start playground
41+
start: pnpm dev:playground
42+
command: pnpm e2e
43+
# FIXME: this breaks it
44+
# wait-on: 'http://localhost:5173'
45+
# project: /packages/react-use-intercom
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: ./packages/react-use-intercom/cypress/screenshots

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-20.04
66
strategy:
77
matrix:
8-
node-version: [16,18]
8+
node-version: [18.14]
99

1010
steps:
1111
- name: Checkout
@@ -29,7 +29,7 @@ jobs:
2929
run: pnpm lint
3030

3131
- name: Test
32-
run: pnpm test -- --coverage --maxWorkers=2
32+
run: pnpm test
3333

3434
- name: Build
3535
run: pnpm build

.github/workflows/pull-request.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-20.04
66
strategy:
77
matrix:
8-
node-version: [18]
8+
node-version: [18.14]
99

1010
steps:
1111
- name: Checkout
@@ -25,6 +25,10 @@ jobs:
2525
- name: Install dependencies
2626
run: pnpm install --frozen-lockfile
2727

28+
- name: Build
29+
run: pnpm build
30+
2831
- uses: preactjs/compressed-size-action@v2
2932
with:
3033
repo-token: '${{ secrets.GITHUB_TOKEN }}'
34+
pattern: "packages/**/dist/**/*.?(m)js"

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-20.04
14+
strategy:
15+
matrix:
16+
node-version: [18.14]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
22+
- name: Install pnpm
23+
uses: pnpm/action-setup@v2
24+
with:
25+
version: 7
26+
27+
- name: Use Node ${{ matrix.node-version }}
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
cache: 'pnpm'
32+
33+
- name: Install dependencies
34+
run: pnpm install --frozen-lockfile
35+
36+
- name: Create Release Pull Request or Publish to npm
37+
id: changesets
38+
uses: changesets/action@v1
39+
with:
40+
# This expects you to have a script called release which does a build for your packages and calls changeset publish
41+
publish: pnpm release
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,4 @@ node_modules
44
.cache
55
dist
66

7-
config/.env
8-
test/config/.env
9-
10-
/cypress/videos
11-
/cypress/screenshots
12-
/cypress/fixtures
13-
14-
.parcel-cache
7+
.turbo

0 commit comments

Comments
 (0)