Skip to content

Commit f054a76

Browse files
committed
Migrate demo app to CRA
1 parent c3e2c3d commit f054a76

Some content is hidden

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

53 files changed

+11190
-3310
lines changed

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
public
1+
app
22
dist

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ jobs:
4141
run: yarn lint
4242
- name: Run test
4343
run: yarn test:cov
44-
- name: Run build
45-
run: yarn build:dist
44+
- name: Run build package
45+
run: yarn build:prod
4646

4747
- name: Coveralls GitHub Action
4848
uses: coverallsapp/github-action@master
@@ -69,13 +69,13 @@ jobs:
6969
${{ runner.os }}-yarn-
7070
- name: Install dependencies
7171
run: yarn install --frozen-lockfile
72-
- name: Run build
72+
- name: Run build demo app
7373
run: yarn build:demo
7474

7575
- name: Netlify GitHub Action
7676
uses: netlify/actions/cli@master
7777
with:
78-
args: deploy --prod --dir=public
78+
args: deploy --prod --dir=app/build
7979
env:
8080
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
8181
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
*.log
33

44
node_modules
5-
demo/.dev
6-
public
75
dist
86
coverage
9-
.size-snapshot.json
7+
.size-snapshot.json

.prettierignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
*.log
2-
demo/.dev
3-
public
2+
app
43
dist
54
coverage
6-
.size-snapshot.json
5+
.size-snapshot.json

.stylelintrc.js

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

CONTRIBUTING.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,38 @@ Please note we have a [code of conduct](CODE_OF_CONDUCT.md), please follow it in
1313
3. If you’ve fixed a bug or added code that should be tested.
1414
4. Ensure the test suite passes by running `yarn test`.
1515
5. Update the [README.md](README.md) with details of changes to the interface.
16-
6. Update the [demo app](demo) if needed.
16+
6. Update the [demo app](app/src) if needed.
1717
7. Make sure your code lints by running `yarn lint`.
1818

1919
## Development Workflow
2020

21-
After cloning USE-WEB-ANIMATIONS, run `yarn` to fetch its dependencies. Then, you can run several commands:
21+
You can test new features or debug an issue by the way that I'm using.
2222

23-
- `yarn dev` runs the [demo app](demo) as your playground at `localhost:10001`. Support live reloading.
23+
1. Run `yarn link-pkg` to link the package into the [app directory](app).
24+
2. Run `yarn start` to create an `ESM` build and type definition file by `rollup` watch mode.
25+
3. Access the [app directory](app).
26+
4. In the **app directory**, run `yarn link-pkg` to link with the package then run `yarn start` to start development.
27+
5. Try something cool via the [demo app](app/src).
28+
29+
## Development Workflow
30+
31+
There're several useful commands that you can use during the development:
32+
33+
- `yarn link-pkg` links the package into the [app directory](app). You can develop or debug it via the [demo app](app/src).
34+
- `yarn start` creates a `dist` folder with an `ESM` build and type definition file by `rollup` watch mode.
2435
- `yarn lint:code` lints all `.js` and `.tsx?` files.
2536
- `yarn lint:type` runs the [TypeScript](https://www.typescriptlang.org) type-checks.
26-
- `yarn lint:style` lints all `.css` and `.tsx?` (for [Emotion](https://emotion.sh)) files.
2737
- `yarn lint:format` formats all files except the file list of `.prettierignore`.
28-
- `yarn lint` lints `code`, `type`, `style`, and `format`.
38+
- `yarn lint` lints `code`, `type`, and `format`.
2939
- `yarn test` runs the complete test suite.
3040
- `yarn test:watch` runs an interactive test watcher (helpful in development).
3141
- `yarn test:cov` runs the complete test suite with coverage report.
32-
- `yarn build:demo` creates a `public` folder with all the static files.
33-
- `yarn build:dist` creates a `dist` folder with package builds (`CJS` & `ESM`) and type definition file. You can test the package locally via [yarn link](https://yarnpkg.com/lang/en/docs/cli/link).
34-
- `yarn build` creates both `public` and `dist`.
35-
- `yarn clean:dev` deletes the `demo/.dev` build folder.
36-
- `yarn clean:demo` deletes the `public` build folder.
42+
- `yarn build:dev` creates a `dist` folder with an `ESM` build and type definition file for development.
43+
- `yarn build:prod` creates a `dist` folder with package builds (`CJS` & `ESM`) and type definition file. You can test the package locally via [yarn link](https://yarnpkg.com/lang/en/docs/cli/link).
3744
- `yarn clean:dist` deletes the `dist` build folder.
45+
- `yarn clean:size` deletes the `.size-snapshot.json` file.
3846
- `yarn clean:cov` deletes the `coverage` report folder.
39-
- `yarn clean` deletes all the build/coverage folders.
47+
- `yarn clean` deletes build, test, and size relevant files.
4048

4149
## Style Guide
4250

app/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build

app/.eslintrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
extends: ["react-app", "welly"],
3+
rules: {
4+
"react/react-in-jsx-scope": "off",
5+
},
6+
};

app/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*

app/.stylelintrc.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
extends: ["stylelint-config-standard", "stylelint-config-prettier"],
3+
customSyntax: "postcss-scss",
4+
rules: {
5+
"at-rule-no-unknown": [
6+
true,
7+
{
8+
ignoreAtRules: ["function", "if", "each", "include", "mixin"],
9+
},
10+
],
11+
},
12+
ignoreFiles: ["build/**/*.css"],
13+
};

0 commit comments

Comments
 (0)