Skip to content

Commit

Permalink
Merge pull request #593 from tokens-studio/fix-prettier
Browse files Browse the repository at this point in the history
fix prettier
  • Loading branch information
mck authored Dec 17, 2024
2 parents 79dc07b + fe1ae29 commit 3d901ed
Show file tree
Hide file tree
Showing 32 changed files with 1,648 additions and 1,605 deletions.
7 changes: 7 additions & 0 deletions .changeset/orange-panthers-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@tokens-studio/graph-editor": patch
"@tokens-studio/graph-engine-nodes-figma": patch
"@tokens-studio/graph-engine-ui": patch
---

fix prettier
2 changes: 1 addition & 1 deletion packages/graph-editor/src/data/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '4.3.4';
export const version = '4.3.6';
4 changes: 4 additions & 0 deletions packages/nodes-figma/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
docs
jest-coverage
node_modules
11 changes: 11 additions & 0 deletions packages/nodes-figma/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
dist/**
build/**
coverage/**
storybook-static/**
.docusaurus
docs
site
cypress
cli
.rollup
*.md
6 changes: 6 additions & 0 deletions packages/nodes-figma/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* eslint-disable no-undef */
/** @type {import("eslint").Linter.Config} */
module.exports = {
root:true,
extends: [require.resolve('@tokens-studio/eslint-config-custom')]
};
15 changes: 15 additions & 0 deletions packages/nodes-figma/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package.json
package-lock.json
dist
coverage
docs
jest-coverage
site
cli
.turbo
.rollup.cache
.rollup
build
storybook-static
.docusaurus
cypress
1 change: 1 addition & 0 deletions packages/nodes-figma/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@tokens-studio/prettier-config-custom"
2 changes: 1 addition & 1 deletion packages/nodes-figma/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "./nodes/index.js";
export * from './nodes/index.js';
134 changes: 67 additions & 67 deletions packages/nodes-figma/src/nodes/codeSyntax.ts
Original file line number Diff line number Diff line change
@@ -1,82 +1,82 @@
import {
INodeDefinition,
Node,
StringSchema,
ToInput,
ToOutput,
} from "@tokens-studio/graph-engine";
import { SingleToken } from "@tokens-studio/types";
import { TokenSchema } from "@tokens-studio/graph-engine-nodes-design-tokens/schemas/index.js";
import { mergeTokenExtensions } from "../utils/tokenMerge.js";
INodeDefinition,
Node,
StringSchema,
ToInput,
ToOutput
} from '@tokens-studio/graph-engine';
import { SingleToken } from '@tokens-studio/types';
import { TokenSchema } from '@tokens-studio/graph-engine-nodes-design-tokens/schemas/index.js';
import { mergeTokenExtensions } from '../utils/tokenMerge.js';

export default class NodeDefinition extends Node {
static title = "Code Syntax";
static type = "studio.tokens.figma.codeSyntax";
static description = "Defines code syntax for different platforms in Figma";
static title = 'Code Syntax';
static type = 'studio.tokens.figma.codeSyntax';
static description = 'Defines code syntax for different platforms in Figma';

declare inputs: ToInput<{
token: SingleToken;
web: string;
android: string;
ios: string;
}>;
declare outputs: ToOutput<{
token: SingleToken;
}>;
declare inputs: ToInput<{
token: SingleToken;
web: string;
android: string;
ios: string;
}>;
declare outputs: ToOutput<{
token: SingleToken;
}>;

constructor(props: INodeDefinition) {
super(props);
constructor(props: INodeDefinition) {
super(props);

this.addInput("token", {
type: {
...TokenSchema,
description: "The design token to add code syntax to",
},
});
this.addInput('token', {
type: {
...TokenSchema,
description: 'The design token to add code syntax to'
}
});

this.addInput("web", {
type: {
...StringSchema,
default: "",
description: "Web platform code syntax",
},
});
this.addInput('web', {
type: {
...StringSchema,
default: '',
description: 'Web platform code syntax'
}
});

this.addInput("android", {
type: {
...StringSchema,
default: "",
description: "Android platform code syntax",
},
});
this.addInput('android', {
type: {
...StringSchema,
default: '',
description: 'Android platform code syntax'
}
});

this.addInput("ios", {
type: {
...StringSchema,
default: "",
description: "iOS platform code syntax",
},
});
this.addInput('ios', {
type: {
...StringSchema,
default: '',
description: 'iOS platform code syntax'
}
});

this.addOutput("token", {
type: TokenSchema,
});
}
this.addOutput('token', {
type: TokenSchema
});
}

execute(): void | Promise<void> {
const inputs = this.getAllInputs();
execute(): void | Promise<void> {
const inputs = this.getAllInputs();

const codeSyntax = {
...(inputs.web && { Web: inputs.web }),
...(inputs.android && { Android: inputs.android }),
...(inputs.ios && { iOS: inputs.ios }),
};
const codeSyntax = {
...(inputs.web && { Web: inputs.web }),
...(inputs.android && { Android: inputs.android }),
...(inputs.ios && { iOS: inputs.ios })
};

const modifiedToken = mergeTokenExtensions(inputs.token, {
hiddenFromPublishing: false,
codeSyntax,
});
const modifiedToken = mergeTokenExtensions(inputs.token, {
hiddenFromPublishing: false,
codeSyntax
});

this.outputs.token.set(modifiedToken);
}
this.outputs.token.set(modifiedToken);
}
}
28 changes: 14 additions & 14 deletions packages/nodes-figma/src/nodes/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import codeSyntax from "./codeSyntax.js";
import publish from "./publish.js";
import scopeAll from "./scopeAll.js";
import scopeByType from "./scopeByType.js";
import scopeColor from "./scopeColor.js";
import scopeNumber from "./scopeNumber.js";
import scopeString from "./scopeString.js";
import codeSyntax from './codeSyntax.js';
import publish from './publish.js';
import scopeAll from './scopeAll.js';
import scopeByType from './scopeByType.js';
import scopeColor from './scopeColor.js';
import scopeNumber from './scopeNumber.js';
import scopeString from './scopeString.js';

