Skip to content

Commit 955c283

Browse files
authored
Added Penpot Support and upgrade dependencies for Node 20.0 (#53)
* Added scaffolding for muli-plugin architecture * Add proper support for Penpot using dev server and initial FigPen class usage in Figma * Avoid JS errors on runtime for Penpot * Working development server for Penpot * Plugin opens in Penpot! * Basic messaging system between UI and Canvas in penpot * Initial UI load on both Penpot and Figma * Working Selection changes on Penpot and fully functional plugin on Figma * Working plugin in both platoforms! * Fixed Figma PluginMessage schema * Fix localstorage parsing issue * Add dark theme support for both Penpot and Figma at config level but not implemented in the UI yet. * Fix initial selection not being sent to the UI and localstorage parsing for Penpot. * Update webpack and babel configuration with compatibility for Node 20.0 * Remove console.log statements from App.js, Core.js, and FigPen.js to clean up the codebase. * Added Netlify configuration for Penpot, deployment scripts, and updated config for Penpot. * Removed duplicated function and added Dark Mode Support * Fix pager numbering in Penpot * Fix pager numbering replace in text nodes * Add plugin icon * Bump plugin version
1 parent 2de904d commit 955c283

26 files changed

Lines changed: 4858 additions & 17604 deletions

.babelrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
secrets.json
55
node_modules/
66
dist/
7+
figma/dist/
8+
penpot/dist/
9+
# Local Netlify folder
10+
.netlify

babel.config.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
'@babel/preset-env',
5+
{
6+
targets: {
7+
// Support modern browsers and Node.js
8+
browsers: ['> 1%', 'last 2 versions', 'not dead'],
9+
node: 'current'
10+
},
11+
// Use modern JavaScript features
12+
useBuiltIns: 'usage',
13+
corejs: 3,
14+
// Enable modern syntax
15+
modules: false, // Let webpack handle modules
16+
debug: false,
17+
// Include more modern features
18+
include: [
19+
'@babel/plugin-proposal-optional-chaining',
20+
'@babel/plugin-proposal-nullish-coalescing-operator',
21+
'@babel/plugin-proposal-logical-assignment-operators'
22+
]
23+
}
24+
]
25+
],
26+
plugins: [
27+
// Support for class properties and private methods (using assumptions instead of loose)
28+
'@babel/plugin-proposal-class-properties',
29+
'@babel/plugin-proposal-private-methods',
30+
'@babel/plugin-transform-private-property-in-object',
31+
// Support for decorators (if needed)
32+
['@babel/plugin-proposal-decorators', { legacy: true }],
33+
// Modern JavaScript operators
34+
'@babel/plugin-proposal-optional-chaining',
35+
'@babel/plugin-proposal-nullish-coalescing-operator',
36+
'@babel/plugin-proposal-logical-assignment-operators'
37+
],
38+
// Enable modern JavaScript features
39+
assumptions: {
40+
setPublicClassFields: true,
41+
privateFieldsAsSymbols: true
42+
}
43+
};

bun.lock

Lines changed: 4307 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

manifest.json renamed to figma/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Super Tidy",
33
"id": "731260060173130163",
44
"api": "1.0.0",
5-
"ui": "dist/ui.html",
5+
"ui": "dist/index.html",
66
"main": "dist/core.js",
77
"documentAccess": "dynamic-page",
88
"networkAccess": {

netlify.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[build]
2+
3+
# Directory that contains the deploy-ready HTML files and assets
4+
publish = "penpot/"
5+
6+
# Default build command
7+
command = "bun run build:penpot"
8+
9+
[build.environment]
10+
NODE_VERSION = "20"
11+
12+
# Headers for security and performance
13+
[[headers]]
14+
for = "/*"
15+
[headers.values]
16+
Access-Control-Allow-Origin = "*"
17+
Access-Control-Allow-Methods = "GET, POST, PUT, DELETE, OPTIONS"
18+
Access-Control-Allow-Headers = "Content-Type, Authorization, X-Requested-With"
19+
20+
# Cache static assets
21+
[[headers]]
22+
for = "/assets/*"
23+
[headers.values]
24+
Cache-Control = "public, max-age=31536000, immutable"

0 commit comments

Comments
 (0)