Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite delivery-customization with Remix #292

Merged
merged 7 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,548 changes: 0 additions & 6,548 deletions package-lock.json

This file was deleted.

6 changes: 3 additions & 3 deletions sample-apps/delivery-customizations/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
web/node_modules
web/frontend/node_modules
web/frontend/dist
.cache
build
node_modules
15 changes: 15 additions & 0 deletions sample-apps/delivery-customizations/.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 sample-apps/delivery-customizations/.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 sample-apps/delivery-customizations/.eslintrc.js
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"
},
};
36 changes: 11 additions & 25 deletions sample-apps/delivery-customizations/.gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
# Environment Configuration
.env
.env.*

# Dependency directory
node_modules

# Test coverage directory
coverage

# Ignore Apple macOS Desktop Services Store
.DS_Store

# Logs
logs
*.log
/.cache
/build
/app/build
/public/build/
/app/public/build
/prisma/dev.sqlite
/prisma/dev.sqlite-journal
database.sqlite

# ngrok tunnel file
config/tunnel.pid

# vite build output
dist/

# extensions build output
extensions/*/build

# Node library SQLite database
web/database.sqlite
.env
package-lock.json
yarn.lock
36 changes: 36 additions & 0 deletions sample-apps/delivery-customizations/.graphqlrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const fs = require('node:fs');
const apiVersion = require("@shopify/shopify-app-remix").LATEST_API_VERSION;

function getConfig() {
const config = {
projects: {
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}/input.graphql`]
}
}

return config;
}

module.exports = getConfig();
13 changes: 13 additions & 0 deletions sample-apps/delivery-customizations/.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
3 changes: 2 additions & 1 deletion sample-apps/delivery-customizations/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"recommendations": [
"graphql.vscode-graphql",
"shopify.polaris-for-vscode"
]
}
}
16 changes: 10 additions & 6 deletions sample-apps/delivery-customizations/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
FROM node:18-alpine

ARG SHOPIFY_API_KEY
ENV SHOPIFY_API_KEY=$SHOPIFY_API_KEY
EXPOSE 8081
EXPOSE 3000
WORKDIR /app
COPY web .
COPY . .

RUN npm install
RUN cd frontend && npm install && npm run build
CMD ["npm", "run", "serve"]
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 prisma/dev.sqlite
RUN npx prisma migrate dev --name init

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