Skip to content

Commit c41fc29

Browse files
author
Konstantine Kalbazov
committed
Merge branch 'refactor/vite'
2 parents 1219bcd + 8a842b8 commit c41fc29

Some content is hidden

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

59 files changed

+3598
-67300
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// "forwardPorts": [],
2222

2323
// Use 'postCreateCommand' to run commands after the container is created.
24-
"postCreateCommand": ["npm install", "npm run bootstrap", "npm run build"],
24+
"postCreateCommand": ["bun install", "bun run build"],
2525

2626
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
2727
"remoteUser": "node",

.eslintrc.react.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ plugins:
1616

1717
rules:
1818
react/button-has-type: error
19-
react/default-props-match-prop-types: error
2019
react/destructuring-assignment: error
2120
react/display-name: off
2221
react/forbid-component-props:
@@ -46,7 +45,6 @@ rules:
4645
react/no-will-update-set-state: error
4746
react/prefer-es6-class: error
4847
react/prefer-read-only-props: error
49-
react/require-default-props: error
5048
react/self-closing-comp: error
5149
react/sort-prop-types:
5250
- error
@@ -94,9 +92,6 @@ rules:
9492
- element
9593
react/jsx-pascal-case: error
9694
react/jsx-props-no-multi-spaces: error
97-
react/jsx-sort-default-props:
98-
- error
99-
- ignoreCase: true
10095
react/jsx-sort-props:
10196
- error
10297
- ignoreCase: true

.eslintrc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ rules:
164164

165165
# Cannot group global or local imports and sort in differently
166166
sort-imports:
167-
- error
167+
- off
168168
- allowSeparatedGroups: true
169169
ignoreCase: true
170170
memberSyntaxSortOrder:
@@ -182,4 +182,4 @@ rules:
182182
- after
183183

184184
# plugin:prettier
185-
prettier/prettier: error
185+
prettier/prettier: off

.github/workflows/ci.yml

Lines changed: 53 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
1+
# This workflow will do a clean install of bun dependencies, build the source code and run tests across different versions of bun
2+
# For more information see: https://github.com/oven-sh/setup-bun
33

44
name: Continuous integration and deployment
55

@@ -21,56 +21,56 @@ jobs:
2121

2222
strategy:
2323
matrix:
24-
node-version: [16.x]
24+
bun-version: [latest]
2525

2626
steps:
2727
- name: Checking out for ${{ github.ref }}
28-
uses: actions/checkout@v2
28+
uses: actions/checkout@v3
2929

30-
- name: Using Node.js ${{ matrix.node-version }}
31-
uses: actions/setup-node@v1
30+
- name: Using Bun ${{ matrix.bun-version }}
31+
uses: oven-sh/setup-bun@v1
3232
with:
33-
node-version: ${{ matrix.node-version }}
33+
bun-version: ${{ matrix.bun-version }}
3434

35-
- name: Running npx version-from-git --no-git-tag-version
35+
- name: Running version-from-git --no-git-tag-version
3636
if: ${{ startsWith(github.ref, 'refs/heads/') }}
37-
run: npx version-from-git --no-git-tag-version
37+
run: bun x version-from-git --no-git-tag-version
3838

3939
- name: Installing dependencies
40-
run: npm ci
40+
run: bun install
4141

42-
- name: Bootstrapping packages
43-
run: npm run bootstrap
44-
45-
- name: Propagating versions
42+
- name: Setting package version
4643
run: |
47-
node_modules/.bin/lerna version --force-publish --no-git-tag-version --no-push --yes `cat package.json | jq -r .version`
44+
VERSION=$(cat package.json | jq -r .version)
45+
echo "Using version: $VERSION"
46+
# Update all workspace package versions to match root package.json
47+
bun x workspaces-update-version $VERSION --force-publish --no-git-tag-version --no-push --yes
4848
4949
- name: Building for production
5050
env:
5151
NODE_ENV: production
5252
SKIP_PREFLIGHT_CHECK: 'true'
53-
run: npm run build --if-present
53+
run: bun run build --if-present
5454

5555
- name: Copying documents
5656
run: |
5757
cp CHANGELOG.md packages/component
5858
cp LICENSE packages/component
5959
cp README.md packages/component
6060
61-
- name: Running npm pack
61+
- name: Running bun pack
6262
run: |
6363
cd packages/component
64-
npm pack
64+
bun pack
6565
6666
- name: Uploading npm-tarball
67-
uses: actions/upload-artifact@v2
67+
uses: actions/upload-artifact@v3
6868
with:
6969
name: npm-tarball
7070
path: 'packages/component/*.tgz'
7171

7272
- name: Uploading gh-pages
73-
uses: actions/upload-artifact@v2
73+
uses: actions/upload-artifact@v3
7474
with:
7575
name: gh-pages
7676
path: 'packages/playground/build/**/*'
@@ -82,50 +82,51 @@ jobs:
8282

8383
strategy:
8484
matrix:
85-
node-version: [14.x, 16.x]
85+
bun-version: [latest, canary]
8686

8787
steps:
8888
- name: Checking out for ${{ github.ref }}
89-
uses: actions/checkout@v2
89+
uses: actions/checkout@v3
9090

91-
- name: Using Node.js ${{ matrix.node-version }}
92-
uses: actions/setup-node@v1
91+
- name: Using Bun ${{ matrix.bun-version }}
92+
uses: oven-sh/setup-bun@v1
9393
with:
94-
node-version: ${{ matrix.node-version }}
94+
bun-version: ${{ matrix.bun-version }}
9595

96-
- name: Running npx version-from-git --no-git-tag-version
96+
- name: Running version-from-git --no-git-tag-version
9797
if: ${{ startsWith(github.ref, 'refs/heads/') }}
98-
run: npx version-from-git --no-git-tag-version
98+
run: bun x version-from-git --no-git-tag-version
9999

