mirror of
https://github.com/penpot/penpot-plugins.git
synced 2025-01-08 07:50:44 -05:00
chore: multi fix
This commit is contained in:
parent
d0e62f30dc
commit
eb715ddb7c
8 changed files with 17 additions and 13 deletions
|
@ -57,9 +57,9 @@ or
|
||||||
|
|
||||||
```
|
```
|
||||||
// for the contrast plugin
|
// for the contrast plugin
|
||||||
npx nx run contrast-plugin:serve-static --port 4201
|
npx nx run contrast-plugin:serve-static --port 4210
|
||||||
```
|
```
|
||||||
|
|
||||||
Open in your browser: `http://localhost:4201/`
|
Open in your browser: `http://localhost:4210/`
|
||||||
|
|
||||||
- if you want to create a new plugin, read the following [README](docs/create-plugin.md)
|
- if you want to create a new plugin, read the following [README](docs/create-plugin.md)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "Contrast plugin",
|
"name": "Contrast plugin",
|
||||||
"code": "http://localhost:4201/plugin.js",
|
"code": "http://localhost:4210/plugin.js",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"page:read",
|
"page:read",
|
||||||
"file:read",
|
"file:read",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
penpot.ui.open('Contrast plugin', 'http://localhost:4201', {
|
penpot.ui.open('Contrast plugin', 'http://localhost:4210', {
|
||||||
width: 450,
|
width: 450,
|
||||||
height: 625,
|
height: 625,
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,9 +5,8 @@ import AutoLoad from '@fastify/autoload';
|
||||||
/* eslint-disable-next-line */
|
/* eslint-disable-next-line */
|
||||||
export interface AppOptions {}
|
export interface AppOptions {}
|
||||||
|
|
||||||
export function app(fastify: FastifyInstance, opts: AppOptions) {
|
// eslint-disable-next-line @typescript-eslint/require-await
|
||||||
fastify;
|
export async function app(fastify: FastifyInstance, opts: AppOptions) {
|
||||||
|
|
||||||
// This loads all plugins defined in plugins
|
// This loads all plugins defined in plugins
|
||||||
// those should be support plugins that are reused
|
// those should be support plugins that are reused
|
||||||
// through your application
|
// through your application
|
||||||
|
@ -16,8 +15,8 @@ export function app(fastify: FastifyInstance, opts: AppOptions) {
|
||||||
options: { ...opts },
|
options: { ...opts },
|
||||||
});
|
});
|
||||||
|
|
||||||
// This loads all plugins defined in routes
|
// // This loads all plugins defined in routes
|
||||||
// define your routes in one of these
|
// // define your routes in one of these
|
||||||
void fastify.register(AutoLoad, {
|
void fastify.register(AutoLoad, {
|
||||||
dir: path.join(__dirname, 'routes'),
|
dir: path.join(__dirname, 'routes'),
|
||||||
options: { ...opts },
|
options: { ...opts },
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { FastifyInstance } from 'fastify';
|
||||||
import fp from 'fastify-plugin';
|
import fp from 'fastify-plugin';
|
||||||
import cors from '@fastify/cors';
|
import cors from '@fastify/cors';
|
||||||
|
|
||||||
export default fp(function (fastify: FastifyInstance) {
|
// eslint-disable-next-line @typescript-eslint/require-await
|
||||||
|
export default fp(async function (fastify: FastifyInstance) {
|
||||||
void fastify.register(cors);
|
void fastify.register(cors);
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,6 +7,7 @@ import sensible from '@fastify/sensible';
|
||||||
*
|
*
|
||||||
* @see https://github.com/fastify/fastify-sensible
|
* @see https://github.com/fastify/fastify-sensible
|
||||||
*/
|
*/
|
||||||
export default fp(function (fastify: FastifyInstance) {
|
// eslint-disable-next-line @typescript-eslint/require-await
|
||||||
|
export default fp(async function (fastify: FastifyInstance) {
|
||||||
void fastify.register(sensible);
|
void fastify.register(sensible);
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,7 +3,8 @@ import { v4 } from 'uuid';
|
||||||
|
|
||||||
const token = process.env.ACCESS_TOKEN;
|
const token = process.env.ACCESS_TOKEN;
|
||||||
|
|
||||||
export default function (fastify: FastifyInstance) {
|
// eslint-disable-next-line @typescript-eslint/require-await
|
||||||
|
async function routes(fastify: FastifyInstance) {
|
||||||
const apiUrl = process.env.API_URL + '/api/rpc/command';
|
const apiUrl = process.env.API_URL + '/api/rpc/command';
|
||||||
const fakeSessionId = v4();
|
const fakeSessionId = v4();
|
||||||
|
|
||||||
|
@ -105,3 +106,5 @@ export default function (fastify: FastifyInstance) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default routes;
|
||||||
|
|
|
@ -76,7 +76,7 @@ export class PluginModalElement extends HTMLElement {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset-block-start: 10px;
|
inset-block-end: 10px;
|
||||||
inset-inline-start: 10px;
|
inset-inline-start: 10px;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
|
Loading…
Reference in a new issue