Skip to content

Commit 6c2c071

Browse files
Merge branch 'next' of https://github.com/IBM/carbon-addons-iot-react into fix-hotspot-1897
2 parents 1d35edc + ba3e03b commit 6c2c071

861 files changed

Lines changed: 24589 additions & 12108 deletions

File tree

Some content is hidden

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

.github/CONTRIBUTING.MD

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ but some popular options are [VSCode](https://code.visualstudio.com/),
1818

1919
With that all in place, you're ready to start contributing!
2020

21+
### Working with the monorepo
22+
23+
The PAL is structured as a set of packages versioned and deployed together - `carbon-addons-iot-react`, `@ai-apps/angular`, and `@ai-apps/components`. Each one of these packages live in the `packages` directory, for example, `carbon-addons-iot-react` lives in the `packages/react` directory.
24+
25+
To work on a package you must make sure to change into the correct directory - `cd packages/react` - otherwise package specific commands, or packages added via `yarn add`, will be run and added to the global scope and may conflict with other packages.
26+
27+
Each package should be capable of producing an independent build and storybook environment, however it may be necessary to build and link _all_ packages contained within the monorepo. In that case running `yarn build` from the root will build every package and it's local dependents in order. Other global scripts include:
28+
29+
- `build`: Builds and links every package
30+
- `lint`: Lints every package
31+
- `test`: Runs the test suite of every package
32+
- `build:storybook`: Builds the storybook for every package (where applicable)
33+
- `clean`: Cleans built files for the entire monorepo
34+
2135
### Developing on Windows 10
2236

2337
To get a Windows environment set up for contributing to this codebase, you'll
File renamed without changes.

.github/workflows/publish.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ jobs:
3333
run: yarn lint
3434

3535
- name: Test, collect coverage
36-
run: yarn test --maxWorkers=2 --ci --logHeapUsage --coverage
36+
# we need the "-- --" to pass the options through yarn and lerna and back to yarn
37+
run: yarn test -- -- --maxWorkers=2 --ci --logHeapUsage --coverage
3738

3839
- name: Coveralls
3940
uses: coverallsapp/github-action@master
4041
with:
4142
github-token: ${{ secrets.GITHUB_TOKEN }}
43+
path-to-lcov: "./packages/react/coverage/lcov.info"
44+
base-path: "packages/react"
4245

4346
- name: Build
4447
run: yarn build

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ jobs:
2020
run: yarn --frozen-lockfile
2121

2222
- name: Run tests, collect coverage
23-
run: yarn test --maxWorkers=2 --ci --logHeapUsage --coverage
23+
# we need the "-- --" to pass the options through yarn and lerna and back to yarn
24+
run: yarn test -- -- --maxWorkers=2 --ci --logHeapUsage --coverage
2425

2526
- name: Coveralls
2627
uses: coverallsapp/github-action@master
2728
with:
2829
github-token: ${{ secrets.GITHUB_TOKEN }}
30+
path-to-lcov: "./packages/react/coverage/lcov.info"
31+
base-path: "packages/react"

__mocks__/@carbon/charts-react/bar-chart-grouped.js

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

__mocks__/@carbon/charts-react/bar-chart-simple.js

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

__mocks__/@carbon/charts-react/bar-chart-stacked.js

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

lerna.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"packages": [
3+
"packages/*"
4+
],
5+
"version": "0.0.0",
6+
"npmClient": "yarn"
7+
}

netlify.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[build]
2-
# Directory (relative to root of your repo) that contains the deploy-ready
2+
# Directory (relative to root of your repo) that contains the deploy-ready
33
# HTML files and assets generated by the build. If a base directory has
44
# been specified, include it in the publish directory path.
5-
publish = "storybook-static"
5+
publish = "packages/react/storybook-static"
66

77
# Default build command.
8-
command = "yarn build:storybook"
8+
command = "yarn build:storybook"

package.json

