Skip to content

Commit a16b5ee

Browse files
committed
Update template to use RR7 app template and Polaris web components
1 parent 0a043da commit a16b5ee

37 files changed

+845
-820
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
node_modules
22
build
33
public/build
4-
shopify-app-remix
54
*/*.yml
65
.shopify
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* This is intended to be a basic starting point for linting in your app.
3+
* It relies on recommended configs out of the box for simplicity, but you can
4+
* and should modify this configuration to best suit your team's needs.
5+
*/
6+
7+
/** @type {import('eslint').Linter.Config} */
8+
module.exports = {
9+
env: {
10+
browser: true,
11+
es2022: true,
12+
node: true,
13+
},
14+
extends: [
15+
'eslint:recommended',
16+
'plugin:react/recommended',
17+
'plugin:react-hooks/recommended',
18+
'plugin:jsx-a11y/recommended',
19+
],
20+
parserOptions: {
21+
ecmaFeatures: {
22+
jsx: true,
23+
},
24+
ecmaVersion: 'latest',
25+
sourceType: 'module',
26+
},
27+
plugins: ['react', 'react-hooks', 'jsx-a11y', 'import'],
28+
rules: {
29+
'react/react-in-jsx-scope': 'off',
30+
'react/prop-types': 'off',
31+
'react/no-unknown-property': ['error', { ignore: ['variant', 'tone'] }],
32+
},
33+
settings: {
34+
react: {
35+
version: 'detect',
36+
},
37+
},
38+
};

sample-apps/payment-customizations/.eslintrc.js

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

sample-apps/payment-customizations/.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,25 @@ node_modules
44
/build
55
/app/build
66
/public/build/
7+
/public/_dev
78
/app/public/build
89
/prisma/dev.sqlite
910
/prisma/dev.sqlite-journal
1011
database.sqlite
1112

1213
.env
14+
.env.*
15+
1316
package-lock.json
1417
yarn.lock
18+
pnpm-lock.yaml
19+
20+
/extensions/*/dist
21+
22+
# Ignore shopify files created during app dev
23+
.shopify/*
24+
.shopify.lock
25+
26+
# Hide files auto-generated by react router
27+
.react-router/
28+
Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,41 @@
1-
const fs = require('node:fs');
2-
const apiVersion = require("@shopify/shopify-app-remix").LATEST_API_VERSION;
1+
import fs from "fs";
2+
import { LATEST_API_VERSION } from "@shopify/shopify-api";
3+
import { shopifyApiProject, ApiType } from "@shopify/api-codegen-preset";
34

45
function getConfig() {
5-
const config = {
6-
projects: {
7-
shopifyAdminApi: {
8-
schema: `https://shopify.dev/admin-graphql-direct-proxy/${apiVersion}`,
9-
documents: ['./app/**/*.{graphql,js,ts,jsx,tsx}']
10-
}
11-
}
12-
}
6+
const config = {
7+
projects: {
8+
default: shopifyApiProject({
9+
apiType: ApiType.Admin,
10+
apiVersion: LATEST_API_VERSION,
11+
documents: ["./app/**/*.{js,jsx}", "./app/.server/**/*.{js,jsx}"],
12+
outputDir: "./app/types",
13+
}),
14+
},
15+
};
1316

14-
let extensions = []
15-
try {
16-
extensions = fs.readdirSync('./extensions');
17-
} catch {
18-
// ignore if no extensions
19-
}
17+
let extensions = [];
18+
try {
19+
extensions = fs.readdirSync("./extensions");
20+
} catch {
21+
// ignore if no extensions
22+
}
2023

21-
for (const entry of extensions) {
22-
const extensionPath = `./extensions/${entry}`;
23-
const schema = `${extensionPath}/schema.graphql`;
24-
if(!fs.existsSync(schema)) {
25-
continue;
26-
}
27-
config.projects[entry] = {
28-
schema,
29-
documents: [`${extensionPath}/input.graphql`]
30-
}
24+
for (const entry of extensions) {
25+
const extensionPath = `./extensions/${entry}`;
26+
const schema = `${extensionPath}/schema.graphql`;
27+
if (!fs.existsSync(schema)) {
28+
continue;
3129
}
30+
config.projects[entry] = {
31+
schema,
32+
documents: [`${extensionPath}/**/*.graphql`],
33+
};
34+
}
3235

33-
return config;
36+
return config;
3437
}
3538

36-
module.exports = getConfig();
39+
const config = getConfig();
40+
41+
export default config;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
engine-strict=true
22
auto-install-peers=true
33
shamefully-hoist=true
4-
@shopify:registry=https://registry.npmjs.org
4+
enable-pre-post-scripts=true
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
package.json
2-
.cache
32
.shadowenv.d
43
.vscode
5-
build
64
node_modules
75
prisma
86
public
9-
shopify-app-remix
10-
.github
11-
tmp
12-
*.yml
137
.shopify

sample-apps/payment-customizations/.vscode/extensions.json

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
FROM node:18-alpine
2+
RUN apk add --no-cache openssl
23

34
EXPOSE 3000
5+
46
WORKDIR /app
7+
8+
ENV NODE_ENV=production
9+
10+
COPY package.json package-lock.json* ./
11+
12+
RUN npm ci --omit=dev && npm cache clean --force
13+
# Remove CLI packages since we don't need them in production by default.
14+
# Remove this line if you want to run CLI commands in your container.
15+
RUN npm remove @shopify/cli
16+
517
COPY . .
618

7-
RUN npm install
819
RUN npm run build
920

10-
# You'll probably want to remove this in production, it's here to make it easier to test things!
11-
RUN rm prisma/dev.sqlite
12-
RUN npx prisma migrate dev --name init
13-
14-
CMD ["npm", "run", "start"]
21+
CMD ["npm", "run", "docker-start"]

0 commit comments

Comments
 (0)