Skip to content

Commit 87a90a5

Browse files
Merge pull request #1346 from ASU/component-consolidation
Component consolidation
2 parents cd62619 + 7eabcca commit 87a90a5

File tree

808 files changed

+62496
-31531
lines changed

Some content is hidden

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

808 files changed

+62496
-31531
lines changed

.env.yarn.example

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

.eslintrc.base.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ module.exports = {
99
// Automatically detect the react version
1010
version: "detect",
1111
},
12+
"import/resolver": {
13+
"node": {
14+
"extensions": [".js", ".jsx", ".ts", ".tsx"]
15+
}
16+
}
1217
},
1318
env: {
1419
browser: true,
@@ -22,6 +27,7 @@ module.exports = {
2227
// Make this the last element so prettier config overrides other formatting rules
2328
"plugin:prettier/recommended",
2429
"plugin:jest/recommended",
30+
// "plugin:import/typescript",
2531
],
2632
parserOptions: {
2733
ecmaFeatures: {
@@ -57,4 +63,45 @@ module.exports = {
5763
},
5864
],
5965
},
66+
overrides: [
67+
{
68+
settings: {
69+
"import/extensions": [".js", ".jsx", ".ts", ".tsx"],
70+
"import/parsers": {
71+
"@typescript-eslint/parser": [".ts", ".tsx"]
72+
},
73+
"import/resolver": {
74+
"node": {
75+
"extensions": [".js", ".jsx", ".ts", ".tsx"]
76+
}
77+
}
78+
},
79+
files: ["*.ts", "*.tsx"],
80+
parser: "@typescript-eslint/parser",
81+
extends: [
82+
"plugin:@typescript-eslint/eslint-recommended",
83+
"plugin:@typescript-eslint/recommended"
84+
],
85+
plugins: ["eslint-plugin-import-helpers", "@typescript-eslint"],
86+
rules: {
87+
"import/extensions": [
88+
"error",
89+
"ignorePackages",
90+
{
91+
"js": "never",
92+
"jsx": "never",
93+
"ts": "never",
94+
"tsx": "never"
95+
}
96+
],
97+
"import/prefer-default-export": "off",
98+
"react/jsx-filename-extension": ["error", { extensions: [".js", ".jsx", ".ts", ".tsx"] }],
99+
"@typescript-eslint/ban-ts-comment": ["warn"],
100+
"no-unused-vars": "off",
101+
"react/require-default-props": "off",
102+
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
103+
"@typescript-eslint/no-empty-function": "off"
104+
}
105+
},
106+
],
60107
};

