Skip to content

Commit

Permalink
fix: issue with manifest and build plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
nmerget committed Nov 29, 2024
1 parent 017565e commit c642735
Show file tree
Hide file tree
Showing 20 changed files with 52 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/release/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const release = async ({ github, context, workspace, zipName, srcDir }) => {
github,
context,
release_id,
assetName: zipName,
assetName: `${zipName}.zip`,
assetPath,
});
};
Expand Down
8 changes: 7 additions & 1 deletion .github/scripts/release/zip-folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

import AdmZip from "adm-zip";

import { existsSync } from "node:fs";

const zipFolder = async (destPath, assetPath) => {
const zip = new AdmZip();
zip.addLocalFolder(`${destPath}/dist`);
const indexHtmlPath = `${destPath}/index.html`;
if (existsSync(indexHtmlPath)) {
zip.addLocalFile(`${destPath}/index.html`);
}
zip.addLocalFile(`${destPath}/index.js`);
zip.addLocalFile(`${destPath}/manifest.json`);
return zip.writeZipPromise(assetPath);
};
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ jobs:
- name: ⏫ Upload Release Assets
id: upload-release-asset
uses: actions/github-script@v7
env:
ICON_RELEASE_ID: ${{ vars.ICON_RELEASE_ID }}
with:
result-encoding: json
script: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
dist
.idea
/packages/**/index.html
/packages/**/index.js
20 changes: 18 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"cross-spawn": "~7.0.5"
},
"devDependencies": {
"@types/node": "^22.10.1",
"npm-run-all": "4.1.5",
"adm-zip": "^0.5.16"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/auto-sync/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "auto-sync",
"id": "1443742630333209915",
"api": "1.0.0",
"main": "dist/index.js",
"ui": "dist/index.html",
"main": "index.js",
"ui": "index.html",
"capabilities": [],
"enableProposedApi": false,
"documentAccess": "dynamic-page",
Expand Down
2 changes: 1 addition & 1 deletion packages/auto-sync/ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineConfig({
assetsInlineLimit: 100000000,
chunkSizeWarningLimit: 100000000,
cssCodeSplit: false,
outDir: "../dist",
outDir: "../",
rollupOptions: {
output: {},
},
Expand Down
2 changes: 1 addition & 1 deletion packages/auto-sync/widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "Your Figma Plugin",
"scripts": {
"build": "esbuild src/index.tsx --bundle --outfile=../dist/index.js --target=es6",
"build": "esbuild src/index.tsx --bundle --outfile=../index.js --target=es6",
"lint": "eslint --ext .ts,.tsx --ignore-pattern node_modules .",
"lint:fix": "eslint --ext .ts,.tsx --ignore-pattern node_modules --fix .",
"dev": "npm run build -- --watch"
Expand Down
2 changes: 1 addition & 1 deletion packages/codegen/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}
],
"editorType": ["dev"],
"main": "dist/index.js",
"main": "index.js",
"networkAccess": { "allowedDomains": ["none"] },
"documentAccess": "dynamic-page"
}
2 changes: 1 addition & 1 deletion packages/codegen/plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "code.js",
"type": "module",
"scripts": {
"build": "esbuild src/index.ts --bundle --outfile=../dist/index.js --target=ES6",
"build": "esbuild src/index.ts --bundle --outfile=../index.js --target=ES6",
"lint": "eslint --ext .ts,.tsx --ignore-pattern node_modules .",
"lint:fix": "eslint --ext .ts,.tsx --ignore-pattern node_modules --fix .",
"dev": "npm run build -- --watch"
Expand Down
4 changes: 2 additions & 2 deletions packages/design-migration/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"id": "1441699628075302748",
"api": "1.0.0",
"editorType": ["figma"],
"ui": "dist/design-migration/index.html",
"main": "dist/design-migration/index.js",
"ui": "index.html",
"main": "index.js",
"networkAccess": { "allowedDomains": ["none"] },
"documentAccess": "dynamic-page"
}
2 changes: 1 addition & 1 deletion packages/design-migration/plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "design-migration.js",
"type": "module",
"scripts": {
"build": "esbuild src/index.ts --bundle --outfile=../dist/design-migration/index.js --target=ES6",
"build": "esbuild src/index.ts --bundle --outfile=../index.js --target=ES6",
"lint": "eslint --ext .ts,.tsx --ignore-pattern node_modules .",
"lint:fix": "eslint --ext .ts,.tsx --ignore-pattern node_modules --fix .",
"dev": "npm run build -- --watch"
Expand Down
2 changes: 1 addition & 1 deletion packages/design-migration/ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineConfig({
assetsInlineLimit: 100000000,
chunkSizeWarningLimit: 100000000,
cssCodeSplit: false,
outDir: "../dist/design-migration",
outDir: "../",
rollupOptions: {
output: {},
},
Expand Down
4 changes: 2 additions & 2 deletions packages/handover/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "handover",
"id": "1443742630222209915",
"api": "1.0.0",
"main": "dist/index.js",
"ui": "dist/index.html",
"main": "index.js",
"ui": "index.html",
"capabilities": [],
"enableProposedApi": false,
"documentAccess": "dynamic-page",
Expand Down
12 changes: 6 additions & 6 deletions packages/handover/ui/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import {viteSingleFile} from "vite-plugin-singlefile";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { viteSingleFile } from "vite-plugin-singlefile";

// https://vite.dev/config/
export default defineConfig({
plugins: [react(),viteSingleFile()],
plugins: [react(), viteSingleFile()],
build: {
target: "esnext",
assetsInlineLimit: 100000000,
chunkSizeWarningLimit: 100000000,
cssCodeSplit: false,
outDir: "../dist",
outDir: "../",
rollupOptions: {
output: {},
},
},
})
});
2 changes: 1 addition & 1 deletion packages/handover/widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "Your Figma Plugin",
"scripts": {
"build": "esbuild src/index.tsx --bundle --outfile=../dist/index.js --target=es6",
"build": "esbuild src/index.tsx --bundle --outfile=../index.js --target=es6",
"lint": "eslint --ext .ts,.tsx --ignore-pattern node_modules .",
"lint:fix": "eslint --ext .ts,.tsx --ignore-pattern node_modules --fix .",
"dev": "npm run build -- --watch"
Expand Down
4 changes: 2 additions & 2 deletions packages/inspect/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"api": "1.0.0",
"capabilities": ["inspect"],
"editorType": ["dev"],
"ui": "dist/inspect/index.html",
"main": "dist/inspect/index.js",
"ui": "index.html",
"main": "index.js",
"networkAccess": { "allowedDomains": ["none"] },
"documentAccess": "dynamic-page"
}
2 changes: 1 addition & 1 deletion packages/inspect/plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "inspect.js",
"type": "module",
"scripts": {
"build": "esbuild src/index.ts --bundle --outfile=../dist/inspect/index.js --target=ES6",
"build": "esbuild src/index.ts --bundle --outfile=../index.js --target=ES6",
"lint": "eslint --ext .ts,.tsx --ignore-pattern node_modules .",
"lint:fix": "eslint --ext .ts,.tsx --ignore-pattern node_modules --fix .",
"dev": "npm run build -- --watch"
Expand Down
2 changes: 1 addition & 1 deletion packages/inspect/ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineConfig({
assetsInlineLimit: 100000000,
chunkSizeWarningLimit: 100000000,
cssCodeSplit: false,
outDir: "../dist/inspect",
outDir: "..",
rollupOptions: {
output: {},
},
Expand Down

0 comments on commit c642735

Please sign in to comment.