Skip to content

Commit 26f6f57

Browse files
committed
chore(deps): upgrade nx monorepo to v15.9.2
1 parent b54d188 commit 26f6f57

16 files changed

+25420
-22256
lines changed

.eslintignore

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

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ testem.log
3939
# System Files
4040
.DS_Store
4141
Thumbs.db
42+
43+
# Next.js
44+
.next

apps/api/jest.config.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
export default {
33
displayName: 'api',
44
preset: '../../jest.preset.js',
5-
globals: {
6-
'ts-jest': {
7-
tsconfig: '<rootDir>/tsconfig.spec.json',
8-
},
9-
},
5+
globals: {},
106
testEnvironment: 'node',
117
transform: {
12-
'^.+\\.[tj]s$': 'ts-jest',
8+
'^.+\\.[tj]s$': [
9+
'ts-jest',
10+
{
11+
tsconfig: '<rootDir>/tsconfig.spec.json',
12+
},
13+
],
1314
},
1415
moduleFileExtensions: ['ts', 'js', 'html'],
1516
coverageDirectory: '../../coverage/apps/api',

apps/api/project.json

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
{
2+
"name": "api",
23
"$schema": "../../node_modules/nx/schemas/project-schema.json",
34
"sourceRoot": "apps/api/src",
45
"projectType": "application",
56
"targets": {
67
"build": {
7-
"executor": "@nrwl/node:webpack",
8-
"outputs": ["{options.outputPath}"],
8+
"executor": "@nrwl/webpack:webpack",
9+
"outputs": [
10+
"{options.outputPath}"
11+
],
912
"options": {
1013
"outputPath": "dist/apps/api",
1114
"main": "apps/api/src/main.ts",
12-
"tsConfig": "apps/api/tsconfig.app.json"
15+
"tsConfig": "apps/api/tsconfig.app.json",
16+
"target": "node",
17+
"compiler": "tsc"
1318
},
1419
"configurations": {
1520
"production": {
@@ -38,14 +43,20 @@
3843
},
3944
"lint": {
4045
"executor": "@nrwl/linter:eslint",
41-
"outputs": ["{options.outputFile}"],
46+
"outputs": [
47+
"{options.outputFile}"
48+
],
4249
"options": {
43-
"lintFilePatterns": ["apps/api/**/*.ts"]
50+
"lintFilePatterns": [
51+
"apps/api/**/*.ts"
52+
]
4453
}
4554
},
4655
"test": {
4756
"executor": "@nrwl/jest:jest",
48-
"outputs": ["coverage/apps/api"],
57+
"outputs": [
58+
"{workspaceRoot}/coverage/apps/api"
59+
],
4960
"options": {
5061
"jestConfig": "apps/api/jest.config.ts",
5162
"passWithNoTests": true

apps/web/.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
PORT=8081
1+
PORT=8081
2+
API_URL=http://localhost:8080

apps/web/components/ProductsCard.tsx

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
import { useEffect, useState, useCallback } from 'react';
2-
import {
3-
Card,
4-
Heading,
5-
TextContainer,
6-
DisplayText,
7-
TextStyle,
8-
Button,
9-
} from '@shopify/polaris';
2+
import { AlphaStack, Button, LegacyCard, Text } from '@shopify/polaris';
103
import { Toast, useAppBridge } from '@shopify/app-bridge-react';
114
import { gql, useMutation } from '@apollo/client';
125
import { userLoggedInFetch } from '../utils/userLoggedInFetch';
@@ -41,26 +34,29 @@ export function ProductsCard() {
4134

4235
const toastMarkup = hasResults && (
4336
<Toast
44-
content="5 products created!"
37+
content="1 product created!"
4538
onDismiss={() => setHasResults(false)}
4639
/>
4740
);
4841

4942
return (
5043
<>
5144
{toastMarkup}
52-
<Card title="Product Counter" sectioned>
53-
<TextContainer spacing="loose">
45+
<LegacyCard title="Product Counter" sectioned>
46+
<AlphaStack gap="4">
5447
<p>
5548
Sample products are created with a default title and price. You can
5649
remove them at any time.
5750
</p>
58-
<Heading element="h4">
51+
52+
<Text as="h2" variant="headingXl">
5953
TOTAL PRODUCTS
60-
<DisplayText size="medium">
61-
<TextStyle variation="strong">{productCount}</TextStyle>
62-
</DisplayText>
63-
</Heading>
54+
</Text>
55+
56+
<Text as="p" fontWeight="bold" variant="heading2xl">
57+
{productCount}
58+
</Text>
59+
6460
<Button
6561
primary
6662
loading={loading}
@@ -81,10 +77,10 @@ export function ProductsCard() {
8177
});
8278
}}
8379
>
84-
Populate 5 products
80+
Populate 1 product
8581
</Button>
86-
</TextContainer>
87-
</Card>
82+
</AlphaStack>
83+
</LegacyCard>
8884
</>
8985
);
9086
}

apps/web/next.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ const nextConfig = {
88
env: {
99
SHOPIFY_API_KEY: process.env.SHOPIFY_API_KEY,
1010
},
11+
async rewrites() {
12+
return [
13+
{
14+
source: '/api/:path*',
15+
destination: `${process.env.API_URL}/api/:path*`,
16+
},
17+
];
18+
},
1119
nx: {
1220
// Set this to true if you would like to to use SVGR
1321
// See: https://github.com/gregberge/svgr

apps/web/pages/index.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {
2-
Card,
3-
Page,
2+
AlphaStack,
43
Layout,
5-
TextContainer,
4+
LegacyCard,
65
Link,
7-
Heading,
6+
Page,
7+
Text,
88
} from '@shopify/polaris';
99

1010
import { ProductsCard } from '../components/ProductsCard';
@@ -14,9 +14,11 @@ export default function HomePage() {
1414
<Page fullWidth>
1515
<Layout>
1616
<Layout.Section>
17-
<Card sectioned>
18-
<TextContainer spacing="loose">
19-
<Heading>Nice work on building a Shopify app 🎉</Heading>
17+
<LegacyCard sectioned>
18+
<AlphaStack gap="4">
19+
<Text as="h2" variant="headingMd">
20+
Nice work on building a Shopify app 🎉
21+
</Text>
2022
<p>
2123
Your app is ready to explore! It contains everything you need to
2224
get started including the{' '}
@@ -47,8 +49,8 @@ export default function HomePage() {
4749
</Link>{' '}
4850
📚{' '}
4951
</p>
50-
</TextContainer>
51-
</Card>
52+
</AlphaStack>
53+
</LegacyCard>
5254
</Layout.Section>
5355
<Layout.Section secondary>
5456
<ProductsCard />

apps/web/project.json

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
{
2+
"name": "web",
23
"$schema": "../../node_modules/nx/schemas/project-schema.json",
34
"sourceRoot": "apps/web",
45
"projectType": "application",
56
"targets": {
67
"build": {
78
"executor": "@nrwl/next:build",
8-
"outputs": ["{options.outputPath}"],
9+
"outputs": [
10+
"{options.outputPath}"
11+
],
912
"defaultConfiguration": "production",
1013
"options": {
1114
"root": "apps/web",
1215
"outputPath": "dist/apps/web"
1316
},
1417
"configurations": {
1518
"development": {
16-
"outputPath": "tmp/apps/web"
19+
"outputPath": "apps/web"
1720
},
1821
"production": {}
1922
}
@@ -23,8 +26,7 @@
2326
"defaultConfiguration": "development",
2427
"options": {
2528
"buildTarget": "web:build",
26-
"dev": true,
27-
"proxyConfig": "apps/web/proxy.conf.json"
29+
"dev": true
2830
},
2931
"configurations": {
3032
"development": {
@@ -46,17 +48,23 @@
4648
},
4749
"test": {
4850
"executor": "@nrwl/jest:jest",
49-
"outputs": ["coverage/apps/web"],
51+
"outputs": [
52+
"{workspaceRoot}/coverage/apps/web"
53+
],
5054
"options": {
5155
"jestConfig": "apps/web/jest.config.ts",
5256
"passWithNoTests": true
5357
}
5458
},
5559
"lint": {
5660
"executor": "@nrwl/linter:eslint",
57-
"outputs": ["{options.outputFile}"],
61+
"outputs": [
62+
"{options.outputFile}"
63+
],
5864
"options": {
59-
"lintFilePatterns": ["apps/web/**/*.{ts,tsx,js,jsx}"]
65+
"lintFilePatterns": [
66+
"apps/web/**/*.{ts,tsx,js,jsx}"
67+
]
6068
}
6169
}
6270
},

apps/web/proxy.conf.json

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

0 commit comments

Comments
 (0)