.github/pull_request_template.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,3 @@
1414
- [Unity reference site](https://asu.github.io/asu-unity-stack/)
1515
- [Unity Design Kit](https://shared-assets.adobe.com/link/fb14b288-bf63-47e0-5d30-384de5560455)
1616

17-
### FOR APPROVERS
18-
19-
- [Percy build approval](https://percy.io/5eae92d9/-all-UDS-packages)

.husky/prepare-commit-msg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@
33
# don't execute if in CI context
44
[ -n "$CI" ] && exit 0
55

6+
# Exit if the commit message is being created by a rebase, merge, or another Git operation
7+
if [ -n "$2" ]; then
8+
exit 0
9+
fi
10+
611
exec < /dev/tty && git cz --hook || true

.storybook-config/dataLayerListener/Panel.js

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import { useAddonState, useChannel } from "@storybook/api";
33
import { styled } from "@storybook/theming";
4-
import { AddonPanel, Button } from "@storybook/components";
4+
import { AddonPanel, Button, Form } from "@storybook/components";
55
import { Source } from '@storybook/blocks';
66
import { ADDON_ID, EVENTS } from "./constants.js";
77

@@ -12,8 +12,9 @@ const SourceWrapper = styled(Source)({
1212
})
1313

1414
export const Panel = (props) => {
15-
const [{dataLayer}, setState] = useAddonState(ADDON_ID, {
16-
dataLayer: []
15+
const [{dataLayer, filter}, setState] = useAddonState(ADDON_ID, {
16+
dataLayer: [],
17+
filter: "!gtm.",
1718
});
1819

1920
// useChannel({
@@ -30,8 +31,31 @@ export const Panel = (props) => {
3031
setState((state) => ({ ...state, dataLayer: [] }));
3132
}
3233

34+
const handleChange= (e) => {
35+
const {target: {value = ""}} = e;
36+
setState((state) => ({ ...state, filter: value }));
37+
}
38+
39+
const filteredData = dataLayer.filter(({event}) => {
40+
/**
41+
* A lot of events are logged with prefix "gtm." and creates a lot of noise,
42+
* most of the time we just want to see the events we are triggering.
43+
* Leaving the option to not filter out gtm events.
44+
*/
45+
if (filter.slice(0,1) === "") {
46+
return true;
47+
} else if (filter.slice(0,1) === "!" && filter.slice(1).length > 0) {
48+
return event.indexOf(filter.slice(1)) === -1;
49+
} else if (filter.length > 0) {
50+
return event.indexOf(filter) > -1;
51+
}
52+
});
53+
3354
return (
3455
<AddonPanel {...props}>
56+
<Form.Field label="Event filter">
57+
<Form.Input id="filter" placeholder="filter" value={filter} onChange={handleChange}/>
58+
</Form.Field>
3559
<Button
3660
small
3761
primary
@@ -46,7 +70,7 @@ export const Panel = (props) => {
4670
>
4771
Clear
4872
</Button>
49-
<SourceWrapper code={`${JSON.stringify(dataLayer, " ", 2)}`} language='json' format={true} />
73+
<SourceWrapper code={`${JSON.stringify(filteredData, " ", 2)}`} language='json' format={true} />
5074
</AddonPanel>
5175
);
5276
};

.storybook-config/dataLayerListener/preset/manager.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ addons.register(ADDON_ID, () => {
99
type: types.PANEL,
1010
title: function title(){
1111
const [{ dataLayer }] = useAddonState(ADDON_ID, {
12-
dataLayer: []
12+
dataLayer: [],
13+
filter: "!gtm.",
1314
});
1415
return `Data Layer${dataLayer.length ? ` (${dataLayer.length})`: ``}`;
1516
},

.storybook-config/withColumns.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
2-
import React from "react";
3-
import { useMemo, useEffect } from '@storybook/addons';
1+
import React, { useMemo, useEffect } from "react";
42
import { clearStyles, addStyle } from './helpers/styleInjection';
53

64
export const withColumns = (StoryFn, context) => {
@@ -29,6 +27,8 @@ export const withColumns = (StoryFn, context) => {
2927
linear-gradient(90deg,var(--gridbg) var(--gridcol), var(--gridbg2) -1px),
3028
linear-gradient(90deg,var(--gridbg) var(--gridcol), var(--gridbg2) -1px),
3129
linear-gradient(90deg,var(--gridbg) var(--gridcol), var(--gridbg2) -1px),
30+
/*...*/
31+
/*...*/
3232
linear-gradient(90deg,var(--gridbg) var(--gridcol), var(--gridbg2) -1px),
3333
linear-gradient(-90deg,var(--gridbg) var(--gridcol), var(--gridbg2) -1px),
3434
linear-gradient(-90deg,var(--gridbg) var(--gridcol), var(--gridbg2) -1px),
@@ -70,7 +70,7 @@ export const withColumns = (StoryFn, context) => {
7070
}
7171
}
7272
`;
73-
});
73+
}, [context.viewMode, context.id]);
7474

7575
useEffect(() => {
7676
const selectorId =
@@ -85,7 +85,5 @@ export const withColumns = (StoryFn, context) => {
8585
addStyle(selectorId, columnsStyles);
8686
}, [isActive, columnsStyles, globals]);
8787

88-
return <>
89-
<StoryFn />
90-
</>
88+
return StoryFn();
9189
};

.yarn/releases/yarn-4.4.0.cjs

Lines changed: 925 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
nodeLinker: node-modules
2+
3+
npmScopes:
4+
asu:
5+
npmAuthToken: "${GITHUB_AUTH_TOKEN-fallback}"
6+
npmPublishRegistry: "https://npm.pkg.github.com"
7+
npmRegistryServer: "https://npm.pkg.github.com"
8+
9+
yarnPath: .yarn/releases/yarn-4.4.0.cjs
10+
11+
tsEnableAutoTypes: true

0 commit comments

Comments
 (0)