├── .bin ├── packer ├── packer.cmd └── packer.ps1 ├── .dockerignore ├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .gitattributes ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── ci.yml │ ├── combine.yml │ ├── node.js.yml │ └── release.yml ├── .gitignore ├── .npmignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── changelog ├── conventional-changelog.js ├── conventional-recommended-bump.js ├── index.js ├── parser-opts.js ├── templates │ ├── commit.hbs │ ├── footer.hbs │ ├── header.hbs │ └── template.hbs └── writer-opts.js ├── cli ├── __tests__ │ ├── __snapshots__ │ │ ├── init.test.js.snap │ │ └── ssl.test.js.snap │ ├── fixtures │ │ ├── packer-blank-theme-1.0.13.json │ │ └── packer-blank-theme-1.0.13.zip │ ├── help.test.js │ ├── init.test.js │ └── ssl.test.js ├── commands │ ├── build.js │ ├── deploy.js │ ├── format.js │ ├── help.js │ ├── init.js │ ├── lint.js │ ├── ssl.js │ ├── start.js │ ├── theme.js │ └── zip.js └── index.js ├── docs ├── .gitignore ├── babel.config.js ├── docs │ ├── commands.md │ ├── config │ │ ├── environment.md │ │ ├── files.md │ │ ├── settings.md │ │ └── webpack.md │ ├── features │ │ ├── admin-api.md │ │ ├── bundles.md │ │ ├── dotenv.md │ │ └── liquid-styles.md │ ├── install.md │ ├── overview.md │ ├── quick-start.mdx │ ├── ssl.mdx │ └── structure.md ├── docusaurus.config.js ├── package.json ├── sidebars.js ├── src │ ├── css │ │ └── custom.css │ └── pages │ │ ├── index.js │ │ └── styles.module.css ├── static │ ├── .nojekyll │ └── img │ │ ├── custom.svg │ │ ├── favicon.ico │ │ ├── logo.svg │ │ ├── logos │ │ ├── babel.png │ │ ├── postcss.svg │ │ ├── sass.svg │ │ ├── shopify.svg │ │ └── webpack.svg │ │ ├── rocket.svg │ │ ├── ssl_1.png │ │ ├── ssl_2.png │ │ ├── undraw_docusaurus_mountain.svg │ │ ├── undraw_docusaurus_react.svg │ │ ├── undraw_docusaurus_tree.svg │ │ ├── webpack-bundle-analyzer.png │ │ └── webpack.svg └── yarn.lock ├── jest.config.js ├── package.json ├── packer.schema.js ├── src ├── config │ ├── README.md │ ├── __tests__ │ │ ├── fixtures │ │ │ ├── packer.config.js │ │ │ └── packerWithError.config.js │ │ └── index.test.js │ ├── common-paths.js │ └── index.js ├── env │ ├── index.js │ └── packer-env.schema.js ├── linters │ ├── eslint │ │ └── index.js │ ├── prettier │ │ └── index.js │ └── stylelint │ │ └── index.js ├── server │ ├── app.js │ ├── asset │ │ └── index.js │ ├── client.js │ ├── dev │ │ └── index.js │ ├── is-hot-update-file.js │ ├── prompts │ │ ├── continue-if-published-theme.js │ │ └── skip-settings-data.js │ ├── ssl.js │ └── sync.js ├── theme │ ├── api.js │ └── index.js ├── utilities │ ├── clear-console.js │ ├── get-available-port-series.js │ ├── get-chunk-name.js │ ├── get-layout-entrypoints.js │ └── get-template-entrypoints.js └── webpack │ ├── config │ ├── analyze.config.js │ ├── dev.config.js │ └── prod.config.js │ ├── custom.js │ ├── hmr-alamo-loader.js │ ├── hot-client.js │ ├── include-liquid-styles.js │ ├── parts │ ├── assets.js │ ├── copy.js │ ├── core.js │ ├── css.js │ ├── env.js │ ├── liquid-styles.js │ ├── optimization.js │ └── scss.js │ ├── script-tags.html │ └── style-tags.html ├── test.sh ├── tests ├── node14 │ └── Dockerfile └── node15 │ └── Dockerfile └── yarn.lock /.bin/packer: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") 3 | 4 | case `uname` in 5 | *CYGWIN*) basedir=`cygpath -w "$basedir"`;; 6 | esac 7 | 8 | if [ -x "$basedir/node" ]; then 9 | "$basedir/node" "$basedir/../cli/index.js" "$@" 10 | ret=$? 11 | else 12 | node "$basedir/../cli/index.js" "$@" 13 | ret=$? 14 | fi 15 | exit $ret 16 | -------------------------------------------------------------------------------- /.bin/packer.cmd: -------------------------------------------------------------------------------- 1 | @IF EXIST "%~dp0\node.exe" ( 2 | "%~dp0\node.exe" "%~dp0\..\cli\index.js" %* 3 | ) ELSE ( 4 | @SETLOCAL 5 | @SET PATHEXT=%PATHEXT:;.JS;=;% 6 | node "%~dp0\..\cli\index.js" %* 7 | ) -------------------------------------------------------------------------------- /.bin/packer.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent 3 | 4 | $exe="" 5 | if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { 6 | # Fix case when both the Windows and Linux builds of Node 7 | # are installed in the same directory 8 | $exe=".exe" 9 | } 10 | $ret=0 11 | if (Test-Path "$basedir/node$exe") { 12 | & "$basedir/node$exe" "$basedir/../cli/index.js" $args 13 | $ret=$LASTEXITCODE 14 | } else { 15 | & "node$exe" "$basedir/../cli/index.js" $args 16 | $ret=$LASTEXITCODE 17 | } 18 | exit $ret 19 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .bin 2 | .git 3 | .github 4 | changelog 5 | docs 6 | node_modules 7 | tests -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | charset = utf-8 3 | end_of_line = lf 4 | insert_final_newline = true 5 | trim_trailing_whitespace = true 6 | 7 | [*.{js,ts,tsx}] 8 | indent_style = space 9 | indent_size = 2 10 | 11 | # Markdown Files 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.pem 3 | *.md 4 | *.snap 5 | cli/__tests__/fixtures/ -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "eslint:recommended", 4 | "plugin:node/recommended", 5 | "plugin:prettier/recommended" 6 | ], 7 | "env": { 8 | "jest": true, 9 | "node": true 10 | }, 11 | "globals": { 12 | "__webpack_public_path__": "writable" 13 | }, 14 | "rules": { 15 | "no-console": "off", 16 | "no-process-env": 0 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.js eol=lf 3 | *.ts eol=lf 4 | *.jsx eol=lf 5 | *.json eol=lf 6 | *.liquid eol=lf 7 | *.md eol=lf 8 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: hayes0724 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. npm install 16 | 2. npm run build 17 | 3. npm run deploy 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **System (please complete the following information):** 27 | - OS: [e.g. Windows 10, Ubuntu, OSX] 28 | - Node Version [e.g. 14.15.1] 29 | - NPM Version [e.g. 6.14.8] 30 | - Browser [e.g. chrome, safari] 31 | 32 | **Packer (please complete the following information):** 33 | - Version [e.g. 1.2.1] 34 | 35 | **Theme (please complete the following information):** 36 | - [Shopify Packer theme](https://github.com/hayes0724/packer-blank-theme) [e.g. True] 37 | - Version [e.g. 22] 38 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "[FEAT]" 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | **What kind of change does this PR introduce?** (check at least one) 4 | - [ ] Bugfix 5 | - [ ] Feature 6 | - [ ] Code style update 7 | - [ ] Refactor 8 | - [ ] Docs 9 | - [ ] Other, please describe: 10 | 11 | **Does this PR introduce a breaking change?** (check one) 12 | - [ ] Yes 13 | - [ ] No 14 | 15 | If yes, please describe the impact and migration path for existing applications: 16 | 17 | **The PR fulfills these requirements:** 18 | - [ ] It's submitted to the `dev` branch, _not_ the `master` branch 19 | 20 | **Other information:** 21 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | commit-message: 8 | prefix: fix 9 | prefix-development: chore 10 | include: scope 11 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | 7 | jobs: 8 | lint: 9 | name: Lint files 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | 14 | - name: Use Node.js ${{ matrix.node-version }} 15 | uses: actions/setup-node@v2 16 | with: 17 | node-version: '14' 18 | cache: 'yarn' 19 | 20 | - name: Install dependencies 21 | run: yarn install --frozen-lockfile 22 | 23 | - name: Lint 24 | run: yarn run lint 25 | 26 | 27 | test: 28 | name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }} 29 | runs-on: ${{ matrix.os }} 30 | 31 | strategy: 32 | matrix: 33 | node-version: [14.x, 16.x] 34 | os: [ubuntu-latest, windows-latest, macos-latest] 35 | 36 | steps: 37 | - uses: actions/checkout@v2 38 | 39 | - name: Use Node.js ${{ matrix.node-version }} 40 | uses: actions/setup-node@v2 41 | with: 42 | node-version: ${{ matrix.node-version }} 43 | cache: 'yarn' 44 | 45 | - name: Install dependencies 46 | run: yarn install --frozen-lockfile 47 | 48 | - name: Run tests 49 | run: npm test 50 | 51 | release: 52 | needs: test 53 | name: Release 54 | runs-on: ubuntu-latest 55 | 56 | steps: 57 | - uses: actions/checkout@v2 58 | 59 | - name: Use Node.js ${{ matrix.node-version }} 60 | uses: actions/setup-node@v2 61 | with: 62 | node-version: '14' 63 | cache: 'yarn' 64 | 65 | - name: Install dependencies 66 | run: yarn install --frozen-lockfile 67 | 68 | - name: Release 69 | env: 70 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 71 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 72 | run: yarn run semantic-release 73 | -------------------------------------------------------------------------------- /.github/workflows/combine.yml: -------------------------------------------------------------------------------- 1 | name: "Combine Dependabot PRs" 2 | 3 | on: workflow_dispatch 4 | 5 | jobs: 6 | combine-prs: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2.3.3 10 | - uses: maadhattah/combine-dependabot-prs@main 11 | with: 12 | branchPrefix: "dependabot" 13 | mustBeGreen: true 14 | combineBranchName: "combined-prs" 15 | ignoreLabel: "nocombine" 16 | baseBranch: "master" 17 | openPR: true 18 | allowSkipped: false 19 | -------------------------------------------------------------------------------- /.github/workflows/node.js.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: 4 | pull_request: 5 | branches: [ dev ] 6 | push: 7 | branches: [ dev ] 8 | 9 | jobs: 10 | lint: 11 | name: Lint 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: Use Node.js ${{ matrix.node-version }} 17 | uses: actions/setup-node@v2 18 | with: 19 | node-version: '14' 20 | cache: 'yarn' 21 | 22 | - name: Install dependencies 23 | run: yarn install --frozen-lockfile 24 | 25 | - name: Lint 26 | run: npm run lint 27 | 28 | 29 | test: 30 | name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }} 31 | runs-on: ${{ matrix.os }} 32 | needs: lint 33 | 34 | strategy: 35 | matrix: 36 | node-version: [14.x, 16.x] 37 | os: [ubuntu-latest, windows-latest, macos-latest] 38 | 39 | steps: 40 | - uses: actions/checkout@v2 41 | 42 | - name: Use Node.js ${{ matrix.node-version }} 43 | uses: actions/setup-node@v2 44 | with: 45 | node-version: ${{ matrix.node-version }} 46 | cache: 'yarn' 47 | 48 | - name: Install dependencies 49 | run: yarn install --frozen-lockfile 50 | 51 | - name: Run tests 52 | run: yarn test 53 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release package manually 2 | 3 | on: workflow_dispatch 4 | 5 | jobs: 6 | release: 7 | name: Release 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v2 11 | 12 | - name: Use Node.js ${{ matrix.node-version }} 13 | uses: actions/setup-node@v1 14 | with: 15 | node-version: 14.x 16 | cache: 'yarn' 17 | 18 | - name: Install dependencies 19 | run: yarn install --frozen-lockfile 20 | 21 | - name: Release 22 | env: 23 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 24 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 25 | run: yarn run semantic-release 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | logs 2 | node_modules/ 3 | /.idea/ 4 | /.yarn-metadata.json 5 | /config.js 6 | /yarn-error.log 7 | /config.json 8 | /.github/.token 9 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Packages # 2 | ############ 3 | *.7z 4 | *.dmg 5 | *.gz 6 | *.iso 7 | *.jar 8 | *.rar 9 | *.tar 10 | *.zip 11 | 12 | # Logs # 13 | *.log 14 | 15 | # Custom # 16 | ###################### 17 | changelog/ 18 | docs/ 19 | tests/ 20 | __tests__ 21 | /.idea 22 | /.yarn-metadata.json 23 | /yarn-error.log 24 | /.github/.token 25 | /jest.config.js 26 | /test.sh -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | We ❤️ pull requests. If you'd like to fix a bug, contribute a feature or just correct a typo, please feel free to do so. 4 | 5 | If you're thinking of adding a big new feature, consider opening an issue or discussion first to discuss it to ensure it aligns to the direction of the project and to ensure it's not already being worked on. 6 | 7 | > All pull requests should be submitted to the `dev` branch, **not** the `master` branch. 8 | 9 | ## Getting started 10 | 11 | 1. To start working on the codebase, first fork the repo: 12 | 13 | ![GitHub forks](https://img.shields.io/github/forks/hayes0724/shopify-packer?style=social) 14 | 15 | 2. Install all package dependencies and link local packages: 16 | 17 | ``` 18 | yarn install 19 | ``` 20 | 21 | 3. Write some features, then run tests with: 22 | 23 | ``` 24 | yarn run test 25 | ``` 26 | 27 | 4. Make a pull request to the dev branch 28 | 29 | ## Folder Structure 30 | 31 | The following documents the folder structure for this project and what the purpose of each folder is: 32 | 33 | docs - Documentaion site at https://hayes0724.github.io/shopify-packer/docs/ 34 | 35 | cli - All commands are located here 36 | 37 | src - Shared files required by commands 38 | 39 | src/config - Handles all of Packer's configurable options 40 | 41 | src/env - Handles Packers environment values 42 | 43 | src/linters - ESlint, prettier and stylelint 44 | 45 | src/server - All dev server files and theme syncing 46 | 47 | src/theme - Theme functions like list, download, create... 48 | 49 | src/utilities - General helpers like entrypoints, check ports, clear console 50 | 51 | src/webpack - everything for building themes 52 | 53 | src/webpack/config - main configs for building (development and production) 54 | 55 | src/webpack/parts - configuration parts used in configs (css, scss, js, liquid styles, etc..) 56 | 57 | ## Docs 58 | 59 | We use [Docusaurus](https://docusaurus.io/docs) and all files are located in the docs folder. 60 | 61 | Start doc server 62 | 63 | ``` 64 | yarn run docs:start 65 | ``` 66 | 67 | ## Commit message guidelines 68 | 69 | #### Atomic commits 70 | 71 | If possible, make [atomic commits](https://en.wikipedia.org/wiki/Atomic_commit), which means: 72 | - a commit should contain exactly one self-contained functional change 73 | - a functional change should be contained in exactly one commit 74 | - a commit should not create an inconsistent state (such as test errors, linting errors, partial fix, feature with documentation etc...) 75 | 76 | A complex feature can be broken down into multiple commits as long as each one maintains a consistent state and consists of a self-contained change. 77 | 78 | #### Commit message format 79 | 80 | Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject**: 81 | 82 | ```commit 83 | (): 84 | 85 | 86 | 87 |