{"id":14981844,"url":"https://github.com/jaredpalmer/presspack","last_synced_at":"2025-04-04T09:09:47.456Z","repository":{"id":21792622,"uuid":"92863720","full_name":"jaredpalmer/presspack","owner":"jaredpalmer","description":"💻 Wordpress like it's 2022 with Webpack and Docker","archived":false,"fork":false,"pushed_at":"2022-12-02T23:55:38.000Z","size":335,"stargazers_count":687,"open_issues_count":22,"forks_count":83,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-28T08:09:14.766Z","etag":null,"topics":["babel","docker","webpack","wordpress"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaredpalmer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["jaredpalmer"]}},"created_at":"2017-05-30T18:28:46.000Z","updated_at":"2024-12-18T15:18:23.000Z","dependencies_parsed_at":"2023-01-11T23:15:49.886Z","dependency_job_id":null,"html_url":"https://github.com/jaredpalmer/presspack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredpalmer%2Fpresspack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredpalmer%2Fpresspack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredpalmer%2Fpresspack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredpalmer%2Fpresspack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaredpalmer","download_url":"https://codeload.github.com/jaredpalmer/presspack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149502,"owners_count":20891954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["babel","docker","webpack","wordpress"],"created_at":"2024-09-24T14:04:22.407Z","updated_at":"2025-04-04T09:09:47.440Z","avatar_url":"https://github.com/jaredpalmer.png","language":"JavaScript","readme":"# Presspack\n\n\u003e Make WordPress theme development great again.\n\n[![Discord](https://img.shields.io/discord/769256827007139912?label=%F0%9F%92%AC%20%20join%20us%20on%20discord\u0026style=plastic)](https://discord.com/invite/RevdZTYMzr)\n\n## Features\n\n- Modern JavaScript through Webpack\n- Live reload via BrowserSync\n- SCSS support\n- Easy dev environments with Docker Compose\n- Stateless, immutable plugin management via Composer\n- Helpful HTML5 Router for firing JS based on WordPress page slug.\n- Nothing else.\n\n## Requirements\n\n- Node.js\n- Yarn\n- PHP and Composer\n- Docker for Mac / Windows\n- Docker Compose\n\n## Getting Started\n\n```bash\ngit clone git@github.com:jaredpalmer/presspack.git\nyarn install\ncomposer install # if you want plugins ( not required )\ndocker-compose up\n```\n\n## Developing Locally\n\nTo work on the theme locally, open another window/tab in terminal and run:\n\n```bash\nyarn start\n```\n\nThis will open a browser, watch all files (php, scss, js, etc) and reload the\nbrowser when you press save.\n\n## Building for Production\n\nTo create an optimized production build, run:\n\n```bash\nyarn build\n```\n\nThis will minify assets, bundle and uglify javascript, and compile scss to css.\nIt will also add cachebusting names to then ends of the compiled files, so you\ndo not need to bump any enqueued asset versions in `functions.php`.\n\n## Changing ports\n\nThere are two ports involved, the port of the dockerized WordPress instance,\nand the port the Browser Sync runs on. To change the port of the dockerized\nWordPress instance go into [`docker-compose.yml`](docker-compose.yml#L25) and\nmodify `ports`.\n\n```yml\n# docker-compose.yml\n ...\n  ports:\n    - \"9009:80\" # only need to change `9009:80` --\u003e localhost:9009\n ...\n```\n\nIf you want to change the port you develop on (the default is 4000), then open\n[`scripts/webpack.config.js`](scripts/webpack.config.js#L119) and modify\n`BrowserSyncPlugin`'s `port` option. If you changed the WordPress port above,\nbe sure to also change `proxy` accordingly. Don't forget the trailing slash.\n\n```js\n// scripts/webpack.config.js\n...\nnew BrowserSyncPlugin({\n  notify: false,\n  host: 'localhost',\n  port: 4000, // this is the port you develop on. Can be anything.\n  logLevel: 'silent',\n  files: ['./*.php'],\n  proxy: 'http://localhost:9009/', // This port must match docker-compose.yml\n}),\n...\n```\n\n## Project Structure\n\n```bash\n.\n├── composer.json                # Compose dependencies (plugins)\n├── composer.lock                # Composer lock file\n├── docker-compose.yml           # Docker Compose configuration\n├── package.json                 # Node.js dependencies\n├──template                      # Wordpress PHP theme files\n│   ├── footer.php\n│   ├── functions.php\n│   ├── header.php\n│   ├── index.php\n│   └── page.php\n├──scripts                       # Build / Dev Scripts\n│   ├── build.js                 # Build task\n│   ├── start.js                 # Start task\n│   └── webpack.config.js        # Webpack configuration\n└──src\n    ├── index.js                 # JavaScript entry point\n    ├── routes                   # Routes\n    │   ├── common.js            # JS that will run on EVERY page\n    │   └── \u003cxxx\u003e.js             # JS that will run on pages with \u003cxxx\u003e slug\n    ├── style.scss               # SCSS style entry point\n    ├── styles                   # SCSS\n    │   ├── _global-vars.scss\n    │   ├── _base.scss\n    │   └── ...\n    └── util\n        ├── Router.js            # HTML5 Router, DO NOT TOUCH\n        └── camelCase.js         # Helper function for Router, DO NOT TOUCH\n```\n\n## Local Database Backup\n\nHere's how to dump your local database with Docker into a `.sql` file\n\n```aidl\ndocker exec -it host_db_1 /usr/bin/mysqldump -u username -ppassword database_name \u003e backup.sql\n```\n\n## Local Database Restore\n\nRestore a previous database backup\n\n```aidl\ndocker exec -i host_db_1 /usr/bin/mysql -u username -ppassword database_name \u003c backup.sql\n```\n\n## Author\n\n- Jared Palmer [@jaredpalmer](https://twitter.com/jaredpalmer)\n","funding_links":["https://github.com/sponsors/jaredpalmer"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredpalmer%2Fpresspack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaredpalmer%2Fpresspack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredpalmer%2Fpresspack/lists"}