100100
- name: Installing dependencies
101-
run: npm ci
102-
103-
- name: Bootstrapping packages
104-
run: npm run bootstrap
101+
run: bun install
105102

106-
- name: Propagating versions
107-
run: node_modules/.bin/lerna version --force-publish --no-git-tag-version --no-push --yes `cat package.json | jq -r .version`
103+
- name: Setting package version
104+
run: |
105+
VERSION=$(cat package.json | jq -r .version)
106+
echo "Using version: $VERSION"
107+
# Update all workspace package versions to match root package.json
108+
bun x workspaces-update-version $VERSION --force-publish --no-git-tag-version --no-push --yes
108109
109110
- name: Running static code analysis
110111
run: |
111112
cd packages/component
112-
npm run precommit src/
113+
bun run precommit src/
113114
114115
- name: Building for instrumentation
115116
env:
116117
NODE_ENV: test
117118
SKIP_PREFLIGHT_CHECK: 'true'
118-
run: npm run build --if-present
119+
run: bun run build --if-present
119120

120121
- name: Starting Docker Compose
121-
run: npm run docker:up -- --detach
122+
run: bun run docker:up -- --detach
122123

123124
- name: Testing
124-
run: npm test -- --coverage
125+
run: bun test -- --coverage
125126

126127
- if: always()
127128
name: Stopping Docker Compose
128-
run: npm run docker:down
129+
run: bun run docker:down
129130

130131
# "public" job will only run when merging a commit or tag.
131132
# It does not depends on "test" because we assume it already passed pull request status checks and "test" can be unreliable at times.
@@ -137,33 +138,38 @@ jobs:
137138

138139
steps:
139140
- name: Downloading npm-tarball
140-
uses: actions/download-artifact@v2
141+
uses: actions/download-artifact@v3
141142
with:
142143
name: npm-tarball
143144

144145
- name: Downloading gh-pages
145-
uses: actions/download-artifact@v2
146+
uses: actions/download-artifact@v3
146147
with:
147148
name: gh-pages
148149
path: gh-pages/
149150

150151
- name: Reading package.json
151152
id: read-package-json
152153
run: |
153-
echo "::set-output name=name::$(tar xOf *.tgz package/package.json | jq -r '.name')"
154-
echo "::set-output name=version::$(tar xOf *.tgz package/package.json | jq -r '.version')"
155-
echo "::set-output name=tarball::$(ls *.tgz)"
156-
echo "::set-output name=date::$(date +%Y-%m-%d)"
154+
echo "name=$(tar xOf *.tgz package/package.json | jq -r '.name')" >> $GITHUB_OUTPUT
155+
echo "version=$(tar xOf *.tgz package/package.json | jq -r '.version')" >> $GITHUB_OUTPUT
156+
echo "tarball=$(ls *.tgz)" >> $GITHUB_OUTPUT
157+
echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
158+
159+
- name: Using Bun
160+
uses: oven-sh/setup-bun@v1
161+
with:
162+
bun-version: latest
157163

158164
- name: Publishing ${{ steps.read-package-json.outputs.name }}@${{ steps.read-package-json.outputs.version }}
159165
run: |
160-
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
161-
npm publish *.tgz --tag main
166+
bun config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
167+
bun publish *.tgz --tag main
162168
163169
- name: Tagging dist-tag ${{ steps.read-package-json.outputs.name }}@${{ steps.read-package-json.outputs.version }} latest
164170
if: ${{ startsWith(github.ref, 'refs/tags/') }}
165171
run: |
166-
npm dist-tag add ${{ steps.read-package-json.outputs.name }}@${{ steps.read-package-json.outputs.version }} latest
172+
bun dist-tag add ${{ steps.read-package-json.outputs.name }}@${{ steps.read-package-json.outputs.version }} latest
167173
168174
- name: Drafting a new release
169175
uses: actions/create-release@v1

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/.env
22
/chromedriver*
33
/coverage
4-
/lerna-debug.log
54
/lib
6-
/node_modules
5+
node_modules/

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@ export default props => (
7171
| `followButtonClassName` | `string` | | Set the class name for the follow button |
7272
| `initialScrollBehavior` | `string` | `smooth` | Set the initial scroll behavior, either `"auto"` (discrete scrolling) or `"smooth"` |
7373
| `mode` | `string` | `"bottom"` | Set it to `"bottom"` for scroll-to-bottom, `"top"` for scroll-to-top |
74-
| `nonce` | `string` | | Set the nonce for [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) |
7574
| `scroller` | `function` | `() => Infinity` | A function to determine how far should scroll when scroll is needed |
7675
| `scrollViewClassName` | `string` | | Set the class name for the container element that house all `props.children` |
77-
| `styleOptions.stylesRoot` | `Node` | `undefined` | Set the container node for component styles to be placed into. When set to `undefined`, will use `document.head` |
7876

7977
## Hooks
8078

@@ -427,12 +425,6 @@ By default, the `scroller` function will returns `Infinity`. When new content is
427425

428426
You can return a different value (in number) to indicates how far you want to scroll when the content has changed. If you return `0`, the scrollable will stop scrolling for any new content. Returning any values less than `maxValue` will make the scrollable to lose its stickiness after animation. After the scrollable lose its stickiness, the `scroller` function will not be called again for any future content change, until the scrollable regains its stickiness.
429427

430-
# Security
431-
432-
We support nonce-based [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy). To enable, the following directive is required:
433-
434-
- [`style-src 'nonce-XXX'`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src)
435-
436428
# Road map
437429

438430
- [x] Easier customization for "scroll to bottom" button

0 commit comments

Comments
 (0)