Skip to content

Commit f6d2351

Browse files
authored
Move build from TSDX to Vite (#534)
1 parent 31999ac commit f6d2351

Some content is hidden

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

69 files changed

+39107
-81912
lines changed

.eslintrc.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:react/recommended",
9+
"plugin:react/jsx-runtime",
10+
"plugin:react-hooks/recommended",
11+
"plugin:@typescript-eslint/recommended"
12+
],
13+
"parser": "@typescript-eslint/parser",
14+
"parserOptions": {
15+
"ecmaFeatures": {
16+
"jsx": true
17+
},
18+
"ecmaVersion": "latest",
19+
"sourceType": "module"
20+
},
21+
"plugins": [
22+
"react",
23+
"@typescript-eslint",
24+
"no-only-tests"
25+
],
26+
"rules": {
27+
"no-only-tests/no-only-tests": "error",
28+
"@typescript-eslint/no-explicit-any": "warn",
29+
"@typescript-eslint/no-inferrable-types": "warn",
30+
"@typescript-eslint/ban-types": "warn",
31+
"no-prototype-builtins": "warn",
32+
"prefer-const": "warn",
33+
"react/no-unescaped-entities": "warn",
34+
"@typescript-eslint/no-empty-function": "warn"
35+
}
36+
}

.github/CONTRIBUTING.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,18 @@ set up.
7171
1. [Clone](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository)
7272
this repository (or a
7373
[fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo#propose-changes-to-someone-elses-project))
74-
1. At the project root, install all modules by running `yarn install`.
75-
1. Start a dev build of reactfire by running `yarn start`. ReactFire will recompile on every file change.
74+
1. At the project root, install all modules by running `npm install`.
75+
1. Start a dev build of reactfire by running `npm run start`. ReactFire will recompile on every file change.
7676

7777
### Testing
7878

79-
1. run `yarn test` from the repository root. Make sure you've rebuilt your changes (usually by keeping `yarn start` running in a separate tab).
79+
1. run `npm run test` from the repository root. Make sure you've rebuilt your changes (usually by keeping `npm run start` running in a separate tab).
8080

8181
### Before submitting a PR
8282

83-
1. run `yarn build` to confirm that the source builds
84-
2. run `yarn test` to confirm that tests pass
85-
3. run `yarn lint` to confirm that code meets our style guide
86-
> If the lint check fails, run `yarn lint --fix` to automatically fix any issues.
87-
5. run `yarn docs` to rebuild the reference docs
88-
> If you've forked the repo, run `yarn docs:fork` instead. This will ensure the reference docs link to the firebaseextended/reactfire repository.
83+
1. run `npm run build` to confirm that the source builds
84+
2. run `npm run test` to confirm that tests pass
85+
3. run `npm run lint` to confirm that code meets our style guide
86+
> If the lint check fails, run `npm run lint --fix` to automatically fix any issues.
87+
5. run `npm run docs` to rebuild the reference docs
88+
> If you've forked the repo, run `npm run docs:fork` instead. This will ensure the reference docs link to the firebaseextended/reactfire repository.

.github/workflows/docs.yaml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,14 @@ jobs:
1111
- name: Checkout
1212
uses: actions/checkout@v2
1313
- name: Setup node
14-
uses: actions/setup-node@v2-beta
14+
uses: actions/setup-node@v3
1515
with:
1616
node-version: '14'
17-
- name: node_modules cache
18-
id: node_modules_cache
19-
uses: actions/cache@v2
20-
with:
21-
path: ./node_modules
22-
key: ${{ runner.os }}-14-node_modules-${{ hashFiles('**/yarn.lock') }}
23-
restore-keys: |
24-
${{ runner.os }}-14-node_modules-
25-
- name: Yarn offline cache
26-
if: steps.node_modules_cache.outputs.cache-hit != 'true'
27-
uses: actions/cache@v2
28-
with:
29-
path: ~/.npm-packages-offline-cache
30-
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
31-
restore-keys: yarn-offline
17+
cache: 'npm'
3218
- name: Install deps
33-
if: steps.node_modules_cache.outputs.cache-hit != 'true'
34-
run: |
35-
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
36-
yarn config set yarn-offline-mirror-pruning true
37-
yarn install --frozen-lockfile --prefer-offline
19+
run: npm ci
3820
- name: Generate reference docs
39-
run: yarn docs
21+
run: npm run docs
4022
- name: Check for diff
4123
run: git diff --exit-code -- 'docs/reference***.md'
4224

.github/workflows/test.yaml

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,14 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v2
2323
- name: Setup node
24-
uses: actions/setup-node@v2-beta
24+
uses: actions/setup-node@v3
2525
with:
2626
node-version: '14'
27-
- name: node_modules cache
28-
id: node_modules_cache
29-
uses: actions/cache@v2
30-
with:
31-
path: ./node_modules
32-
key: ${{ runner.os }}-14-node_modules-${{ hashFiles('**/yarn.lock') }}
33-
restore-keys: |
34-
${{ runner.os }}-14-node_modules-
35-
- name: Yarn offline cache
36-
if: steps.node_modules_cache.outputs.cache-hit != 'true'
37-
uses: actions/cache@v2
38-
with:
39-
path: ~/.npm-packages-offline-cache
40-
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
41-
restore-keys: yarn-offline
27+
cache: 'npm'
4228
- name: Install deps
43-
if: steps.node_modules_cache.outputs.cache-hit != 'true'
44-
run: |
45-
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
46-
yarn config set yarn-offline-mirror-pruning true
47-
yarn install --frozen-lockfile --prefer-offline
29+
run: npm ci
4830
- name: Build
49-
id: yarn-pack-dir
31+
id: pack-dir
5032
run: ./build.sh
5133
- name: 'Upload Artifact'
5234
uses: actions/upload-artifact@v2
@@ -62,37 +44,20 @@ jobs:
6244
needs: build
6345
strategy:
6446
matrix:
65-
node: ["12", "14"]
47+
node: ["14", "16"]
6648
fail-fast: false
6749
name: Test Node.js ${{ matrix.node }} (Ubuntu)
6850
steps:
6951
- name: Checkout
7052
uses: actions/checkout@v2
7153
- name: Setup node
72-
uses: actions/setup-node@v2-beta
54+
uses: actions/setup-node@v3
7355
with:
7456
node-version: ${{ matrix.node }}
7557
check-latest: true
76-
- name: node_modules cache
77-
id: node_modules_cache
78-
uses: actions/cache@v2
79-
with:
80-
path: ./node_modules
81-
key: ${{ runner.os }}-${{ matrix.node }}-node_modules-${{ hashFiles('**/yarn.lock') }}
82-
restore-keys: |
83-
${{ runner.os }}-${{ matrix.node }}-node_modules-
84-
- name: Yarn offline cache
85-
if: steps.node_modules_cache.outputs.cache-hit != 'true'
86-
uses: actions/cache@v2
87-
with:
88-
path: ~/.npm-packages-offline-cache
89-
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
90-
restore-keys: yarn-offline
58+
cache: 'npm'
9159
- name: Install deps
92-
if: steps.node_modules_cache.outputs.cache-hit != 'true'
93-
run: |
94-
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
95-
yarn install --frozen-lockfile --prefer-offline
60+
run: npm ci
9661
- name: Install deps for functions
9762
run: npm install
9863
working-directory: ./functions
@@ -108,15 +73,15 @@ jobs:
10873
chmod +x reactfire-${{ github.run_id }}/unpack.sh
10974
./reactfire-${{ github.run_id }}/unpack.sh
11075
- name: Run tests
111-
run: yarn test
76+
run: npm run test
11277
publish:
11378
runs-on: ubuntu-latest
11479
name: Publish (NPM)
11580
needs: test
11681
if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'release' }}
11782
steps:
11883
- name: Setup node
119-
uses: actions/setup-node@v2-beta
84+
uses: actions/setup-node@v3
12085
with:
12186
node-version: '14'
12287
registry-url: 'https://registry.npmjs.org'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ unpack.sh
2727

2828
example/.parcel-cache/
2929
.firebaserc
30+
stats.html

babel.config.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ else
1515
fi;
1616

1717
npm --no-git-tag-version --allow-same-version -f version $OVERRIDE_VERSION
18-
yarn build
18+
npm run build
1919
TARBALL=$(npm pack . | tail -n 1)
2020
mv $TARBALL reactfire.tgz
2121

docs/quickstart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ npm install --save firebase reactfire
172172
1. Run your app.
173173

174174
```bash
175-
yarn start
175+
npm run start
176176

177177
# or
178178

179-
npm run start
179+
yarn start
180180
```
181181

182182
1. Edit the value of `yummy` in the _Database_ tab in the [Firebase console](https://console.firebase.google.com) and watch it update in real time in your app! 🔥🔥🔥

0 commit comments

Comments
 (0)