Skip to content

Commit 758eba0

Browse files
committed
fix: clean up webpack configs and package.json
- fixed react-i18n duplicated dependency - removed all unused dependencies - update webpack configs to use babel/preset-env and ensure the right plugins are loaded chore: fix issue with babel warnings when re-exporting types - refer to microsoft/TypeScript#35200 and babel/babel#10981
1 parent fce6f3e commit 758eba0

File tree

19 files changed

+122
-83
lines changed

19 files changed

+122
-83
lines changed

packages/argo-host/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"@shopify/polaris": "^4.19.0",
1919
"@shopify/react-web-worker": "^1.2.9",
2020
"@shopify/remote-ui-react": "^0.0.24",
21-
"react": "^16.12.0",
22-
"typescript": "^3.7.2"
21+
"react": "^16.12.0"
2322
},
2423
"publishConfig": {
2524
"access": "restricted",

packages/argo-host/src/component-schemas/index.ts

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,34 @@ export {appLinkSchema} from './app-link';
55
export {subscriptionManagementSchema} from './subscription-management';
66

77
export const extensionComponentsLoader: Record<ExtensionPoint, () => Promise<any>> = {
8-
[ExtensionPoint.AppLink]: () => import('./app-link').then(module => module.appLinkSchema),
9-
[ExtensionPoint.Playground]: () => import('./playground').then(module => module.playgroundSchema),
8+
[ExtensionPoint.AppLink]: () =>
9+
import(/* webpackChunkName: 'argo-app-link-components' */ './app-link').then(
10+
module => module.appLinkSchema,
11+
),
12+
[ExtensionPoint.Playground]: () =>
13+
import(/* webpackChunkName: 'argo-playground-components' */ './playground').then(
14+
module => module.playgroundSchema,
15+
),
1016

1117
[ExtensionPoint.SubscriptionManagementAdd]: () =>
12-
import('./subscription-management').then(module => module.subscriptionManagementSchema),
18+
import(
19+
/* webpackChunkName: 'argo-subscription-management-components' */ './subscription-management'
20+
).then(module => module.subscriptionManagementSchema),
1321
[ExtensionPoint.SubscriptionManagementCreate]: () =>
14-
import('./subscription-management').then(module => module.subscriptionManagementSchema),
22+
import(
23+
/* webpackChunkName: 'argo-subscription-management-components' */ './subscription-management'
24+
).then(module => module.subscriptionManagementSchema),
1525
[ExtensionPoint.SubscriptionManagementRemove]: () =>
16-
import('./subscription-management').then(module => module.subscriptionManagementSchema),
26+
import(
27+
/* webpackChunkName: 'argo-subscription-management-components' */ './subscription-management'
28+
).then(module => module.subscriptionManagementSchema),
1729
[ExtensionPoint.SubscriptionManagementEdit]: () =>
18-
import('./subscription-management').then(module => module.subscriptionManagementSchema),
30+
import(
31+
/* webpackChunkName: 'argo-subscription-management-components' */ './subscription-management'
32+
).then(module => module.subscriptionManagementSchema),
1933

2034
[ExtensionPoint.MerchantMetafield]: () =>
21-
import('./app-link').then(module => module.appLinkSchema),
35+
import(/* webpackChunkName: 'argo-merchant-metafield-components' */ './app-link').then(
36+
module => module.appLinkSchema,
37+
),
2238
};

packages/argo-playground/package.json

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
"name": "@shopify/argo-playground",
33
"version": "0.0.64",
44
"private": true,
5-
"browserslist": [
6-
"extends @shopify/browserslist-config"
7-
],
85
"scripts": {
9-
"build": "webpack",
10-
"build-mobile": "rm -rf ./dist && webpack --config ./webpack.mobile.config.js",
6+
"clean": "rm -rf ./dist",
7+
"build": "yarn run clean && webpack",
8+
"build:prod": "yarn run clean && NODE_ENV=production && webpack -p",
9+
"build-mobile": "yarn run clean && webpack --config ./webpack.mobile.config.js",
1110
"server": "webpack-dev-server"
1211
},
1312
"repository": {
@@ -16,49 +15,38 @@
1615
"directory": "packages/argo-playground"
1716
},
1817
"dependencies": {
19-
"@babel/plugin-transform-runtime": "^7.9.0",
20-
"@juggle/resize-observer": "^3.1.3",
21-
"@shopify/browserslist-config": "^1.0.3",
2218
"@shopify/polaris": "^4.19.0",
2319
"@shopify/react-form": "^0.6.0",
24-
"@shopify/react-graphql": "^6.1.1",
2520
"@shopify/react-html": "^9.2.3",
26-
"@shopify/react-i18n": "^2.0.2",
21+
"@shopify/react-i18n": "^4.0.0",
2722
"@shopify/react-i18n-universal-provider": "^1.0.14",
2823
"@shopify/react-network": "^3.3.1",
2924
"@shopify/react-performance": "^1.1.1",
3025
"@shopify/react-router": "^0.0.9",
31-
"@shopify/typescript-configs": "^2.0.1",
32-
"apollo-client": "^2.6.8",
33-
"apollo-link-context": "^1.0.20",
34-
"apollo-link-http": "^1.5.16",
35-
"core-js": "^3.6.4",
36-
"graphql": "^14.6.0",
37-
"graphql-tag": "^2.10.3",
3826
"react": "^16.12.0",
3927
"react-dom": "^16.12.0"
4028
},
4129
"devDependencies": {
42-
"@babel/preset-env": "^7.8.7",
30+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1",
31+
"@babel/plugin-proposal-numeric-separator": "^7.10.1",
32+
"@babel/plugin-proposal-optional-chaining": "^7.10.1",
33+
"@babel/plugin-transform-runtime": "^7.10.1",
34+
"@babel/preset-env": "^7.10.0",
35+
"@babel/preset-react": "^7.10.0",
36+
"@babel/preset-typescript": "^7.10.1",
37+
"@babel/runtime": "^7.10.1",
4338
"@types/react": "^16.9.4",
4439
"@types/react-dom": "^16.9.1",
4540
"babel-loader": "^8.0.6",
46-
"babel-preset-shopify": "21.0.0",
4741
"css-loader": "^3.4.2",
4842
"file-loader": "^6.0.0",
4943
"html-webpack-plugin": "^3.2.0",
50-
"sass": "^1.26.3",
51-
"sass-loader": "^8.0.2",
5244
"style-loader": "^1.1.3",
5345
"typescript": "~3.7.2",
5446
"webpack": "^4.41.6",
5547
"webpack-cli": "^3.3.11",
5648
"webpack-dev-server": "^3.10.3"
5749
},
58-
"resolutions": {
59-
"babel-core": "7.0.0-bridge.0",
60-
"core-js": "^3.6.4"
61-
},
6250
"publishConfig": {
6351
"access": "restricted",
6452
"registry": "https://packages.shopify.io/shopify/node/npm/"

packages/argo-playground/src/components/containers/shared/Error/Error.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import {Stack, TextContainer, DisplayText, Button} from '@shopify/polaris';
33
const {default: ErrorMonitorImage} = require('./error-monitor.png');
44

5-
import './Error.scss';
5+
import './Error.css';
66

77
export function Error() {
88
return (

packages/argo-playground/src/components/containers/shared/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import {Stack, Icon, DisplayText, Button} from '@shopify/polaris';
33
import {ChevronLeftMinor} from '@shopify/polaris-icons';
44

5-
import './styles.scss';
5+
import './styles.css';
66

77
interface Props {
88
appName: string;

packages/argo-playground/src/components/containers/shared/LoadingSpinner/LoadingSpinner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import {Spinner} from '@shopify/polaris';
33

4-
import './LoadingSpinner.scss';
4+
import './LoadingSpinner.css';
55

66
export function LoadingSpinner() {
77
return (

packages/argo-playground/src/features/ComponentsList/ComponentsList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {useToastApi} from '@shopify/argo-host';
77
import {StandardContainer} from '../../components/containers';
88

99
const reactThirdPartyWorker = createPlainWorkerFactory(() =>
10-
import(/* webpackChunkName: 'components-list' */ '../../third-party/components-list'),
10+
import(/* webpackChunkName: '3p-components-list' */ '../../third-party/components-list'),
1111
);
1212

1313
export function ComponentsList() {

0 commit comments

Comments
 (0)