0
Fork 0
mirror of https://github.com/penpot/penpot-plugins.git synced 2025-01-06 14:50:21 -05:00

feat: updated ports and documentation for easier development

This commit is contained in:
alonso.torres 2024-05-23 10:24:30 +02:00 committed by Alonso Torres
parent adb9ad0adb
commit 7283a9bd36
8 changed files with 30 additions and 14 deletions

View file

@ -62,6 +62,21 @@ Open in your browser: `http://localhost:4210/`
- if you want to create a new plugin, read the following [README](docs/create-plugin.md)
## Sample plugins
| Plugin | Description | PORT | Start command | Manifest URL |
| ---------------- | ----------------------------------------------------------- | ---- | ----------------------------- | ------------------------------------------ |
| poc-state-plugin | Sandbox plugin to test new plugins api functionality | 4301 | npm run start:pc-plugin | http://localhost:4301/assets/manifest.json |
| contrast-plugin | Sample plugin that gives you color contrast information | 4302 | npm run start:contrast-plugin | http://localhost:4302/manifest.json |
| icons-plugin | Tool to add icons from [Feather](https://feathericons.com/) | 4303 | npm run start:icons-plugin | http://localhost:4303/assets/manifest.json |
## Web Apps
| App | Description | PORT | Start command | URL |
| --------------- | ----------------------------------------------------------------- | ---- | ---------------------------- | ---------------------- |
| plugins-runtime | Runtime for the plugins subsystem | 4200 | npm run start | |
| example-styles | Showcase of some of the Penpot styles that can be used in plugins | 4201 | npm run start:styles-example | http://localhost:4201/ |
## License
```

View file

@ -1,6 +1,6 @@
{
"name": "Contrast plugin",
"host": "http://localhost:4210",
"host": "http://localhost:4302",
"code": "/plugin.js",
"permissions": [
"page:read",

View file

@ -8,13 +8,13 @@ export default defineConfig({
cacheDir: '../../node_modules/.vite/apps/contrast-plugin',
server: {
port: 4200,
host: 'localhost',
port: 4302,
host: '0.0.0.0',
},
preview: {
port: 4210,
host: 'localhost',
port: 4302,
host: '0.0.0.0',
},
plugins: [nxViteTsPaths()],

View file

@ -8,13 +8,13 @@ export default defineConfig({
cacheDir: '../../node_modules/.vite/apps/example-styles',
server: {
port: 4200,
host: 'localhost',
port: 4201,
host: '0.0.0.0',
},
preview: {
port: 4300,
host: 'localhost',
port: 4201,
host: '0.0.0.0',
},
plugins: [nxViteTsPaths()],

View file

@ -1,6 +1,6 @@
{
"name": "Icons plugin",
"host": "http://localhost:4202",
"host": "http://localhost:4303",
"code": "/assets/plugin.js",
"permissions": [
"page:read",

View file

@ -1,7 +1,7 @@
{
"name": "POC State Read",
"description": "Sandbox plugin for plugins development",
"host": "http://localhost:4202",
"host": "http://localhost:4301",
"code": "/assets/plugin.js",
"icon": "/assets/icon.png",
"permissions": [

View file

@ -52,6 +52,7 @@ export default defineConfig({
sourcemap: true,
},
preview: {
host: '0.0.0.0',
port: 4200,
},
test: {

View file

@ -5,11 +5,11 @@
"license": "MIT",
"scripts": {
"start": "concurrently --kill-others --names build,server \"npx nx run plugins-runtime:build --watch --mode development\" \"npx nx run plugins-runtime:preview\"",
"start:pc-plugin": "npx nx run-many --targets=buildPlugin,serve --projects=poc-state-plugin --watch",
"start:pc-plugin": "npx nx run-many --targets=buildPlugin,serve --projects=poc-state-plugin --watch --host 0.0.0.0 --port 4301",
"start:contrast-plugin": "npx nx run contrast-plugin:build --watch & npx nx run contrast-plugin:preview",
"start:rpc-api": "npx nx serve rpc-api",
"start:styles-example": "npx nx run example-styles:serve --port 4202",
"start:icons-plugin": "npx nx run-many --targets=buildPlugin,serve --projects=icons-plugin --watch --port 4202",
"start:styles-example": "npx nx run example-styles:serve --host 0.0.0.0 --port 4201",
"start:icons-plugin": "npx nx run-many --targets=buildPlugin,serve --projects=icons-plugin --watch --host 0.0.0.0 --port 4303",
"build": "npx nx build plugins-runtime --emptyOutDir=true",
"lint": "nx run-many --all --target=lint --parallel",
"lint:affected": "npx nx affected --target=lint",