From 7a7a4943ce7358472dbbdfa35dbffc6ef756f29e Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Wed, 14 Dec 2022 11:04:20 -0600 Subject: [PATCH 1/3] Use JS instead of MJS for remix.init --- templates/demo-store/remix.init/{index.mjs => index.js} | 0 templates/demo-store/remix.init/package.json | 2 +- templates/hello-world/remix.init/{index.mjs => index.js} | 0 templates/hello-world/remix.init/package.json | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename templates/demo-store/remix.init/{index.mjs => index.js} (100%) rename templates/hello-world/remix.init/{index.mjs => index.js} (100%) diff --git a/templates/demo-store/remix.init/index.mjs b/templates/demo-store/remix.init/index.js similarity index 100% rename from templates/demo-store/remix.init/index.mjs rename to templates/demo-store/remix.init/index.js diff --git a/templates/demo-store/remix.init/package.json b/templates/demo-store/remix.init/package.json index 8e45e6c52e..d219d9f230 100644 --- a/templates/demo-store/remix.init/package.json +++ b/templates/demo-store/remix.init/package.json @@ -1,7 +1,7 @@ { "name": "remix.init", "private": true, - "main": "index.mjs", + "main": "index.js", "license": "MIT", "dependencies": {} } diff --git a/templates/hello-world/remix.init/index.mjs b/templates/hello-world/remix.init/index.js similarity index 100% rename from templates/hello-world/remix.init/index.mjs rename to templates/hello-world/remix.init/index.js diff --git a/templates/hello-world/remix.init/package.json b/templates/hello-world/remix.init/package.json index 8e45e6c52e..d219d9f230 100644 --- a/templates/hello-world/remix.init/package.json +++ b/templates/hello-world/remix.init/package.json @@ -1,7 +1,7 @@ { "name": "remix.init", "private": true, - "main": "index.mjs", + "main": "index.js", "license": "MIT", "dependencies": {} } From 5a4fa784218fd459eee56a6ca01bfa1537494f5c Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Wed, 14 Dec 2022 11:04:53 -0600 Subject: [PATCH 2/3] Add changeset --- .changeset/loud-otters-act.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/loud-otters-act.md diff --git a/.changeset/loud-otters-act.md b/.changeset/loud-otters-act.md new file mode 100644 index 0000000000..5e9f46b216 --- /dev/null +++ b/.changeset/loud-otters-act.md @@ -0,0 +1,5 @@ +--- +'@shopify/cli-hydrogen': patch +--- + +Fix remix.init in templates From a069016fd081a063576a1357d2f8f30aad953958 Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Wed, 14 Dec 2022 11:06:27 -0600 Subject: [PATCH 3/3] Switch to CJS --- templates/demo-store/remix.init/index.js | 4 ++-- templates/hello-world/remix.init/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/demo-store/remix.init/index.js b/templates/demo-store/remix.init/index.js index ac7da6d822..c361deb2c0 100644 --- a/templates/demo-store/remix.init/index.js +++ b/templates/demo-store/remix.init/index.js @@ -1,5 +1,5 @@ /* eslint-disable no-console */ -import fs from 'fs'; +const fs = require('fs'); const run = ({rootDirectory}) => { // TEMPORARY during dev preview: @@ -20,6 +20,6 @@ const run = ({rootDirectory}) => { console.log(); }; -export default run; +module.exports = run; /* eslint-enable no-console */ diff --git a/templates/hello-world/remix.init/index.js b/templates/hello-world/remix.init/index.js index ac7da6d822..c361deb2c0 100644 --- a/templates/hello-world/remix.init/index.js +++ b/templates/hello-world/remix.init/index.js @@ -1,5 +1,5 @@ /* eslint-disable no-console */ -import fs from 'fs'; +const fs = require('fs'); const run = ({rootDirectory}) => { // TEMPORARY during dev preview: @@ -20,6 +20,6 @@ const run = ({rootDirectory}) => { console.log(); }; -export default run; +module.exports = run; /* eslint-enable no-console */