Skip to content

Commit 10fc50d

Browse files
authored
Merge pull request #189 from ASU/uds-494-core-ui-buttons
feat(components-core): Implement core React Buttons
2 parents 5c31bbb + 5dccd8d commit 10fc50d

File tree

32 files changed

+2894
-1656
lines changed

32 files changed

+2894
-1656
lines changed

.vscode/settings.json

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
11
{
2-
"editor.rulers": [
3-
80
4-
],
2+
"editor.rulers": [80],
53
"editor.wordWrapColumn": 80,
64
"editor.detectIndentation": false,
75
"editor.tabSize": 2,
8-
"eslint.autoFixOnSave": true,
9-
"eslint.validate": [
10-
"javascript",
11-
"javascriptreact",
12-
],
13-
"editor.codeActionsOnSave": {
14-
"source.fixAll.eslint": true
15-
},
16-
"editor.formatOnSave": true,
17-
"[javascript]": {
18-
"editor.formatOnSave": false
19-
},
20-
"[javascriptreact]": {
21-
"editor.formatOnSave": false
22-
},
236
"files.trimTrailingWhitespace": true,
247
"files.insertFinalNewline": true,
258
"files.exclude": {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"eslint-config-prettier": "^8.2.0",
5858
"eslint-plugin-import": "^2.22.1",
5959
"eslint-plugin-import-helpers": "^1.1.0",
60+
"eslint-plugin-jest": "^24.3.5",
6061
"eslint-plugin-jsx-a11y": "^6.4.1",
6162
"eslint-plugin-prettier": "^3.4.0",
6263
"eslint-plugin-react": "^7.23.2",

packages/components-core/.eslintrc.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = {
1212
"plugin:react/recommended",
1313
"airbnb",
1414
"plugin:prettier/recommended", // Make this the last element so prettier config overrides other formatting rules
15+
// "plugin:jest/recommended",
1516
],
1617
parserOptions: {
1718
ecmaFeatures: {
@@ -20,10 +21,14 @@ module.exports = {
2021
ecmaVersion: 12,
2122
sourceType: "module",
2223
},
23-
plugins: ["react"],
24+
plugins: [
25+
"react",
26+
// "jest"
27+
],
2428
rules: {
2529
"react/jsx-filename-extension": "off",
2630
"prettier/prettier": ["error", {}, { usePrettierrc: true }], // Use our .prettierrc file as source
2731
"dot-notation": "off",
32+
"import/prefer-default-export": "off",
2833
},
2934
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
verbose: true,
3+
setupFilesAfterEnv: ["./setupTests.js"],
4+
transform: {
5+
"^.+\\.js$": "babel-jest",
6+
"^.+\\.css$": "jest-transform-css",
7+
"\\.(jpg|jpeg|png|gif|webp|svg)$": "jest-transform-file",
8+
},
9+
};

packages/components-core/package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "components-core",
2+
"name": "@asu-design-system/components-core",
33
"version": "1.0.0",
44
"description": "Core UDS Preact UI components required by other higher-order Preact packages",
55
"author": "Nathan Rollins <[email protected]>",
@@ -10,8 +10,8 @@
1010
"url": "git+https://github.com/ASU/asu-unity-stack.git"
1111
},
1212
"scripts": {
13-
"lint:disabled": "eslint --fix 'src/**/*.{js,jsx}' --ignore-path ../../.eslintignore",
14-
"test": "echo \"Error: run tests from root\" && exit 1",
13+
"lint": "eslint --fix 'src/**/*.{js,jsx}' --ignore-path ../../.eslintignore",
14+
"test": "jest --config=./jest.config.js",
1515
"start:dev": "webpack-dashboard -- webpack serve -c webpack/webpack.dev.js",
1616
"build": "webpack -c webpack/webpack.prod.js",
1717
"build:stats": "webpack -c webpack/webpack.prod.js --profile --json=compilation-stats.json",
@@ -25,13 +25,21 @@
2525
"@asu-design-system/bootstrap4-theme": "latest",
2626
"@babel/core": "^7.13.14",
2727
"@storybook/addon-actions": "^6.2.3",
28+
"@storybook/addon-docs": "^6.2.9",
2829
"@storybook/addon-essentials": "^6.2.3",
2930
"@storybook/addon-links": "^6.2.3",
3031
"@storybook/react": "^6.2.3",
32+
"@testing-library/react": "^11.2.6",
3133
"babel-loader": "^8.2.2",
3234
"css-loader": "^5.2.0",
3335
"file-loader": "^6.2.0",
3436
"glob": "^7.1.6",
37+
"jest": "^26.6.3",
38+
"jest-image-snapshot": "^4.4.1",
39+
"jest-transform-css": "^2.1.0",
40+
"jest-transform-file": "^1.1.1",
41+
"jsdom-screenshot": "^4.0.0",
42+
"postcss": "^7.0.2",
3543
"semantic-release": "^17.4.2",
3644
"semantic-release-monorepo": "^7.0.4",
3745
"storybook-css-modules-preset": "^1.0.7",
@@ -51,6 +59,7 @@
5159
"react": "^16.14.0",
5260
"react-dom": "^16.14.0",
5361
"react-reveal": "^1.2.2",
62+
"react-router-dom": "^5.2.0",
5463
"react-share": "^4.4.0",
5564
"reactstrap": "^8.9.0"
5665
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { toMatchImageSnapshot } from 'jest-image-snapshot';
2+
3+
expect.extend({ toMatchImageSnapshot });

packages/components-core/src/components/Article/index.css

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

0 commit comments

Comments
 (0)