Skip to content

Commit d818d02

Browse files
committed
Merge branch 'swapping-webpack-for-ts-compiler'
2 parents 2fc0a0b + dcc3c22 commit d818d02

Some content is hidden

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

70 files changed

+59866
-16408
lines changed

.eslintrc.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ const aliases = require('./scripts/aliases.js');
44

55
module.exports = {
66
extends: [
7+
'eslint:recommended',
78
'airbnb',
89
'plugin:prettier/recommended',
910
'plugin:storybook/recommended',
1011
'plugin:testing-library/dom',
12+
'plugin:@typescript-eslint/recommended',
1113
],
1214
plugins: ['prettier', 'react-hooks', 'typescript'],
1315
overrides: [
@@ -23,7 +25,7 @@ module.exports = {
2325
browser: true,
2426
jest: true,
2527
},
26-
parser: 'babel-eslint',
28+
parser: '@typescript-eslint/parser',
2729
parserOptions: {
2830
ecmaVersion: 8,
2931
ecmaFeatures: {

.github/workflows/main.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ jobs:
3030
# Setup .npmrc file to publish to GitHub Packages
3131
- uses: actions/setup-node@v2
3232
with:
33-
node-version: '12.x'
33+
node-version: '16.x'
3434
registry-url: 'https://registry.npmjs.org'
3535

36-
3736
- name: Get the version
3837
id: get_version
3938
run: echo ::set-output name=VERSION::$( git describe --tag --abbrev=0 )
@@ -55,12 +54,13 @@ jobs:
5554

5655
- uses: actions/setup-node@v2
5756
with:
58-
node-version: '12.x'
57+
node-version: '16.x'
5958
registry-url: 'https://npm.pkg.github.com'
59+
scope: '@shenato'
6060

6161
- name: Prefix with scope
6262
run: npm run prepublishGit
63-
63+
6464
- name: publish-git
6565
run: npm publish
6666
env:

.github/workflows/test.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
# Setup .npmrc file to publish to GitHub Packages
1818
- uses: actions/setup-node@v2
1919
with:
20-
node-version: '12.x'
20+
node-version: '16.x'
2121
registry-url: 'https://registry.npmjs.org'
2222

2323
- run: npm ci
@@ -26,5 +26,7 @@ jobs:
2626

2727
- run: npm run build
2828

29+
- run: npm run build-storybook
30+
2931
- name: run unit tests
3032
run: npm test

.storybook/main.js

+22-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ const SRC_DIR = path.resolve(ROOT_DIR, '/src');
99
// Export a function. Accept the base config as the only param.
1010
module.exports = {
1111
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
12+
13+
typescript: {
14+
reactDocgen: false,
15+
},
1216
addons: [
1317
'@storybook/addon-links',
1418
'@storybook/addon-essentials',
@@ -34,9 +38,7 @@ module.exports = {
3438
// Make whatever fine-grained changes you need
3539
config.module.rules.push({
3640
test: /\.(js|jsx)$/,
37-
exclude: {
38-
test: path.resolve(ROOT_DIR, 'node_modules'),
39-
},
41+
exclude: [path.resolve(ROOT_DIR, 'node_modules')],
4042
use: {
4143
loader: 'babel-loader',
4244
options: {
@@ -56,7 +58,14 @@ module.exports = {
5658
config.module.rules.push({
5759
test: /\.(ts|tsx)$/,
5860
exclude: /node_modules/,
59-
use: ['ts-loader'],
61+
use: [
62+
{
63+
loader: 'ts-loader',
64+
options: {
65+
configFile: 'tsconfig.node.json',
66+
},
67+
},
68+
],
6069
});
6170
config.resolve.extensions.push('.ts', '.tsx');
6271
// Alternately, for an alias:
@@ -70,4 +79,13 @@ module.exports = {
7079
// Return the altered config
7180
return config;
7281
},
82+
83+
framework: {
84+
name: '@storybook/react-webpack5',
85+
options: {},
86+
},
87+
88+
docs: {
89+
autodocs: true,
90+
},
7391
};

.storybook/preview.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { addDecorator } from '@storybook/react';
21

32
import 'minireset.css/minireset.min.css';
43

5-
addDecorator(storyFn => storyFn());
64

75
export const parameters = {
86
actions: { argTypesRegex: '^on[A-Z].*' },

.vscode/settings.json

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
{
22
"typescript.tsdk": "node_modules/typescript/lib",
3-
"peacock.color": "#fd9d5a",
4-
"workbench.colorCustomizations": {
5-
"sash.hoverBorder": "#febb8c",
6-
"statusBar.background": "#fd9d5a",
7-
"statusBar.foreground": "#15202b",
8-
"statusBarItem.hoverBackground": "#fc7f28",
9-
"statusBarItem.remoteBackground": "#fd9d5a",
10-
"statusBarItem.remoteForeground": "#15202b"
11-
}
3+
"peacock.color": "#fd9d5a"
124
}

demos/create-react-app/.gitignore

+23
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*

demos/create-react-app/README.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Getting Started with Create React App
2+
3+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4+
5+
## How to test the library against nextjs demo
6+
- in root of project, run `npm run test-lib-build` if you haven't already to generate the `g-loot-react-tournament-brackets-1.0.0.tar.gz` local package for testing
7+
- `cd demos/create-react-app`
8+
- run `npm install`
9+
- run the development server: with `npm run start`
10+
11+
12+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13+
14+
15+
## Available Scripts
16+
17+
In the project directory, you can run:
18+
19+
### `npm start`
20+
21+
Runs the app in the development mode.\
22+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
23+
24+
The page will reload if you make edits.\
25+
You will also see any lint errors in the console.
26+
27+
### `npm test`
28+
29+
Launches the test runner in the interactive watch mode.\
30+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
31+
32+
### `npm run build`
33+
34+
Builds the app for production to the `build` folder.\
35+
It correctly bundles React in production mode and optimizes the build for the best performance.
36+
37+
The build is minified and the filenames include the hashes.\
38+
Your app is ready to be deployed!
39+
40+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

0 commit comments

Comments
 (0)