Skip to content
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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ jobs:
- name: Test ui-extensions-tester
run: npx loom test --no-watch packages/ui-extensions-tester/

- name: Testing example (checkout)
run: npm install && npm run typecheck && npm test
working-directory: examples/testing/checkout-basic-testing-example

test-build:
runs-on: ubuntu-latest

Expand Down
29 changes: 29 additions & 0 deletions examples/testing/checkout-basic-testing-example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Environment Configuration
.env
.env.*

# Dependency directory
node_modules

# Test coverage directory
coverage

# Ignore Apple macOS Desktop Services Store
.DS_Store

# Logs
logs
*.log

# extensions build output
extensions/*/build
extensions/*/dist

# lock files




# Ignore shopify files created during app dev
.shopify/*
.shopify.lock
30 changes: 30 additions & 0 deletions examples/testing/checkout-basic-testing-example/.graphqlrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const fs = require("node:fs");

function getConfig() {
const config = {
projects: {},
};

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();
24 changes: 24 additions & 0 deletions examples/testing/checkout-basic-testing-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This extension was created with:

```
shopify app init --name checkout-basic-testing-example
cd checkout-basic-testing-example
shopify app generate extension
# I chose 'Checkout UI'
```

See it in action:

Build the root package:

```
yarn build
```

Change into this example package and run:

```
npm install
npm run typecheck
npm test
```
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Instructions are in [app's README](../../)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"welcome": "Welcome to the {{target}} extension!",
"iWouldLikeAFreeGiftWithMyOrder": "I would like to receive a free gift with my order",
"addAFreeGiftToMyOrder": "Add a free gift to my order",
"attributeChangesAreNotSupported": "Attribute changes are not supported in this checkout"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"welcome": "Bienvenue dans l'extension {{target}}!",
"iWouldLikeAFreeGiftWithMyOrder": "Je souhaite recevoir un cadeau gratuit avec ma commande",
"addAFreeGiftToMyOrder": "Ajouter un cadeau gratuit Γ  ma commande",
"attributeChangesAreNotSupported": "Les modifications d'attribut ne sont pas prises en charge dans cette commande"
}
Loading
Loading