0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-02 21:00:12 -05:00

Merge pull request #7 from Runroom/hotfix/structure

Modify folder structure
This commit is contained in:
Alex Sánchez 2024-04-09 08:07:01 +02:00 committed by GitHub
commit f9531f831c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 21 additions and 21 deletions

View file

@ -1,3 +1,3 @@
node_modules node_modules
dist dist
src/penpot.js src/ui/penpot.js

View file

@ -1,4 +1,4 @@
node_modules node_modules
dist dist
src/penpot.js src/ui/penpot.js
LICENSE LICENSE

View file

@ -9,12 +9,12 @@
"watch": "webpack watch", "watch": "webpack watch",
"lint": "run-p lint:*", "lint": "run-p lint:*",
"lint:eslint": "eslint .", "lint:eslint": "eslint .",
"lint:stylelint": "stylelint src/**.css", "lint:stylelint": "stylelint src/ui/**.css",
"lint:prettier": "prettier --check .", "lint:prettier": "prettier --check .",
"lint:tsc": "tsc --noEmit --pretty false", "lint:tsc": "tsc --noEmit --pretty false",
"fix-lint": "run-p fix-lint:*", "fix-lint": "run-p fix-lint:*",
"fix-lint:eslint": "eslint . --fix", "fix-lint:eslint": "eslint . --fix",
"fix-lint:stylelint": "stylelint src/**.css --fix", "fix-lint:stylelint": "stylelint src/ui/**.css --fix",
"fix-lint:prettier": "prettier --write ." "fix-lint:prettier": "prettier --write ."
}, },
"author": "Kaleidos", "author": "Kaleidos",

View file

@ -1,4 +1,4 @@
import { NodeData, TextData } from './interfaces'; import { NodeData, TextData } from '../common/interfaces';
interface Signatures { interface Signatures {
[key: string]: string; [key: string]: string;

View file

@ -1,5 +1,5 @@
import { createPenpotItem } from '.'; import { createPenpotItem } from '.';
import { NodeData } from '../interfaces'; import { NodeData } from '../../common/interfaces';
import { PenpotFile } from '../penpot'; import { PenpotFile } from '../penpot';
import { translateFills } from '../translators'; import { translateFills } from '../translators';

View file

@ -1,4 +1,4 @@
import { NodeData } from '../interfaces'; import { NodeData } from '../../common/interfaces';
import { PenpotFile } from '../penpot'; import { PenpotFile } from '../penpot';
import { translateFills } from '../translators'; import { translateFills } from '../translators';

View file

@ -1,5 +1,5 @@
import { createPenpotItem } from '.'; import { createPenpotItem } from '.';
import { NodeData } from '../interfaces'; import { NodeData } from '../../common/interfaces';
import { createFile } from '../penpot'; import { createFile } from '../penpot';
export const createPenpotFile = (node: NodeData) => { export const createPenpotFile = (node: NodeData) => {

View file

@ -1,5 +1,5 @@
import { createPenpotItem } from '.'; import { createPenpotItem } from '.';
import { NodeData } from '../interfaces'; import { NodeData } from '../../common/interfaces';
import { PenpotFile } from '../penpot'; import { PenpotFile } from '../penpot';
export const createPenpotGroup = ( export const createPenpotGroup = (

View file

@ -1,4 +1,4 @@
import { NodeData } from '../interfaces'; import { NodeData } from '../../common/interfaces';
import { PenpotFile } from '../penpot'; import { PenpotFile } from '../penpot';
export const createPenpotImage = ( export const createPenpotImage = (

View file

@ -7,7 +7,7 @@ import {
createPenpotRectangle, createPenpotRectangle,
createPenpotText createPenpotText
} from '.'; } from '.';
import { NodeData, TextData } from '../interfaces'; import { NodeData, TextData } from '../../common/interfaces';
import { PenpotFile } from '../penpot'; import { PenpotFile } from '../penpot';
import { calculateAdjustment } from '../utils'; import { calculateAdjustment } from '../utils';

View file

@ -1,5 +1,5 @@
import { createPenpotItem } from '.'; import { createPenpotItem } from '.';
import { NodeData } from '../interfaces'; import { NodeData } from '../../common/interfaces';
import { PenpotFile } from '../penpot'; import { PenpotFile } from '../penpot';
export const createPenpotPage = (file: PenpotFile, node: NodeData) => { export const createPenpotPage = (file: PenpotFile, node: NodeData) => {

View file

@ -1,4 +1,4 @@
import { NodeData } from '../interfaces'; import { NodeData } from '../../common/interfaces';
import { PenpotFile } from '../penpot'; import { PenpotFile } from '../penpot';
import { translateFills } from '../translators'; import { translateFills } from '../translators';

View file

@ -1,6 +1,6 @@
import slugify from 'slugify'; import slugify from 'slugify';
import { TextData } from '../interfaces'; import { TextData } from '../../common/interfaces';
import { PenpotFile } from '../penpot'; import { PenpotFile } from '../penpot';
import { import {
translateFills, translateFills,

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -1,4 +1,4 @@
import { TextData, TextDataChildren } from '../interfaces.js'; import { TextData, TextDataChildren } from '../../common/interfaces';
export const translateTextDecoration = (node: TextData | TextDataChildren) => { export const translateTextDecoration = (node: TextData | TextDataChildren) => {
const textDecoration = node.textDecoration; const textDecoration = node.textDecoration;

View file

@ -1,4 +1,4 @@
import { TextData, TextDataChildren } from '../interfaces.js'; import { TextData, TextDataChildren } from '../../common/interfaces';
export const translateTextTransform = (node: TextData | TextDataChildren) => { export const translateTextTransform = (node: TextData | TextDataChildren) => {
const textCase = node.textCase; const textCase = node.textCase;

View file

@ -1,4 +1,4 @@
import { NodeData } from '../interfaces.js'; import { NodeData } from '../../common/interfaces';
export const calculateAdjustment = (node: NodeData) => { export const calculateAdjustment = (node: NodeData) => {
// For each child, check whether the X or Y position is less than 0 and less than the // For each child, check whether the X or Y position is less than 0 and less than the

View file

@ -9,7 +9,7 @@
"module": "ESNext", "module": "ESNext",
"moduleResolution": "Node10", "moduleResolution": "Node10",
"strict": true, "strict": true,
"typeRoots": ["src/penpot.d.ts", "node_modules/@figma", "node_modules/@types"], "typeRoots": ["src/ui/penpot.d.ts", "node_modules/@figma", "node_modules/@types"],
"resolveJsonModule": true "resolveJsonModule": true
} }
} }

View file

@ -12,8 +12,8 @@ module.exports = (env, argv) => ({
devtool: argv.mode === 'production' ? false : 'inline-source-map', devtool: argv.mode === 'production' ? false : 'inline-source-map',
entry: { entry: {
ui: './src/ui.tsx', // The entry point for your UI code ui: './src/ui/ui.tsx', // The entry point for your UI code
code: './src/code.ts' // The entry point for your plugin code code: './src/plugin/code.ts' // The entry point for your plugin code
}, },
module: { module: {
@ -54,7 +54,7 @@ module.exports = (env, argv) => ({
}), }),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
inject: 'body', inject: 'body',
template: './src/ui.html', template: './src/ui/ui.html',
filename: 'ui.html', filename: 'ui.html',
chunks: ['ui'] chunks: ['ui']
}), }),