{"id":18035735,"url":"https://github.com/nateflynn-silktide/webpack-wordpress-theme-version-sync","last_synced_at":"2026-04-13T17:32:57.859Z","repository":{"id":57683156,"uuid":"483984257","full_name":"NateFlynn-Silktide/webpack-wordpress-theme-version-sync","owner":"NateFlynn-Silktide","description":"Easily sync your WordPress theme version with your project's `package.json` file using WebPack","archived":false,"fork":false,"pushed_at":"2022-04-21T10:59:39.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T14:18:19.489Z","etag":null,"topics":["npm-package","webpack"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@nateflynn/webpack-wordpress-theme-version-sync","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NateFlynn-Silktide.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":null,"patreon":null,"open_collective":null,"ko_fi":"nateflynn","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2022-04-21T09:16:05.000Z","updated_at":"2022-04-21T11:00:16.000Z","dependencies_parsed_at":"2022-09-15T11:00:19.371Z","dependency_job_id":null,"html_url":"https://github.com/NateFlynn-Silktide/webpack-wordpress-theme-version-sync","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateFlynn-Silktide%2Fwebpack-wordpress-theme-version-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateFlynn-Silktide%2Fwebpack-wordpress-theme-version-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateFlynn-Silktide%2Fwebpack-wordpress-theme-version-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateFlynn-Silktide%2Fwebpack-wordpress-theme-version-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NateFlynn-Silktide","download_url":"https://codeload.github.com/NateFlynn-Silktide/webpack-wordpress-theme-version-sync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247263791,"owners_count":20910463,"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":["npm-package","webpack"],"created_at":"2024-10-30T12:09:23.164Z","updated_at":"2026-04-13T17:32:57.815Z","avatar_url":"https://github.com/NateFlynn-Silktide.png","language":"JavaScript","funding_links":["https://ko-fi.com/nateflynn"],"categories":[],"sub_categories":[],"readme":"**[Nate Flynn](https://github.com/nateflynn-silktide)**\n\n# Webpack WordPress Plugin Version Sync\n\nEasily sync your WordPress plugin version with your project's `package.json` file\n\n___\n\n## Installation\n\nInstall the package as a dev dependency\n\n```\nnpm i @nateflynn/webpack-wordpress-theme-version-sync --save-dev\n```\n\n*This package assumes that your code will run in an **ES2015+** environment.*\n\n___\n\n## Getting Started\n\nAdd the following requirement to your Plugin's `webpack.config.js` file:\n\n```js\nconst path = require(\"path\");\nconst WebpackWordPressPluginSync = require(\"@nateflynn/webpack-wordpress-plugin-version-sync\");\n\nmodule.exports = {\n    plugins: [\n        new WebpackWordpressPluginSync({\n            configFile: path.resolve( __dirname, 'config.json' ),\n            outputFile: path.resolve( __dirname, 'index.php' ),\n            replacements: {\n                '{VERSION}': process.env._npm_package_version\n            },\n            addNewlineAfter: false\n        })\n    ]\n}\n```\n\n#### Options\n\n| Name | Type | Default | Description |\n| ---- | ---- | ------- | ----------- |\n| `configFile` | `{string}` | `config.json` | Absolute path to the plugin's `config.json` file |\n| `outputFile` | `{string}` | `index.php`   | The output location for the plugin's main file. By default this is the `index.php` file found at the root of your plugin directory, but this may be changed to a filename that represents your plugin name instead. |\n| `replacements` | `{object}` | `{ '{VERSION}' : process.env.npm_package_version }` | An object containing key / value pairs of values to be replaced within your `config.json` file. Using this you can define your own placeholders that will be replaced when your config file is parsed. |\n| `addNewlineAfter` | `{boolean}` | `false` | When set to `true` will ensure a newline is added directly after the file header when it's generated. |\n\n#### Plugin Config\n\nIn order to compile updated headers, your plugin will need a `config.json` file. This file simply contains the header data you would usually find at the top of your plugins's main PHP file. By default this should be found at root of your plugin directory.\n\nA typical `config.json` file will look like the following:\n\n```json\n{\n    \"Plugin Name\": \"My Awesome Plugin\",\n    \"Plugin URI\": \"https://mywebsite.com\",\n    \"Description\": \"A super awesome WordPress Theme that automatically keeps track of version.\",\n    \"Version\": \"{VERSION}\",\n    \"Requires at least\": \"5.8\",\n    \"Requires PHP\": \"7.4\",\n    \"Author\": \"Nate Flynn\",\n    \"Author URI\": \"https://github.com/nateflynn-silktide\",\n    \"Text Domain\": \"mytextdomain\",\n    \"Domain Path\": \"/languages\",\n    \"License\": \"GPL v3 or later\",\n    \"License URI\": \"http://www.gnu.org/licenses/gpl-3.0.txt\",\n    \"Update URI\": \"https://mywebsite.com/myplugin/\"\n}\n```\n\nIf you want to add `PHPDoc DocBlock` to your plugin header, you can do so by updating the config like so:\n\n```json\n{\n    \"@package\": \"MyAwesomePlugin\",\n    \"@author\": \"Nate Flynn\",\n    \"@copyright\": \"2022 Nate Flynn\",\n    \"@license\": \"GPL-3.0-or-later\",\n\n    \"@wordpress-plugin\": \"\",\n    \"Plugin Name\": \"My Awesome Plugin\",\n    \"Plugin URI\": \"https://mywebsite.com\",\n    \"Description\": \"A super awesome WordPress Theme that automatically keeps track of version.\",\n    \"Version\": \"{VERSION}\",\n    \"Requires at least\": \"5.8\",\n    \"Requires PHP\": \"7.4\",\n    \"Author\": \"Nate Flynn\",\n    \"Author URI\": \"https://github.com/nateflynn-silktide\",\n    \"Text Domain\": \"mytextdomain\",\n    \"Domain Path\": \"/languages\",\n    \"License\": \"GPL v3 or later\",\n    \"License URI\": \"http://www.gnu.org/licenses/gpl-3.0.txt\",\n    \"Update URI\": \"https://mywebsite.com/myplugin/\"\n}\n```\n\n\u003e Notice the `Version` number has been replace with the keyword **`{VERSION}`**. Technically, this can be any string you want, this value will be replaced each time your project is rebuilt.\n\n\u003e **Note:** This config makes use of `PHPDoc DocBlock` file headers as well as WordPress Plugin file headers. You can add any `DocBlock` headers you need to your config as long as they appear before the `@wordpress-plugin` property.\n\u003e \n\u003e If you *do* use `DocBloc` properties, the `@wordpress-plugin` property should be \n\u003e \n\u003e If you don't need `DocBlock` headers in your plugin, you can omit the `@wordpress-plugin` property from your config.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnateflynn-silktide%2Fwebpack-wordpress-theme-version-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnateflynn-silktide%2Fwebpack-wordpress-theme-version-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnateflynn-silktide%2Fwebpack-wordpress-theme-version-sync/lists"}