Skip to content

Commit 18845d1

Browse files
committed
Add prettier support
- Update README with setup guide to use recommened vscode settings - How to setup prettier
1 parent 350a897 commit 18845d1

File tree

8 files changed

+199
-19
lines changed

8 files changed

+199
-19
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
node_modules
2-
.DS_Store
1+
2+
node_modules/
3+
snippets/styleguide__section.liquid
4+
snippets/styleguide__example.liquid
5+
sections/styleguide.liquid
6+
snippets/styleguide__row.liquid
7+
.DS_Store

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"plugins": ["@shopify/prettier-plugin-liquid", "prettier-plugin-tailwindcss"]
3+
}

.theme-check.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
extends: theme-check:recommended
2+
ignore:
3+
- node_modules/**
4+
5+
# AssetPreload:
6+
# enabled: true
7+
# severity: 1
8+
# CdnPreconnect:
9+
# enabled: true
10+
# severity: 0
11+
# ContentForHeaderModification:
12+
# enabled: true
13+
# severity: 0
14+
# DeprecateBgsizes:
15+
# enabled: true
16+
# severity: 1
17+
# DeprecateLazysizes:
18+
# enabled: true
19+
# severity: 1
20+
# DeprecatedFilter:
21+
# enabled: true
22+
# severity: 1
23+
# DeprecatedTag:
24+
# enabled: true
25+
# severity: 1
26+
# ImgWidthAndHeight:
27+
# enabled: true
28+
# severity: 0
29+
# JSONSyntaxError:
30+
# enabled: true
31+
# severity: 0
32+
# LiquidHTMLSyntaxError:
33+
# enabled: true
34+
# severity: 0
35+
# MatchingTranslations:
36+
# enabled: true
37+
# severity: 0
38+
# MissingAsset:
39+
# enabled: true
40+
# severity: 0
41+
# MissingTemplate:
42+
# enabled: true
43+
# severity: 0
44+
# ignoreMissing: []
45+
# PaginationSize:
46+
# enabled: true
47+
# severity: 1
48+
# minSize: 1
49+
# maxSize: 50
50+
# ParserBlockingScript:
51+
# enabled: true
52+
# severity: 0
53+
# RemoteAsset:
54+
# enabled: true
55+
# severity: 1
56+
# RequiredLayoutThemeObject:
57+
# enabled: true
58+
# severity: 0
59+
# TranslationKeyExists:
60+
# enabled: true
61+
# severity: 0
62+
# UnclosedHTMLElement:
63+
# enabled: true
64+
# severity: 1
65+
# UndefinedObject:
66+
# enabled: true
67+
# severity: 1
68+
# UniqueStaticBlockId:
69+
# enabled: true
70+
# severity: 0
71+
# UnknownFilter:
72+
# enabled: true
73+
# severity: 0
74+
# UnusedAssign:
75+
# enabled: true
76+
# severity: 1
77+
# ValidHTMLTranslation:
78+
# enabled: true
79+
# severity: 1
80+
# ValidJSON:
81+
# enabled: true
82+
# severity: 0
83+
# ValidSchema:
84+
# enabled: true
85+
# severity: 0
86+
# ValidStaticBlockType:
87+
# enabled: true
88+
# severity: 0
89+
# VariableName:
90+
# enabled: true
91+
# severity: 1
92+
# format: snake_case
93+
#

.vscode/extensions.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"recommendations": [
3+
"waderyan.gitblame",
4+
"pranaygp.vscode-css-peek",
5+
"dakara.dakara-foldplus",
6+
"github.vscode-github-actions",
7+
"github.vscode-pull-request-github",
8+
"zignd.html-css-class-completion",
9+
"neilding.language-liquid",
10+
"esbenp.prettier-vscode",
11+
"urbantrout.refactor-css",
12+
"shopify.theme-check-vscode",
13+
"killalau.vscode-liquid-snippets",
14+
"bradlc.vscode-tailwindcss"
15+
]
16+
}

.vscode/settings.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"window.commandCenter": 1,
3+
"editor.fontSize": 14,
4+
"scm.inputFontSize": 14,
5+
"debug.console.fontSize": 14,
6+
"chat.editor.fontSize": 14,
7+
"editor.wordWrap": "on",
8+
"editor.minimap.enabled": true,
9+
"editor.tabSize": 2,
10+
"explorer.fileNesting.enabled": true,
11+
"explorer.fileNesting.patterns": {
12+
"": "",
13+
"package.json": "package-lock.json, yarn.lock, pnpm-lock.yaml, .gitattributes, .shopifyignore, postcss.config.js, tailwind.config.js, tsconfig.json, vite.config.ts, .gitignore, .theme-check.yml, release-notes.md, next-env.d.ts, turbo.json, vercel.json, *config.cjs, .prettierrc"
14+
},
15+
"workbench.editor.enablePreview": false,
16+
"editor.detectIndentation": false,
17+
"cursor.cpp.disabledLanguages": [],
18+
"cursor.chat.smoothStreaming": true,
19+
"terminal.integrated.fontSize": 14,
20+
"[liquid]": {
21+
"editor.defaultFormatter": "esbenp.prettier-vscode",
22+
"editor.formatOnSave": true
23+
},
24+
"diffEditor.ignoreTrimWhitespace": true,
25+
"diffEditor.hideUnchangedRegions.enabled": true,
26+
"diffEditor.renderSideBySide": false,
27+
"editor.formatOnSave": true
28+
}

README.md

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,63 @@ This is a kit to help extend and customize the [Paper Shopify theme](https://the
1212

1313
---
1414

15+
# Features
16+
17+
Paper has a number of useful features that make it a developer friendly theme to work with out of the box.
18+
19+
- **Fast and reliable**: From the very beginning, we've made sure Paper works fast and reliably by using the latest browser-supported features. Don't worry if you're still using an older browser, our progressive enhancement ensures you'll still have the best experience.
20+
- **Works with JavaScript disabled**: We want everyone to have access to your store, so we've minimized the use of JavaScript. Even if someone has disabled JavaScript, we've got you covered with excellent fallbacks for core functionality.
21+
- **Easily extendable**: We've built Paper with a modular approach, so it's super simple to extend and customize. We use Tailwind CSS to give you an easy approach to styling, and Alpine.js to add interactivity without weighing you down.
22+
- **Built-in styleguide**: Making site wide changes consistently is much easier now that you can preview all the theme components from a single page.
23+
- **Meets all standards for theme store**: Paper meets all the [requirements](https://shopify.dev/docs/themes/store/requirements) for the Shopify theme store.
24+
25+
---
26+
1527
# Getting started
1628

1729
### Requirements
1830

19-
- [Paper](https://themes.shopify.com/themes/paper/styles/poster) installed on your Shopify account
31+
Make sure all dependencies have been installed before moving on:
32+
2033
- [NPM](https://www.npmjs.com/package/npm) (6.0.0 or higher)
2134
- [Node.js](https://nodejs.org/en/download/) (16.0.0 or higher)
2235
- [Shopify CLI](https://shopify.dev/docs/themes/tools/cli/install) (3.0.0 or higher)
2336

2437
### Installing
2538

26-
1. Purchase Paper from the Shopify theme store and create a duplicate
39+
1. Purchase Space from the Shopify theme store and create a duplicate
2740
2. Clone this repo
28-
3. Replace `paper-theme.myshopify.com` in `package.json` with your Shopify store URL
41+
3. Replace `brickspacetestingstore.myshopify.com` in `package.json` with your Shopify store URL
2942
4. Run `npm install` to install dependencies
30-
5. Run `npm run pull` to download the your theme (be sure to select the theme that has Paper installed)
43+
5. Run `npm run pull` to download the your theme (be sure to select the theme that has Space installed)
3144
6. Run `npm run dev` to create a development preview
3245
7. Run `npm run build` to build production ready assets
3346

47+
### Development enviroment
48+
49+
Consider using recommened development envitorment for a consistent experience.
50+
51+
- Use [Cursor](https://www.cursor.com/)
52+
- Install extensions from `.vscode/extensions.json`
53+
- Install recommended Cursor settings from `.vscode/settings.json`
54+
- Open cursor settings by clicking `CMD + ,` then clicking Open Settings (JSON)
55+
- Paste in the settings from `.vscode/settings.json`
56+
57+
### Automatic code formatting
58+
59+
Automatic code formatting should be enabled by default if you follow above steps.
60+
61+
1. Install [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
62+
2. Ensure `editor.formatOnSave` is enabled in Cursor settings. Your `settings.json` should include the following:
63+
64+
```
65+
"[liquid]": {
66+
"editor.defaultFormatter": "esbenp.prettier-vscode",
67+
"editor.formatOnSave": true
68+
},
69+
"editor.formatOnSave": true
70+
```
71+
3472
### Command refferance
3573

3674
| Task Name | Description |
@@ -68,7 +106,7 @@ Section files follow a similar naming convention.
68106
### Using Alpine.js
69107

70108
- For debugging there are [Chrome](https://chrome.google.com/webstore/detail/alpinejs-devtools/fopaemeedckajflibkpifppcankfmbhk) and [Firefox](https://addons.mozilla.org/en-US/firefox/addon/alpinejs-devtools/?src=recommended) browser extensions available.
71-
- For an extensive list of Alpine resources take a look at this [repo](https://github.com/alpine-collective/awesome).
109+
- For an extensive list of Alpine resources take a look at this [repo](https://github.com/alpine-collective/awesome).
72110

73111
---
74112

@@ -77,9 +115,6 @@ Section files follow a similar naming convention.
77115
- [Discord community](https://discord.gg/4qdBFhmzCR)
78116
- [Twitter updates](https://twitter.com/brickspacelab)
79117
- [Our blog](https://brickspacelab.com/blogs/news)
80-
- [Paper docs](https://brickspacelab.notion.site/Paper-help-center-84ce6b9217574833a7d9b9f4053cb403)
81-
- [Paper changelog](https://brickspacelab.notion.site/Paper-changelog-cdfeea8101ae465f8880ac90ce22e951)
82118
- [Shopify Vite Plugin](https://shopify-vite.barrelny.com/)
83119
- [Alpine.js](https://alpinejs.dev/)
84120
- [Tailwind CSS](https://tailwindcss.com/)
85-

package.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
{
22
"name": "paper",
33
"version": "7.6.0",
4-
"description": "A feature rich and utilitarian Shopify theme",
54
"scripts": {
65
"dev": "npm-run-all --parallel vite_dev shopify_dev",
7-
"dev_sync": "npm-run-all --parallel vite_dev shopify_dev_sync",
86
"pull": "shopify theme pull --nodelete --store brickspacetestingstore.myshopify.com",
97
"shopify_dev": "shopify theme dev --store brickspacetestingstore.myshopify.com",
10-
"shopify_dev_sync": "shopify theme dev --theme-editor-sync --store brickspacetestingstore.myshopify.com",
118
"vite_dev": "vite dev",
129
"test": "vitest",
1310
"coverage": "vitest run --coverage",
@@ -21,17 +18,17 @@
2118
},
2219
"license": "MIT",
2320
"devDependencies": {
24-
"@shopify/prettier-plugin-liquid": "^1.0.6",
21+
"@shopify/prettier-plugin-liquid": "^1.5.2",
2522
"@tailwindcss/aspect-ratio": "^0.4.2",
26-
"@tailwindcss/forms": "^0.5.7",
23+
"@tailwindcss/forms": "^0.5.3",
2724
"autoprefixer": "^10.4.20",
2825
"jsdom": "^21.1.1",
2926
"npm-run-all": "^4.1.5",
3027
"postcss": "^8.4.47",
3128
"postcss-import": "^15.1.0",
3229
"postcss-nested": "^6.0.1",
33-
"prettier": "^2.8.7",
34-
"prettier-plugin-tailwindcss": "^0.2.6",
30+
"prettier": "^3.1.0",
31+
"prettier-plugin-tailwindcss": "^0.6.8",
3532
"tailwindcss": "^3.4.13",
3633
"vite": "^4.2.0",
3734
"vite-plugin-shopify": "^2.0.2",
@@ -41,9 +38,10 @@
4138
"@alpinejs/focus": "^3.12.0",
4239
"@alpinejs/intersect": "^3.12.0",
4340
"@alpinejs/persist": "^3.12.0",
44-
"@by-association-only/vite-plugin-shopify-clean": "^1.0.1",
4541
"alpinejs": "^3.12.0",
46-
"import": "^0.0.6",
4742
"instant.page": "5.1.1"
43+
},
44+
"config": {
45+
"store": "brickspacetestingstore.myshopify.com"
4846
}
4947
}

0 commit comments

Comments
 (0)