Skip to content

Commit 2ce0120

Browse files
committed
adds read custom data app and extension code
1 parent ca42f37 commit 2ce0120

52 files changed

Lines changed: 12842 additions & 3 deletions

Some content is hidden

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

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.cache
2+
build
3+
node_modules

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
# Markdown syntax specifies that trailing whitespaces can be meaningful,
12+
# so let’s not trim those. e.g. 2 trailing spaces = linebreak (<br />)
13+
# See https://daringfireball.net/projects/markdown/syntax#p
14+
[*.md]
15+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
build
3+
public/build
4+
shopify-app-remix
5+
*/*.yml
6+
.shopify

.eslintrc.cjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/** @type {import('@types/eslint').Linter.BaseConfig} */
2+
module.exports = {
3+
root: true,
4+
extends: [
5+
"@remix-run/eslint-config",
6+
"@remix-run/eslint-config/node",
7+
"@remix-run/eslint-config/jest-testing-library",
8+
"prettier",
9+
],
10+
globals: {
11+
shopify: "readonly"
12+
},
13+
};

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
node_modules
2+
.DS_Store
3+
4+
/.cache
5+
/build
6+
/app/build
7+
/public/build/
8+
/public/_dev
9+
/app/public/build
10+
/prisma/dev.sqlite
11+
/prisma/dev.sqlite-journal
12+
database.sqlite
13+
14+
.env
15+
.env.*
16+
17+
18+
19+
20+
21+
/extensions/*/dist
22+
23+
# Ignore shopify files created during app dev
24+
.shopify/*
25+
.shopify.lock

.graphqlrc.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import fs from "fs";
2+
import { LATEST_API_VERSION } from "@shopify/shopify-api";
3+
import { shopifyApiProject, ApiType } from "@shopify/api-codegen-preset";
4+
import type { IGraphQLConfig } from "graphql-config";
5+
6+
function getConfig() {
7+
const config: IGraphQLConfig = {
8+
projects: {
9+
default: shopifyApiProject({
10+
apiType: ApiType.Admin,
11+
apiVersion: LATEST_API_VERSION,
12+
documents: ["./app/**/*.{js,ts,jsx,tsx}", "./app/.server/**/*.{js,ts,jsx,tsx}"],
13+
outputDir: "./app/types",
14+
}),
15+
},
16+
};
17+
18+
let extensions: string[] = [];
19+
try {
20+
extensions = fs.readdirSync("./extensions");
21+
} catch {
22+
// ignore if no extensions
23+
}
24+
25+
for (const entry of extensions) {
26+
const extensionPath = `./extensions/${entry}`;
27+
const schema = `${extensionPath}/schema.graphql`;
28+
if (!fs.existsSync(schema)) {
29+
continue;
30+
}
31+
config.projects[entry] = {
32+
schema,
33+
documents: [`${extensionPath}/**/*.graphql`],
34+
};
35+
}
36+
37+
return config;
38+
}
39+
40+
const config = getConfig();
41+
42+
export default config;

.npmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
engine-strict=true
2+
@shopify:registry=https://registry.npmjs.org
3+
auto-install-peers=true
4+
@shopify:registry=https://registry.npmjs.org

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package.json
2+
.shadowenv.d
3+
.vscode
4+
node_modules
5+
prisma
6+
public
7+
.shopify

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"graphql.vscode-graphql",
4+
"shopify.polaris-for-vscode",
5+
]
6+
}

.vscode/mcp.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"servers": {
3+
"shopify-dev-mcp": {
4+
"command": "npx",
5+
"args": ["-y", "@shopify/dev-mcp@latest"]
6+
}
7+
}
8+
}

0 commit comments

Comments
 (0)