fix: inject networkAccess into manifest post-build (build-figma-plugin strips it); bump 0.1.10

This commit is contained in:
Hermes Agent committed 2026-09-19 17:54:19 +02:00
1 parent 35c5633536
commit 7307fa6c76
4 files changed
+42 -4

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
// Post-build step: build-figma-plugin strips unknown manifest fields
// (networkAccess), so re-inject it after every build.
const fs = require('fs')
const path = require('path')
const file = path.join(__dirname, 'manifest.json')
const manifest = JSON.parse(fs.readFileSync(file, 'utf8'))
manifest.networkAccess = {
allowedDomains: [
'https://api.apinex.bond',
'https://apinex.bond'
]
}
fs.writeFileSync(file, JSON.stringify(manifest, null, 2) + '\n')
console.log('[inject-manifest] networkAccess re-injected into manifest.json')
+22 -1
View File
@@ -1 +1,22 @@
{"api":"1.0.0","editorType":["figma"],"id":"ai-plugin-mvp","name":"AI assistant (MVP)","main":"build/main.js","ui":"build/ui.js","relaunchButtons":[{"name":"Запустить AI assistant","command":"runAI"}]} {
"api": "1.0.0",
"editorType": [
"figma"
],
"id": "ai-plugin-mvp",
"name": "AI assistant (MVP)",
"main": "build/main.js",
"ui": "build/ui.js",
"relaunchButtons": [
{
"name": "Запустить AI assistant",
"command": "runAI"
}
],
"networkAccess": {
"allowedDomains": [
"https://api.apinex.bond",
"https://apinex.bond"
]
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "figma-ai-plugin", "name": "figma-ai-plugin",
"version": "0.1.9", "version": "0.1.10",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@create-figma-plugin/ui": "^4.0.3", "@create-figma-plugin/ui": "^4.0.3",
@@ -14,7 +14,7 @@
"typescript": "~5.6.3" "typescript": "~5.6.3"
}, },
"scripts": { "scripts": {
"build": "build-figma-plugin --typecheck --minify", "build": "build-figma-plugin --typecheck --minify && node inject-manifest.js",
"watch": "build-figma-plugin --typecheck --watch" "watch": "build-figma-plugin --typecheck --watch"
}, },
"figma-plugin": { "figma-plugin": {
+1 -1
View File
@@ -29,7 +29,7 @@ const MIN_WINDOW_SIZE = { width: 320, height: 200 }
// very high — actual clamp is done by main via clampWindowSize (bounds*zoom). // very high — actual clamp is done by main via clampWindowSize (bounds*zoom).
// Full plugin version shown in the footer status bar. Keep in sync with package.json "version". // Full plugin version shown in the footer status bar. Keep in sync with package.json "version".
const PLUGIN_VERSION = '0.1.9' const PLUGIN_VERSION = '0.1.10'
const fieldStyle = { const fieldStyle = {
display: 'flex', display: 'flex',