Lines changed: 23 additions & 250 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,49 @@
11
{
2-
"name": "carbon-addons-iot-react",
2+
"name": "ibm-ai-applications",
33
"engines": {
4-
"node": "10.x || 12.x"
4+
"node": ">= 10"
55
},
6+
"workspaces": ["packages/react"],
67
"main": "lib/src/index.js",
78
"module": "es/src/index.js",
89
"unpkg": "umd/carbon-addons-iot-react.js",
910
"repository": {
1011
"type": "git",
1112
"url": "https://github.com/carbon-design-system/carbon-addons-iot-react.git"
1213
},
13-
"license": "Apache-2",
14-
"files": [
15-
"lib/**/*",
16-
"es/**/*",
17-
"umd/**/*",
18-
"scss/**/*",
19-
"css/**/*"
20-
],
14+
"private": true,
15+
"license": "Apache-2.0",
2116
"bugs": {
2217
"url": "https://github.com/carbon-design-system/carbon-addons-iot-react/issues"
2318
},
2419
"homepage": "https://carbon-addons-iot-react.com",
2520
"scripts": {
26-
"build": "yarn svg-convert && cross-env BABEL_ENV='production' NODE_ENV='production' yarn build:pre && rollup -c && yarn build:post",
27-
"build:pre": "yarn test:engines && rimraf lib es umd css scss tmp storybook-static",
28-
"build:post": "rimraf tmp",
29-
"build:storybook": "yarn test:engines && NODE_OPTIONS='--max-old-space-size=16384' build-storybook -s public/production",
30-
"format": "prettier --write \"**/*.{scss,css,js,jsx,md,ts}\"",
31-
"format:check": "prettier --check \"**/*.{scss,css,js,jsx,md,ts}\" --loglevel warn",
32-
"format:diff": "prettier --list-different \"**/*.{scss,css,js,jsx,md,ts}\"",
33-
"lint": "yarn lint:javascript && yarn lint:stylelint",
34-
"lint:javascript": "eslint --ext .jsx --ext .js .",
35-
"lint:stylelint": "stylelint './src/**/*.scss' --syntax scss --ignorePath .gitignore --custom-formatter ./config/stylelint/sassMsgFormatter.js",
36-
"postinstall": "carbon-telemetry collect --install",
37-
"publish-npm": "yarn semantic-release",
38-
"start": "yarn test:engines && yarn storybook",
39-
"storybook": "yarn test:engines && start-storybook -p 3000 -s public/development",
40-
"svg-convert": "svgr --ext jsx -d src/icons/components src/icons/svg && prettier --write src/icons/components/index.jsx ",
41-
"test": "yarn test:engines && yarn test:a11y && yarn test:base",
42-
"test:base": "yarn test:engines && cross-env NODE_ICU_DATA=node_modules/full-icu TZ=America/Chicago jest --testPathPattern='.*\\.test\\.js(x)?' --coverage",
43-
"test:a11y": "yarn test:engines && cross-env NODE_ICU_DATA=node_modules/full-icu TZ=America/Chicago jest --forceExit --testPathPattern='.*\\.a11y\\.js(x)?'",
44-
"test:watch": "yarn test:engines && cross-env NODE_ICU_DATA=node_modules/full-icu TZ=America/Chicago jest --testPathPattern='.*\\.test\\.js(x)?' --watch --verbose --coverage",
45-
"test:update": "yarn test:engines && cross-env NODE_ICU_DATA=node_modules/full-icu TZ=America/Chicago jest src/components/StorybookSnapshots.test.js src/utils/__tests__/publicAPI.test.js --updateSnapshot",
46-
"test:clear": "yarn test:engines && cross-env NODE_ICU_DATA=node_modules/full-icu TZ=America/Chicago jest --clearCache",
47-
"test:engines": "check-node-version --node $(cat .nvmrc) --yarn 1.x"
48-
},
49-
"stylelint": {
50-
"extends": "stylelint-config-recommended-scss",
51-
"plugins": [
52-
"stylelint-scss"
53-
],
54-
"rules": {
55-
"declaration-property-unit-blacklist": [
56-
{
57-
"font-size": [
58-
"em",
59-
"px",
60-
"pt"
61-
],
62-
"margin": [
63-
"px",
64-
"rem"
65-
],
66-
"padding": [
67-
"px",
68-
"rem"
69-
],
70-
"transition": [
71-
"s",
72-
"ms"
73-
]
74-
},
75-
{
76-
"severity": "error"
77-
}
78-
],
79-
"declaration-property-value-blacklist": [
80-
{
81-
"color": [
82-
"/^#/",
83-
"/^rgb/"
84-
]
85-
},
86-
{
87-
"severity": "error"
88-
}
89-
]
90-
}
21+
"build:storybook": "lerna run --stream build:storybook",
22+
"build": "lerna run --stream build",
23+
"lint": "lerna run --stream lint",
24+
"test": "lerna run --stream test",
25+
"start": "lerna run --stream start",
26+
"clean": "lerna run --stream clean",
27+
"format": "lerna run --stream format",
28+
"format:check": "lerna run --stream format:check",
29+
"publish-npm": "bash ./scripts/release.sh"
9130
},
9231
"husky": {
9332
"hooks": {
94-
"pre-commit": "yarn svg-convert && yarn lint-staged && yarn test:base",
33+
"pre-commit": "yarn lint-staged && lerna run --stream pre-commit",
9534
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
9635
}
9736
},
9837
"lint-staged": {
9938
"linters": {
100-
"*.{jsx,js}": [
101-
"eslint --fix"
39+
"packages/react/*.{jsx,js}": [
40+
"cd packages/react && eslint --fix"
10241
],
103-
"*.{scss,css}": [
104-
"yarn lint:stylelint"
42+
"packages/react/*.{scss,css}": [
43+
"cd packages/react && yarn lint:stylelint"
10544
],
106-
"*.{scss,css,js,md,jsx,json}": [
107-
"yarn format",
45+
"packages/react/*.{scss,css,js,md,jsx,json}": [
46+
"cd packages/react && yarn format",
10847
"git add"
10948
]
11049
}
@@ -114,177 +53,11 @@
11453
"@commitlint/config-conventional"
11554
]
11655
},
117-
"release": {
118-
"branches": [
119-
"+([0-9])?(.{+([0-9]),x}).x",
120-
"master",
121-
{
122-
"name": "next",
123-
"channel": "next",
124-
"prerelease": "next"
125-
}
126-
]
127-
},
128-
"dependencies": {
129-
"@babel/runtime": "^7.10.2",
130-
"@carbon/charts": "^0.41.11",
131-
"@carbon/charts-react": "^0.41.11",
132-
"@carbon/colors": "10.15.0",
133-
"@carbon/icons-react": "10.17.0",
134-
"@carbon/layout": "10.12.0",
135-
"@carbon/motion": "10.6.0",
136-
"@carbon/pictograms-react": "11.0.0",
137-
"@carbon/telemetry": "^0.0.0-alpha.5",
138-
"@carbon/themes": "10.16.0",
139-
"@monaco-editor/react": "^3.6.2",
140-
"carbon-components": "10.17.0",
141-
"carbon-components-react": "7.17.0",
142-
"carbon-icons": "^7.0.7",
143-
"classnames": "^2.2.5",
144-
"core-js": "3.6.5",
145-
"downshift": "5.2.1",
146-
"immutability-helper": "^2.9.0",
147-
"js-file-download": "^0.4.7",
148-
"lodash": "^4.17.19",
149-
"moment": "^2.24.0",
150-
"polished": "^2.3.3",
151-
"prop-types": "^15.7.2",
152-
"react-dnd": "11.1.3",
153-
"react-dnd-html5-backend": "11.1.3",
154-
"react-grid-layout": "^0.18.3",
155-
"react-sizeme": "^2.6.3",
156-
"react-transition-group": "^2.6.0",
157-
"react-visibility-sensor": "^5.0.2",
158-
"styled-components": "^4.1.3",
159-
"use-deep-compare-effect": "^1.2.0",
160-
"use-lang-direction": "^0.1.11",
161-
"use-resize-observer": "^6.1.0",
162-
"uuid": "^3.3.2",
163-
"warning": "^4.0.3"
164-
},
165-
"peerDependencies": {
166-
"d3": ">=5.0.0 <=5.14.2",
167-
"react": "^16.8.6",
168-
"react-dom": "^16.8.6"
169-
},
17056
"devDependencies": {
171-
"@babel/core": "^7.10.2",
172-
"@babel/plugin-proposal-class-properties": "^7.10.1",
173-
"@babel/plugin-proposal-decorators": "^7.10.1",
174-
"@babel/plugin-proposal-do-expressions": "^7.10.1",
175-
"@babel/plugin-proposal-export-default-from": "^7.10.1",
176-
"@babel/plugin-proposal-export-namespace-from": "^7.10.1",
177-
"@babel/plugin-proposal-function-sent": "^7.10.1",
178-
"@babel/plugin-proposal-json-strings": "^7.10.1",
179-
"@babel/plugin-proposal-logical-assignment-operators": "^7.10.1",
180-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1",
181-
"@babel/plugin-proposal-numeric-separator": "^7.10.1",
182-
"@babel/plugin-proposal-optional-chaining": "^7.10.1",
183-
"@babel/plugin-proposal-pipeline-operator": "^7.10.1",
184-
"@babel/plugin-proposal-throw-expressions": "^7.10.1",
185-
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
186-
"@babel/plugin-syntax-import-meta": "^7.10.1",
187-
"@babel/plugin-transform-runtime": "^7.10.1",
188-
"@babel/polyfill": "^7.10.1",
189-
"@babel/preset-env": "^7.10.2",
190-
"@babel/preset-flow": "^7.10.1",
191-
"@babel/preset-react": "^7.10.1",
192-
"@commitlint/cli": "^7.2.1",
193-
"@commitlint/config-conventional": "^7.1.2",
194-
"@storybook/addon-a11y": "^5.3.17",
195-
"@storybook/addon-actions": "^5.3.17",
196-
"@storybook/addon-info": "^5.3.17",
197-
"@storybook/addon-knobs": "^5.3.17",
198-
"@storybook/addon-links": "^5.3.17",
199-
"@storybook/addon-storyshots": "^5.3.17",
200-
"@storybook/addons": "^5.3.17",
201-
"@storybook/react": "^5.3.17",
202-
"@svgr/cli": "^5.4.0",
203-
"@testing-library/dom": "^7.22.2",
204-
"@testing-library/jest-dom": "^5.11.3",
205-
"@testing-library/react": "^10.4.8",
206-
"@testing-library/user-event": "^12.1.1",
207-
"accessibility-checker": "^3.0.6",
208-
"autoprefixer": "^9.4.4",
209-
"babel-core": "^7.0.0-bridge.0",
210-
"babel-eslint": "^10.1.0",
211-
"babel-loader": "^8.1.0",
212-
"babel-plugin-dev-expression": "^0.2.2",
213-
"babel-plugin-lodash": "^3.3.4",
214-
"babel-plugin-react-docgen": "^4.1.0",
215-
"babel-plugin-require-context-hook": "^1.0.0",
216-
"babel-plugin-styled-components": "^1.10.7",
217-
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
218-
"chalk": "^4.1.0",
219-
"check-node-version": "^4.0.3",
220-
"coveralls": "^3.0.2",
221-
"cross-env": "^6.0.3",
222-
"css-loader": "^2.1.0",
223-
"d3": ">=5.0.0 <=5.14.2",
224-
"deepdash": "^5.1.2",
225-
"enzyme": "^3.8.0",
226-
"enzyme-adapter-react-16": "^1.14.0",
227-
"enzyme-to-json": "^3.3.5",
228-
"eslint": "^5.11.1",
229-
"eslint-config-airbnb": "^17.1.0",
230-
"eslint-config-prettier": "^6.12.0",
231-
"eslint-plugin-babel": "^5.3.0",
232-
"eslint-plugin-import": "^2.14.0",
233-
"eslint-plugin-jest": "^23.8.2",
234-
"eslint-plugin-jsx-a11y": "^6.1.2",
235-
"eslint-plugin-lodash": "^5.1.0",
236-
"eslint-plugin-prettier": "^3.1.4",
237-
"eslint-plugin-react": "^7.12.2",
238-
"eslint-plugin-react-hooks": "^1.5.0",
239-
"eslint-plugin-testing-library": "^3.3.1",
240-
"eslint-plugin-unicorn": "^20.1.0",
241-
"faker": "^4.1.0",
242-
"fast-sass-loader": "^1.5.0",
243-
"file-loader": "^4.0.0",
244-
"full-icu": "^1.3.1",
24557
"husky": "^1.3.1",
246-
"jest": "^25.5.1",
247-
"jest-environment-jsdom-sixteen": "^1.0.3",
248-
"jest-styled-components": "^6.3.1",
249-
"lint-staged": "^8.1.0",
250-
"moment-timezone": "^0.5.26",
251-
"node-sass": "^4.13.1",
252-
"object-assign": "^4.1.1",
253-
"postcss-loader": "^3.0.0",
254-
"prettier": "^2.1.2",
255-
"prettier-config-carbon": "^0.4.0",
256-
"promise": "^8.0.2",
257-
"react": "^16.8.6",
258-
"react-dom": "^16.8.6",
259-
"react-is": "^16.13.1",
260-
"react-lorem-component": "^0.13.0",
261-
"react-test-renderer": "^16.8.6",
262-
"rimraf": "^3.0.0",
263-
"rollup": "^1.1.0",
264-
"rollup-plugin-babel": "^4.4.0",
265-
"rollup-plugin-commonjs": "^9.2.0",
266-
"rollup-plugin-copy": "^3.2.0",
267-
"rollup-plugin-filesize": "^6.0.0",
268-
"rollup-plugin-json": "^4.0.0",
269-
"rollup-plugin-node-resolve": "^4.0.0",
270-
"rollup-plugin-postcss": "^2.0.3",
271-
"rollup-plugin-replace": "^2.1.0",
272-
"rollup-plugin-uglify": "^6.0.4",
273-
"sass-loader": "^7.1.0",
274-
"semantic-release": "^17.2.3",
275-
"storybook-addon-rtl": "^0.2.2",
276-
"storybook-readme": "^5.0.8",
277-
"style-loader": "^0.23.1",
278-
"stylelint": "^10.1.0",
279-
"stylelint-config-recommended-scss": "^3.3.0",
280-
"stylelint-scss": "^3.10.0",
281-
"weak-napi": "^2.0.1",
282-
"webpack": "^4.28.4",
283-
"whatwg-fetch": "^3.0.0"
58+
"lerna": "^3.22.1",
59+
"lint-staged": "^8.1.0"
28460
},
28561
"sideEffects": false,
286-
"resolutions": {
287-
"chokidar": "3.3.1"
288-
},
28962
"version": "0.0.0-development"
29063
}

0 commit comments

Comments
 (0)