├── .gitignore ├── GLOSSARY.md ├── README.md ├── SUMMARY.md ├── book.json ├── context └── README.md ├── overview ├── addon_manifest.md ├── main_process.md └── renderer_process.md ├── references ├── README.md ├── hooks.md ├── paths.md ├── transpiling.md └── using_reactjs.md └── styles └── website.css /.gitignore: -------------------------------------------------------------------------------- 1 | # Node rules: 2 | ## Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 3 | .grunt 4 | 5 | ## Dependency directory 6 | ## Commenting this out is preferred by some people, see 7 | ## https://docs.npmjs.com/misc/faq#should-i-check-my-node_modules-folder-into-git 8 | node_modules 9 | 10 | # Book build output 11 | _book 12 | 13 | # eBook build output 14 | *.epub 15 | *.mobi 16 | *.pdf -------------------------------------------------------------------------------- /GLOSSARY.md: -------------------------------------------------------------------------------- 1 | # Glossary 2 | 3 | ## NPM 4 | 5 | Node.js Package Manager 6 | 7 | ## Node.js 8 | 9 | Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world. 10 | 11 | ## Electron 12 | 13 | Framework for creating native applications with web technologies like JavaScript, HTML, and CSS -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## 📢 This repository has been deprecated in favor of the following resources 3 | 4 | * [Local Add-on API](https://build.localwp.com/) 5 | * [Local React Component Library](https://github.com/getflywheel/local-components) 6 | * [Local TypeScript API](https://getflywheel.github.io/local-addon-api/) 7 | -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | * [Overview](README.md) 4 | * [Addon Manifest](overview/addon_manifest.md) 5 | * [Renderer Process](overview/renderer_process.md) 6 | * [Main Process](overview/main_process.md) 7 | * [Context](context/README.md) 8 | * [References](references/README.md) 9 | * [Transpiling ES6/JSX](references/transpiling.md) 10 | * [Using React.js](references/using_reactjs.md) 11 | * [Hooks](references/hooks.md) 12 | * [Paths](references/paths.md) 13 | 14 | -------------------------------------------------------------------------------- /book.json: -------------------------------------------------------------------------------- 1 | { 2 | "links": { 3 | "sidebar": { 4 | "Pressmatic": "https://pressmatic.io", 5 | "Contribute To This Guide": "https://github.com/pressmatic/docs-addon-api" 6 | } 7 | }, 8 | "pluginsConfig": {}, 9 | "plugins": [ 10 | "gist", 11 | "anchorjs" 12 | ] 13 | } -------------------------------------------------------------------------------- /context/README.md: -------------------------------------------------------------------------------- 1 | ## ```context.environment``` 2 | 3 | Includes the following properties: 4 | 5 | * **appPath:** Path to running Pressmatic.app 6 | * **userHome:** Path to current user home directory 7 | * **phpVersion:** Available PHP versions in Pressmatic 8 | * **version:** Pressmatic version 9 | * **dockerPath:** Path to Docker binary in Pressmatic.app 10 | * **userDataPath:** Path to Pressmatic user data folder. On Mac OS X this defaults to ~/Library/Application Support/Pressmatic 11 | 12 | ## ```context.hooks``` 13 | 14 | Use context.hooks to run actions at certain times. Hooks are especially useful when adding in element with ```context.React```. 15 | 16 | ## ```context.electron``` 17 | 18 | Exposes [Electron API](http://electron.atom.io/docs/api/). The available methods and classes will differ based on whether or not this is ran from the main process or renderer process. 19 | 20 | With the Electron API you can create dialogs, open new windows, and more. 21 | 22 | ## ```context.request``` 23 | 24 | [request](https://www.npmjs.com/package/request) npm package which makes it very easy to send HTTP/HTTPS requests. 25 | 26 | ## ```context.fileSystem``` 27 | 28 | [fs-extra](https://www.npmjs.com/package/fs-extra) npm package which extends the native [fs API](https://nodejs.org/api/fs.html) in Node.js. 29 | 30 | ## ```context.fileSystemJetpack``` 31 | 32 | [fs-jetpack](https://www.npmjs.com/package/fs-jetpack) npm package. Some may prefer it over the native [fs API](https://nodejs.org/api/fs.html) in Node.js. 33 | 34 | ## ```context.notifier``` 35 | 36 | [node-notifier](https://www.npmjs.com/package/node-notifier) npm package. The main method in this class is ```notify```. 37 | 38 | #### Example 39 | 40 | ```js 41 | context.notifier.notify({ 42 | title: 'Notification Title', 43 | message: 'This is an example notification message.' 44 | }); 45 | ``` 46 | 47 | ## ```context.process``` 48 | Node.js [process](https://nodejs.org/api/process.html) object. 49 | 50 | ## ```context.jQuery``` 51 | **Renderer Only** 52 | 53 | [jQuery](http://api.jquery.com/) 3.0.x 54 | 55 | ## ```context.React``` 56 | **Renderer Only** 57 | 58 | ```context.React``` to required to use JSX in your renderer entry point. You can also use context.React to access React's [Top-Level API](http://facebook.github.io/react/docs/top-level-api.html). 59 | 60 | For more information about React in Pressmatic addons please see [Using React.js](references/using_reactjs.md). 61 | 62 | ## ```context.docker``` 63 | 64 | Use ```context.docker``` to run Docker commands. 65 | 66 | #### Example (ES6, needs transpiled to ES5) 67 | 68 | ```js 69 | context.docker(`start ${container}`).then(stdout => { 70 | //Success 71 | }).catch(({stdout, stderr}) => { 72 | //Something bad happened 73 | }); 74 | ``` -------------------------------------------------------------------------------- /overview/addon_manifest.md: -------------------------------------------------------------------------------- 1 | # Addon Manifest 2 | 3 | You can learn more about package.json from the [npm documentation](https://docs.npmjs.com/files/package.json). -------------------------------------------------------------------------------- /overview/main_process.md: -------------------------------------------------------------------------------- 1 | # Main Process 2 | 3 | -------------------------------------------------------------------------------- /overview/renderer_process.md: -------------------------------------------------------------------------------- 1 | # Renderer Process 2 | 3 | -------------------------------------------------------------------------------- /references/README.md: -------------------------------------------------------------------------------- 1 | # References 2 | 3 | -------------------------------------------------------------------------------- /references/hooks.md: -------------------------------------------------------------------------------- 1 | # Hooks 2 | 3 | -------------------------------------------------------------------------------- /references/paths.md: -------------------------------------------------------------------------------- 1 | # Paths 2 | 3 | Use `__dirname` to get the path to your addon. 4 | -------------------------------------------------------------------------------- /references/transpiling.md: -------------------------------------------------------------------------------- 1 | # Transpiling ES6/JSX 2 | 3 | -------------------------------------------------------------------------------- /references/using_reactjs.md: -------------------------------------------------------------------------------- 1 | # Using React.js in Addons 2 | 3 | -------------------------------------------------------------------------------- /styles/website.css: -------------------------------------------------------------------------------- 1 | /* CSS for website */ 2 | .gitbook-link { 3 | display: none !important; 4 | } 5 | 6 | .custom-link[href="https://www.gitbook.com/book/pressmatic/addon-api"] { 7 | display: none !important; 8 | } --------------------------------------------------------------------------------