Skip to content

Commit

Permalink
Shopify Billing API example initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DanojaDias committed Dec 10, 2023
0 parents commit d547e8f
Show file tree
Hide file tree
Showing 32 changed files with 1,229 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.cache
build
node_modules
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# editorconfig.org
root = true

[*]
charset = utf-8
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

# Markdown syntax specifies that trailing whitespaces can be meaningful,
# so let’s not trim those. e.g. 2 trailing spaces = linebreak (<br />)
# See https://daringfireball.net/projects/markdown/syntax#p
[*.md]
trim_trailing_whitespace = false
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
build
public/build
shopify-app-remix
*/*.yml
.shopify
13 changes: 13 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @type {import('@types/eslint').Linter.BaseConfig} */
module.exports = {
root: true,
extends: [
"@remix-run/eslint-config",
"@remix-run/eslint-config/node",
"@remix-run/eslint-config/jest-testing-library",
"prettier",
],
globals: {
shopify: "readonly"
},
};
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
node_modules

/.cache
/build
/app/build
/public/build/
/public/_dev
/app/public/build
/prisma/dev.sqlite
/prisma/dev.sqlite-journal
database.sqlite

.env
package-lock.json
yarn.lock
47 changes: 47 additions & 0 deletions .graphqlrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
const fs = require("node:fs");
const apiVersion = require("@shopify/shopify-app-remix").LATEST_API_VERSION;

function getConfig() {
const config = {
projects: {
// Storefront API
// Here is the config to tell graphql.vscode-graphql to use the storefront GraphQL Schema
// Steps:
// 1. Uncomment lines 14-17 (the shopifyStorefrontApi property)
// 2. Update the documents array to point to files that use the storefront API
// Do not mix and match storefront and admin API documents in the same file.
// If a route needs both APIs, create a separate file for each API.
// shopifyStorefrontApi: {
// schema: `https://shopify.dev/storefront-graphql-direct-proxy/${apiVersion}`,
// documents: ["./app/routes/app.storefront.jsx"],
// },
shopifyAdminApi: {
schema: `https://shopify.dev/admin-graphql-direct-proxy/${apiVersion}`,
documents: ["./app/**/*.{graphql,js,ts,jsx,tsx}"],
},
},
};

let extensions = [];
try {
extensions = fs.readdirSync("./extensions");
} catch {
// ignore if no extensions
}

for (const entry of extensions) {
const extensionPath = `./extensions/${entry}`;
const schema = `${extensionPath}/schema.graphql`;
if (!fs.existsSync(schema)) {
continue;
}
config.projects[entry] = {
schema,
documents: [`${extensionPath}/**/*.graphql`],
};
}

return config;
}

module.exports = getConfig();
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
engine-strict=true
auto-install-peers=true
shamefully-hoist=true
enable-pre-post-scripts=true
13 changes: 13 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package.json
.cache
.shadowenv.d
.vscode
build
node_modules
prisma
public
shopify-app-remix
.github
tmp
*.yml
.shopify
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:18-alpine

EXPOSE 3000

WORKDIR /app
COPY . .

ENV NODE_ENV=production

RUN npm install --omit=dev
# Remove CLI packages since we don't need them in production by default.
# Remove this line if you want to run CLI commands in your container.
RUN npm remove @shopify/app @shopify/cli
RUN npm run build

# You'll probably want to remove this in production, it's here to make it easier to test things!
RUN rm -f prisma/dev.sqlite

CMD ["npm", "run", "docker-start"]
Loading

0 comments on commit d547e8f

Please sign in to comment.