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

chore: multi fix

This commit is contained in:
Juanfran 2024-03-15 09:02:56 +01:00
parent d0e62f30dc
commit eb715ddb7c
8 changed files with 17 additions and 13 deletions

View file

@ -57,9 +57,9 @@ or
```
// 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)

View file

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

View file

@ -1,4 +1,4 @@
penpot.ui.open('Contrast plugin', 'http://localhost:4201', {
penpot.ui.open('Contrast plugin', 'http://localhost:4210', {
width: 450,
height: 625,
});

View file

@ -5,9 +5,8 @@ import AutoLoad from '@fastify/autoload';
/* eslint-disable-next-line */
export interface AppOptions {}
export function app(fastify: FastifyInstance, opts: AppOptions) {
fastify;
// eslint-disable-next-line @typescript-eslint/require-await
export async function app(fastify: FastifyInstance, opts: AppOptions) {
// This loads all plugins defined in plugins
// those should be support plugins that are reused
// through your application
@ -16,8 +15,8 @@ export function app(fastify: FastifyInstance, opts: AppOptions) {
options: { ...opts },
});
// This loads all plugins defined in routes
// define your routes in one of these
// // This loads all plugins defined in routes
// // define your routes in one of these
void fastify.register(AutoLoad, {
dir: path.join(__dirname, 'routes'),
options: { ...opts },

View file

@ -2,6 +2,7 @@ import { FastifyInstance } from 'fastify';
import fp from 'fastify-plugin';
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);
});

View file

@ -7,6 +7,7 @@ import sensible from '@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);
});

View file

@ -3,7 +3,8 @@ import { v4 } from 'uuid';
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 fakeSessionId = v4();
@ -105,3 +106,5 @@ export default function (fastify: FastifyInstance) {
});
});
}
export default routes;

View file

@ -76,7 +76,7 @@ export class PluginModalElement extends HTMLElement {
display: flex;
flex-direction: column;
position: fixed;
inset-block-start: 10px;
inset-block-end: 10px;
inset-inline-start: 10px;
z-index: 1000;
padding: 20px;