Skip to content

Commit

Permalink
Fix build process. GitHub Actions should now work.
Browse files Browse the repository at this point in the history
  • Loading branch information
bernaferrari committed Jun 27, 2020
1 parent 6c20e86 commit c5e5974
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 20 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ test/**/next-env.d.ts
**/.idea
**/.vscode

public
build
10 changes: 7 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
"modulePaths": [
"<rootDir>"
],
globals: {
'ts-jest': {
diagnostics: {
ignoreCodes: ["151001"]
}
}
}
};
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"watch": "rollup -c -w",
"release": "rollup -c --environment INCLUDE_DEPS,BUILD:production",
"postbuild": "purgecss -c purgecss.config.js -o public",
"wp": "npx webpack --mode=development --watch",
"wp": "webpack --mode=development --watch",
"test": "jest",
"coverage": "jest --coverage",
"start": "sirv public"
Expand All @@ -25,9 +25,6 @@
"tailwindcss": "^1.4.6"
},
"devDependencies": {
"@babel/core": "^7.10.3",
"@babel/preset-env": "^7.10.3",
"@babel/preset-typescript": "^7.10.1",
"@fullhuman/postcss-purgecss": "^2.3.0",
"@rollup/plugin-commonjs": "^11.0.2",
"@rollup/plugin-image": "^2.0.4",
Expand Down
4 changes: 0 additions & 4 deletions parent

This file was deleted.

3 changes: 3 additions & 0 deletions public/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Public Directory

This directory is empty for a reason: [Rollup](https://rollupjs.org/) needs it, else it fails. This is where the output will be.
2 changes: 1 addition & 1 deletion src/flutter/make_container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const makeContainer = (
const size = nodeWidthHeight(node, false);
let propWidth = size.width ? `width: ${size.width}, ` : "";
let propHeight = size.height ? `height: ${size.height}, ` : "";
const propWidthHeight: string = `SizedBox(${propWidth}${propHeight})`;
const propWidthHeight: string = `${propWidth}${propHeight}`;

if (node.fills !== figma.mixed && node.fills.length > 0) {
let fill = node.fills[0];
Expand Down
8 changes: 6 additions & 2 deletions src/flutter/make_material.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
AltFrameNode,
} from "../common/altMixins";
import { rgbaTohex, flutterColor } from "./flutter_helpers";
import { getContainerSizeProp } from "./make_container";
import { nodeWidthHeight } from "../common/nodeWidthHeight";

// https://api.flutter.dev/flutter/material/Material-class.html
export const makeMaterial = (
Expand Down Expand Up @@ -61,7 +61,11 @@ export const makeMaterial = (

const material = `\nMaterial(${color}${elevation}${shadowColor}${shape}${clipContent}${padChild}),`;

const propWidthHeight: string = getContainerSizeProp(node);
const size = nodeWidthHeight(node, false);
let propWidth = size.width ? `width: ${size.width}, ` : "";
let propHeight = size.height ? `height: ${size.height}, ` : "";
const propWidthHeight: string = `${propWidth}${propHeight}`;

if (propWidthHeight) {
return `SizedBox(${propWidthHeight}child: ${material}),`;
}
Expand Down
8 changes: 4 additions & 4 deletions src/tailwind/builderText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class tailwindTextNodeBuilder extends tailwindDefaultBuilder {
* example: font-extrabold
* example: italic
*/
fontStyle = (node: AltTextNode): this => {
fontStyle(node: AltTextNode): this {
if (node.fontName !== figma.mixed) {
const lowercaseStyle = node.fontName.style.toLowerCase();

Expand All @@ -118,13 +118,13 @@ export class tailwindTextNodeBuilder extends tailwindDefaultBuilder {
this.attributes += `font-${value} `;
}
return this;
};
}

/**
* https://tailwindcss.com/docs/letter-spacing/
* example: tracking-widest
*/
letterSpacing = (node: AltTextNode): this => {
letterSpacing(node: AltTextNode): this {
if (node.letterSpacing !== figma.mixed) {
if (
node.letterSpacing.unit === "PIXELS" &&
Expand All @@ -142,7 +142,7 @@ export class tailwindTextNodeBuilder extends tailwindDefaultBuilder {
}
}
return this;
};
}

/**
* https://tailwindcss.com/docs/line-height/
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"module": "es6",
"sourceMap": true,
"target": "es6",
"moduleResolution": "node",
"typeRoots": ["./node_modules/@types", "./node_modules/@figma"]
}
}

0 comments on commit c5e5974

Please sign in to comment.