create-easel-theme 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +100 -0
  3. package/bin/create-easel-theme.mjs +9 -0
  4. package/dist/cli.js +604 -0
  5. package/dist/templates/js/alpine/snippets/counter.liquid +9 -0
  6. package/dist/templates/js/alpine/src/main.js +19 -0
  7. package/dist/templates/js/base/_gitignore +5 -0
  8. package/dist/templates/js/base/assets/easel.svg +4 -0
  9. package/dist/templates/js/base/config/settings_data.json +12 -0
  10. package/dist/templates/js/base/config/settings_schema.json +27 -0
  11. package/dist/templates/js/base/layout/theme.liquid +19 -0
  12. package/dist/templates/js/base/locales/en.default.json +13 -0
  13. package/dist/templates/js/base/locales/en.default.schema.json +21 -0
  14. package/dist/templates/js/base/sections/hero.liquid +30 -0
  15. package/dist/templates/js/base/sections/main-404.liquid +11 -0
  16. package/dist/templates/js/base/snippets/counter.liquid +9 -0
  17. package/dist/templates/js/base/src/main.js +21 -0
  18. package/dist/templates/js/base/src/sections.js +44 -0
  19. package/dist/templates/js/base/src/style.css +61 -0
  20. package/dist/templates/js/base/templates/404.json +9 -0
  21. package/dist/templates/js/base/templates/index.json +9 -0
  22. package/dist/templates/js/react/src/main.jsx +23 -0
  23. package/dist/templates/js/vue/src/Counter.vue +18 -0
  24. package/dist/templates/js/vue/src/main.js +13 -0
  25. package/dist/templates/ts/alpine/snippets/counter.liquid +9 -0
  26. package/dist/templates/ts/alpine/src/main.ts +22 -0
  27. package/dist/templates/ts/base/_gitignore +5 -0
  28. package/dist/templates/ts/base/assets/easel.svg +4 -0
  29. package/dist/templates/ts/base/config/settings_data.json +12 -0
  30. package/dist/templates/ts/base/config/settings_schema.json +27 -0
  31. package/dist/templates/ts/base/layout/theme.liquid +19 -0
  32. package/dist/templates/ts/base/locales/en.default.json +13 -0
  33. package/dist/templates/ts/base/locales/en.default.schema.json +21 -0
  34. package/dist/templates/ts/base/sections/hero.liquid +30 -0
  35. package/dist/templates/ts/base/sections/main-404.liquid +11 -0
  36. package/dist/templates/ts/base/snippets/counter.liquid +9 -0
  37. package/dist/templates/ts/base/src/main.ts +29 -0
  38. package/dist/templates/ts/base/src/sections.ts +47 -0
  39. package/dist/templates/ts/base/src/style.css +61 -0
  40. package/dist/templates/ts/base/templates/404.json +9 -0
  41. package/dist/templates/ts/base/templates/index.json +9 -0
  42. package/dist/templates/ts/react/src/main.tsx +40 -0
  43. package/dist/templates/ts/vue/src/Counter.vue +18 -0
  44. package/dist/templates/ts/vue/src/main.ts +14 -0
  45. package/package.json +43 -0
@@ -0,0 +1,9 @@
1
+ {
2
+ "sections": {
3
+ "hero": {
4
+ "type": "hero",
5
+ "settings": {}
6
+ }
7
+ },
8
+ "order": ["hero"]
9
+ }
@@ -0,0 +1,40 @@
1
+ import '@vitejs/plugin-react/preamble';
2
+ import {useState} from 'react';
3
+ import {createRoot} from 'react-dom/client';
4
+ import {mountSections} from './sections';
5
+
6
+ function Counter({decrease, increase}: {decrease: string; increase: string}) {
7
+ const [count, setCount] = useState(0);
8
+ return (
9
+ <div className="counter">
10
+ <button
11
+ type="button"
12
+ aria-label={decrease}
13
+ onClick={() => setCount((value) => value - 1)}
14
+ >
15
+ −
16
+ </button>
17
+ <output>{count}</output>
18
+ <button
19
+ type="button"
20
+ aria-label={increase}
21
+ onClick={() => setCount((value) => value + 1)}
22
+ >
23
+ +
24
+ </button>
25
+ </div>
26
+ );
27
+ }
28
+
29
+ const dispose = mountSections('[data-easel-counter]', (element) => {
30
+ const root = createRoot(element);
31
+ root.render(
32
+ <Counter
33
+ decrease={element.dataset.decrease ?? ''}
34
+ increase={element.dataset.increase ?? ''}
35
+ />,
36
+ );
37
+ return () => root.unmount();
38
+ });
39
+
40
+ if (import.meta.hot) import.meta.hot.dispose(dispose);
@@ -0,0 +1,18 @@
1
+ <script setup lang="ts">
2
+ import {ref} from 'vue';
3
+
4
+ defineProps({
5
+ decrease: {type: String, required: true},
6
+ increase: {type: String, required: true},
7
+ });
8
+
9
+ const count = ref(0);
10
+ </script>
11
+
12
+ <template>
13
+ <div class="counter">
14
+ <button type="button" :aria-label="decrease" @click="count -= 1">−</button>
15
+ <output>{{ count }}</output>
16
+ <button type="button" :aria-label="increase" @click="count += 1">+</button>
17
+ </div>
18
+ </template>
@@ -0,0 +1,14 @@
1
+ import {createApp} from 'vue';
2
+ import Counter from './Counter.vue';
3
+ import {mountSections} from './sections';
4
+
5
+ const dispose = mountSections('[data-easel-counter]', (element) => {
6
+ const app = createApp(Counter, {
7
+ decrease: element.dataset.decrease ?? '',
8
+ increase: element.dataset.increase ?? '',
9
+ });
10
+ app.mount(element);
11
+ return () => app.unmount();
12
+ });
13
+
14
+ if (import.meta.hot) import.meta.hot.dispose(dispose);
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "create-easel-theme",
3
+ "version": "0.1.0",
4
+ "description": "Create a Shopify Liquid theme with Easel, Vite, and your choice of tools",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Billy Noyes",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/BillyNoyes/Easel.git",
11
+ "directory": "packages/create-easel"
12
+ },
13
+ "homepage": "https://easel.billynoyes.co.uk/",
14
+ "bugs": "https://github.com/BillyNoyes/Easel/issues",
15
+ "bin": {
16
+ "create-easel-theme": "bin/create-easel-theme.mjs"
17
+ },
18
+ "files": [
19
+ "bin",
20
+ "dist"
21
+ ],
22
+ "engines": {
23
+ "node": ">=22.12.0"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public",
27
+ "provenance": true
28
+ },
29
+ "dependencies": {
30
+ "@clack/prompts": "1.8.0",
31
+ "cross-spawn": "7.0.6"
32
+ },
33
+ "devDependencies": {
34
+ "@types/cross-spawn": "6.0.6",
35
+ "@types/node": "^24.0.0",
36
+ "tsup": "^8.5.0",
37
+ "typescript": "^5.9.0"
38
+ },
39
+ "scripts": {
40
+ "build": "tsup src/cli.ts --format esm --target node22 --clean && node scripts/build-templates.mjs",
41
+ "check": "tsc --noEmit"
42
+ }
43
+ }