Skip to content

Commit

Permalink
2023 Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
bernaferrari committed Feb 22, 2023
1 parent 7d99e4f commit 5d1cc44
Show file tree
Hide file tree
Showing 99 changed files with 10,843 additions and 2,445 deletions.
44 changes: 21 additions & 23 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
module.exports = {
parser: "@typescript-eslint/parser",
env: {
"browser": true
},
plugins: [
"@typescript-eslint", "prettier", "jest"
const config = {
extends: ["kentcdodds", "kentcdodds/jest"],
rules: {
"valid-jsdoc": "off",
"max-len": "off",
"no-negated-condition": "off",
complexity: "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/no-unnecessary-condition": "off",
"space-before-function-paren": [
"error",
{
anonymous: "never",
named: "never",
asyncArrow: "always",
},
],
extends: [
"plugin:jest/recommended",
"eslint:recommended",
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"prettier", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
"ecmaVersion": 11,
"sourceType": "module"
},
rules: {
"prettier/prettier": "error",
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-inferrable-types": 0,
}
"import/no-import-module-exports": "off",
},
};

module.exports = config;
30 changes: 14 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
name: CI
on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: yarn
- name: Run tests and coverage
run: yarn run coverage
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage/clover.xml
- name: Run codecov
uses: codecov/codecov-action@v1


- uses: actions/checkout@v2
- name: Install modules
run: yarn
- name: Run tests and coverage
run: yarn run coverage
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage/clover.xml
- name: Run codecov
uses: codecov/codecov-action@v1
8 changes: 4 additions & 4 deletions __tests__/altNodes/altConversions.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { htmlMain } from "./../../src/html/htmlMain";
import { AltFrameNode } from "./../../src/altNodes/altMixins";
import { tailwindMain } from "../../src/tailwind/tailwindMain";
import { createFigma } from "figma-api-stub";
import { tailwindMain } from "../../src/tailwind/tailwindMain";
import { convertIntoAltNodes } from "../../src/altNodes/altConversion";
import { htmlMain } from "./../../src/html/htmlMain";
import { AltFrameNode } from "./../../src/altNodes/altMixins";

describe("AltConversions", () => {
const figma = createFigma({
simulateErrors: true,
isWithoutTimeout: false,
});
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = figma;
it("Rectangle", () => {
const rectangle = figma.createRectangle();
Expand Down
2 changes: 1 addition & 1 deletion __tests__/altNodes/convertGroupToFrame.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { convertGroupToFrame } from "../../src/altNodes/convertGroupToFrame";
import { convertNodesOnRectangle } from "../../src/altNodes/convertNodesOnRectangle";

describe("Convert Group to Frame", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
12 changes: 5 additions & 7 deletions __tests__/altNodes/convertNodesOnRectangle.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { AltSceneNode, AltTextNode } from "./../../src/altNodes/altMixins";
import { tailwindSize } from "../../src/tailwind/builderImpl/tailwindSize";
import { AltFrameNode } from "../../src/altNodes/altMixins";
import { AltFrameNode , AltGroupNode, AltRectangleNode , AltSceneNode, AltTextNode } from "../../src/altNodes/altMixins";
import { tailwindMain } from "../../src/tailwind/tailwindMain";
import { AltGroupNode, AltRectangleNode } from "../../src/altNodes/altMixins";
import { convertNodesOnRectangle } from "../../src/altNodes/convertNodesOnRectangle";

describe("convert node if child is big rect", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down Expand Up @@ -244,7 +242,7 @@ describe("convert node if child is big rect", () => {
const pre_conv = convertNodesOnRectangle(group);

// force Group removal. This is done automatically in AltConversion when executed in Figma.
const conv = pre_conv.children[0] as AltSceneNode;
const conv = pre_conv.children[0] ;
conv.parent = null;

// counterAxisSizingMode is AUTO, therefore bg-black doesn't contain the size
Expand Down Expand Up @@ -295,7 +293,7 @@ describe("convert node if child is big rect", () => {

const convert = convertNodesOnRectangle(node);

expect(convert.children.length).toEqual(1);
expect(convert.children).toHaveLength(1);
});

it("multiple rectangles on top of each other", () => {
Expand Down Expand Up @@ -367,7 +365,7 @@ describe("convert node if child is big rect", () => {
const convert = convertNodesOnRectangle(node);

// 4, because it should include even those that are not converted.
expect(convert.children.length).toEqual(4);
expect(convert.children).toHaveLength(4);
});

it("invalid when testing without id", () => {
Expand Down
5 changes: 2 additions & 3 deletions __tests__/altNodes/convertToAutoLayout.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { AltFrameNode } from "../../src/altNodes/altMixins";
import { AltFrameNode , AltRectangleNode } from "../../src/altNodes/altMixins";
import { tailwindMain } from "../../src/tailwind/tailwindMain";
import { AltRectangleNode } from "../../src/altNodes/altMixins";
import { convertToAutoLayout } from "../../src/altNodes/convertToAutoLayout";

describe("Convert to AutoLayout", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
2 changes: 1 addition & 1 deletion __tests__/flutter/builderImpl/flutterBorder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "../../../src/flutter/builderImpl/flutterBorder";

describe("Flutter Border", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
4 changes: 2 additions & 2 deletions __tests__/flutter/builderImpl/flutterColor.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { flutterMain } from "./../../../src/flutter/flutterMain";
import {
flutterColorFromFills,
flutterBoxDecorationColor,
} from "../../../src/flutter/builderImpl/flutterColor";
import { AltRectangleNode, AltTextNode } from "../../../src/altNodes/altMixins";
import { flutterMain } from "./../../../src/flutter/flutterMain";
describe("Flutter Color", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
3 changes: 1 addition & 2 deletions __tests__/flutter/builderImpl/flutterPadding.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AltRectangleNode } from "../../../src/altNodes/altMixins";
import { AltRectangleNode , AltFrameNode } from "../../../src/altNodes/altMixins";
import { flutterPadding } from "../../../src/flutter/builderImpl/flutterPadding";
import { AltFrameNode } from "../../../src/altNodes/altMixins";

describe("Flutter Padding", () => {
it("test padding", () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/flutter/builderImpl/flutterPosition.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AltFrameNode } from "../../../src/altNodes/altMixins";
import { flutterPosition } from "../../../src/flutter/builderImpl/flutterPosition";

describe("Flutter Position", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
2 changes: 1 addition & 1 deletion __tests__/flutter/builderImpl/flutterSize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from "../../../src/altNodes/altMixins";

describe("Flutter Size", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
3 changes: 1 addition & 2 deletions __tests__/flutter/flutterContainer.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { AltFrameNode, AltEllipseNode } from "./../../src/altNodes/altMixins";
import { AltRectangleNode } from "../../src/altNodes/altMixins";
import { AltRectangleNode , AltFrameNode, AltEllipseNode } from "../../src/altNodes/altMixins";
import { flutterContainer } from "../../src/flutter/flutterContainer";

describe("Flutter Container", () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/flutter/flutterMain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from "../../src/altNodes/altMixins";

describe("Flutter Main", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
5 changes: 2 additions & 3 deletions __tests__/flutter/flutterMaterial.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { AltFrameNode, AltEllipseNode } from "../../src/altNodes/altMixins";
import { AltRectangleNode } from "../../src/altNodes/altMixins";
import { AltFrameNode, AltEllipseNode , AltRectangleNode } from "../../src/altNodes/altMixins";
import { flutterMaterial } from "../../src/flutter/flutterMaterial";

describe("Flutter Material", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
4 changes: 2 additions & 2 deletions __tests__/flutter/flutterText.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { AltFrameNode, AltTextNode } from "../../src/altNodes/altMixins";
import { FlutterTextBuilder } from "./../../src/flutter/flutterTextBuilder";
import { flutterMain } from "./../../src/flutter/flutterMain";
import { AltFrameNode, AltTextNode } from "../../src/altNodes/altMixins";

describe("Flutter Text", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/builderImpl/htmlBlend.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { AltRectangleNode } from "../../../src/altNodes/altMixins";
import {
htmlOpacity,
htmlRotation,
htmlVisibility,
} from "./../../../src/html/builderImpl/htmlBlend";
import { AltRectangleNode } from "../../../src/altNodes/altMixins";

describe("HTML Blend", () => {
const node = new AltRectangleNode();
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/builderImpl/htmlBorder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from "../../../src/altNodes/altMixins";
import { htmlBorderRadius } from "../../../src/html/builderImpl/htmlBorderRadius";
describe("HTML Border", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
4 changes: 2 additions & 2 deletions __tests__/html/builderImpl/htmlColor.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { AltRectangleNode, AltTextNode } from "../../../src/altNodes/altMixins";
import { htmlMain } from "./../../../src/html/htmlMain";
import {
htmlColorFromFills,
htmlGradientFromFills,
} from "./../../../src/html/builderImpl/htmlColor";
import { AltRectangleNode, AltTextNode } from "../../../src/altNodes/altMixins";
describe("HTML Color", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
3 changes: 1 addition & 2 deletions __tests__/html/builderImpl/htmlPadding.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AltRectangleNode , AltFrameNode } from "../../../src/altNodes/altMixins";
import { htmlPadding } from "./../../../src/html/builderImpl/htmlPadding";
import { AltRectangleNode } from "../../../src/altNodes/altMixins";
import { AltFrameNode } from "../../../src/altNodes/altMixins";

describe("HTML padding", () => {
it("test html padding", () => {
Expand Down
4 changes: 2 additions & 2 deletions __tests__/html/builderImpl/htmlPosition.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { htmlPosition } from "./../../../src/html/builderImpl/htmlPosition";
import { AltFrameNode } from "../../../src/altNodes/altMixins";
import { htmlPosition } from "./../../../src/html/builderImpl/htmlPosition";

describe("HTML Position", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
4 changes: 2 additions & 2 deletions __tests__/html/builderImpl/htmlShadow.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { htmlShadow } from "./../../../src/html/builderImpl/htmlShadow";
import { AltRectangleNode } from "../../../src/altNodes/altMixins";
import { htmlShadow } from "./../../../src/html/builderImpl/htmlShadow";
describe("HTML Shadow", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/builderImpl/htmlSize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
import { htmlSize } from "../../../src/html/builderImpl/htmlSize";

describe("HTML Size", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
9 changes: 4 additions & 5 deletions __tests__/html/htmlMain.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { htmlMain } from "./../../src/html/htmlMain";
import { AltEllipseNode, AltTextNode } from "../../src/altNodes/altMixins";
import { convertToAutoLayout } from "../../src/altNodes/convertToAutoLayout";
import {
import { AltEllipseNode, AltTextNode ,
AltRectangleNode,
AltFrameNode,
AltGroupNode,
} from "../../src/altNodes/altMixins";
import { convertToAutoLayout } from "../../src/altNodes/convertToAutoLayout";
import { TailwindDefaultBuilder } from "../../src/tailwind/tailwindDefaultBuilder";
import { tailwindMain } from "../../src/tailwind/tailwindMain";
import { htmlMain } from "./../../src/html/htmlMain";

describe("HTML Main", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
4 changes: 2 additions & 2 deletions __tests__/html/htmlText.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { htmlMain } from "./../../src/html/htmlMain";
import { AltTextNode } from "../../src/altNodes/altMixins";
import { htmlMain } from "./../../src/html/htmlMain";

describe("HTML Text", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
5 changes: 2 additions & 3 deletions __tests__/retrieveUI/retrieveColors.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { AltTextNode } from "./../../src/altNodes/altMixins";
import {
retrieveGenericLinearGradients,
retrieveGenericSolidUIColors,
} from "../../src/common/retrieveUI/retrieveColors";
import { AltFrameNode, AltRectangleNode } from "../../src/altNodes/altMixins";
import { AltFrameNode, AltRectangleNode , AltTextNode } from "../../src/altNodes/altMixins";

describe("Retrieve Colors for UI", () => {
// @ts-ignore for some reason, need to override this for figma.mixed to work
// @ts-expect-error for some reason, need to override this for figma.mixed to work
global.figma = {
mixed: undefined,
};
Expand Down
10 changes: 4 additions & 6 deletions __tests__/swiftui/builderImpl/swiftuiBlend.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { swiftuiBlendMode } from "./../../../src/swiftui/builderImpl/swiftuiBlend";
import { swiftuiVisibility } from "../../../src/swiftui/builderImpl/swiftuiBlend";
import { AltRectangleNode } from "../../../src/altNodes/altMixins";

import {
import { swiftuiVisibility ,
swiftuiOpacity,
swiftuiRotation,
} from "../../../src/swiftui/builderImpl/swiftuiBlend";
, swiftuiBlendMode } from "../../../src/swiftui/builderImpl/swiftuiBlend";
import { AltRectangleNode } from "../../../src/altNodes/altMixins";


describe("SwiftUI Blend", () => {
const node = new AltRectangleNode();
Expand Down
Loading

0 comments on commit 5d1cc44

Please sign in to comment.