export const nodes = [
codeSyntax,
publish,
scopeAll,
scopeByType,
scopeColor,
scopeNumber,
scopeString,
codeSyntax,
publish,
scopeAll,
scopeByType,
scopeColor,
scopeNumber,
scopeString
];
106 changes: 53 additions & 53 deletions packages/nodes-figma/src/nodes/publish.ts
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
import {
BooleanSchema,
INodeDefinition,
Node,
ToInput,
ToOutput,
} from "@tokens-studio/graph-engine";
import { SingleToken } from "@tokens-studio/types";
import { TokenSchema } from "@tokens-studio/graph-engine-nodes-design-tokens/schemas/index.js";
import { mergeTokenExtensions } from "../utils/tokenMerge.js";
BooleanSchema,
INodeDefinition,
Node,
ToInput,
ToOutput
} from '@tokens-studio/graph-engine';
import { SingleToken } from '@tokens-studio/types';
import { TokenSchema } from '@tokens-studio/graph-engine-nodes-design-tokens/schemas/index.js';
import { mergeTokenExtensions } from '../utils/tokenMerge.js';

export default class NodeDefinition extends Node {
static title = "Publish Variable";
static type = "studio.tokens.figma.publish";
static description = "Controls whether a variable is published to Users";

declare inputs: ToInput<{
token: SingleToken;
publish: boolean;
}>;
declare outputs: ToOutput<{
token: SingleToken;
}>;

constructor(props: INodeDefinition) {
super(props);

this.addInput("token", {
type: {
...TokenSchema,
description: "The design token to control publishing for",
},
});

this.addInput("publish", {
type: {
...BooleanSchema,
default: true,
description: "Whether to publish this token to Figma",
},
});

this.addOutput("token", {
type: TokenSchema,
});
}

execute(): void | Promise<void> {
const { token, publish } = this.getAllInputs();

const modifiedToken = mergeTokenExtensions(token, {
hiddenFromPublishing: !publish,
});

this.outputs.token.set(modifiedToken);
}
static title = 'Publish Variable';
static type = 'studio.tokens.figma.publish';
static description = 'Controls whether a variable is published to Users';

declare inputs: ToInput<{
token: SingleToken;
publish: boolean;
}>;
declare outputs: ToOutput<{
token: SingleToken;
}>;

constructor(props: INodeDefinition) {
super(props);

this.addInput('token', {
type: {
...TokenSchema,
description: 'The design token to control publishing for'
}
});

this.addInput('publish', {
type: {
...BooleanSchema,
default: true,
description: 'Whether to publish this token to Figma'
}
});

this.addOutput('token', {
type: TokenSchema
});
}

execute(): void | Promise<void> {
const { token, publish } = this.getAllInputs();

const modifiedToken = mergeTokenExtensions(token, {
hiddenFromPublishing: !publish
});

this.outputs.token.set(modifiedToken);
}
}
Loading

0 comments on commit 3d901ed

Please sign in to comment.