Migrate plugins to pnpm

This commit is contained in:
Andrey Antukh 2025-12-30 12:04:12 +01:00
parent 9431ae6858
commit d20c011db2
16 changed files with 25139 additions and 25 deletions

View File

@ -63,36 +63,38 @@ jobs:
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: npm
- name: Install deps
working-directory: ./plugins
run: npm ci
shell: bash
run: |
corepack enable;
corepack install;
pnpm install;
- name: Run Lint
working-directory: ./plugins
run: npm run lint
run: pnpm run lint
- name: Run Format Check
working-directory: ./plugins
run: npm run format:check
run: pnpm run format:check
- name: Run Test
working-directory: ./plugins
run: npm run test
run: pnpm run test
- name: Build runtime
working-directory: ./plugins
run: npm run build
run: pnpm run build
- name: Build plugins
working-directory: ./plugins
run: npm run build:plugins
run: pnpm run build:plugins
- name: Build styles
working-directory: ./plugins
run: npm run build:styles-example
run: pnpm run build:styles-example
test-frontend:
name: "Frontend Tests"

View File

@ -4,7 +4,7 @@
"license": "MPL-2.0",
"author": "Kaleidos INC",
"private": true,
"packageManager": "yarn@4.12.0+sha512.f45ab632439a67f8bc759bf32ead036a1f413287b9042726b7cc4818b7b49e14e9423ba49b18f9e06ea4941c1ad062385b1d8760a8d5091a1a31e5f6219afca8",
"packageManager": "pnpm@10.26.2+sha512.0e308ff2005fc7410366f154f625f6631ab2b16b1d2e70238444dd6ae9d630a8482d92a451144debc492416896ed16f7b114a86ec68b8404b2443869e68ffda6",
"repository": {
"type": "git",
"url": "https://github.com/penpot/penpot"

3
plugins/.gitignore vendored
View File

@ -52,4 +52,5 @@ docs/api
apps/e2e/screenshots/*.png
vite.config.*.timestamp*
vitest.config.*.timestamp*
vitest.config.*.timestamp*
.pnpm-store

View File

@ -1 +1 @@
npx --no -- commitlint --edit $1
pnpx --no -- commitlint --edit $1

View File

@ -1,5 +1,5 @@
#!/bin/bash
if [ -z "$HUSKY_HOOK" ] || [ "$HUSKY_HOOK" = "pre-commit" ]; then
npm run lint:affected
pnpm run lint:affected
fi

View File

@ -1,5 +1,5 @@
#!/bin/bash
if [ "$HUSKY_HOOK" = "pre-push" ]; then
npm run lint:affected
pnpm run lint:affected
fi

View File

@ -53,8 +53,9 @@ a {
}
pre {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
'Liberation Mono', 'Courier New', monospace;
font-family:
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
'Courier New', monospace;
}
svg {

View File

@ -64,7 +64,8 @@ import { CommonModule } from '@angular/common';
text-decoration: inherit;
}
pre {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
font-family:
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
'Liberation Mono', 'Courier New', monospace;
}
svg {
@ -79,7 +80,8 @@ import { CommonModule } from '@angular/common';
background-color: rgba(55, 65, 81, 1);
border-radius: 0.25rem;
color: rgba(229, 231, 235, 1);
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
font-family:
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
'Liberation Mono', 'Courier New', monospace;
overflow: scroll;
padding: 0.5rem 0.75rem;

View File

@ -12,7 +12,6 @@ npm run build:doc
Once you've done that, you'll find the result in `./dist/doc`
#### Deploy the API Documentation
Just move to the `stable` branch in this repository and rebase it with

View File

@ -41,7 +41,6 @@
```
**Explanation**:
- `Agent` opens a browser, logs into Penpot, and creates a file.
- `runCode` executes the plugin code and returns the file state after execution.

View File

@ -2,8 +2,10 @@
* These are methods and properties available on the `penpot` global object.
*
*/
export interface Penpot
extends Omit<Context, 'addListener' | 'removeListener'> {
export interface Penpot extends Omit<
Context,
'addListener' | 'removeListener'
> {
ui: {
/**
* Opens the plugin UI. It is possible to develop a plugin without interface (see Palette color example) but if you need, the way to open this UI is using `penpot.ui.open`.

View File

@ -1,4 +1,7 @@
{
"cli": {
"packageManager": "pnpm"
},
"pluginsConfig": {
"@nx/js": {
"analyzeSourceFiles": true

View File

@ -8,9 +8,6 @@
"name": "penpot-plugins",
"version": "0.6.0",
"license": "MIT",
"workspaces": [
"packages/*"
],
"dependencies": {
"@angular/animations": "19.1.3",
"@angular/common": "19.1.3",
@ -16964,6 +16961,7 @@
"resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz",
"integrity": "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"dependencies": {
@ -16981,6 +16979,7 @@
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"dependencies": {
@ -17013,6 +17012,7 @@
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"dev": true,
"license": "ISC",
"optional": true,
"peer": true,
"engines": {

View File

@ -26,7 +26,6 @@
"test": "nx run-many -t test --parallel -p plugins-runtime lorem-ipsum-plugin colors-to-tokens-plugin",
"test:e2e": "nx test e2e",
"registry": "nx local-registry",
"prepare": "husky",
"build:doc": "typedoc --tsconfig libs/plugins-runtime/tsconfig.lib.json --customCss ./tools/typedoc.css --out dist/doc",
"release": "tsx ./tools/scripts/publish.ts"
},
@ -44,6 +43,7 @@
"@commitlint/cli": "^18.6.0",
"@commitlint/config-conventional": "^18.6.0",
"@eslint/eslintrc": "^2.1.1",
"@eslint/js": "8.57.0",
"@nx/angular": "20.3.2",
"@nx/esbuild": "20.3.2",
"@nx/eslint": "20.3.2",

25100
plugins/pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
packages:
- 'apps/**'
- 'libs/**'
storeDir: .pnpm-store