Code Monkey home page Code Monkey logo

diez / diez Goto Github PK

View Code? Open in Web Editor NEW
1.2K 20.0 65.0 69.18 MB

The Design Token Framework — Adopt a unified design language across platforms, codebases, and teams

Home Page: https://diez.org

License: Other

Shell 0.08% TypeScript 73.44% Makefile 0.09% Go 0.19% JavaScript 3.20% HTML 1.77% Ruby 0.17% Kotlin 4.32% Swift 11.39% CSS 0.92% Vue 4.42%
design-tokens design-systems design-language cross-platform compiler ios-style android-style web-styles style

diez's Introduction

Diez · Build Status codecov

The Design Token Framework

Diez is an open-source developer toolkit for building & maintaining design tokens at scale.

Write & maintain styles in one place, then compile & consume them everywhere:  Diez supports any UI component library or codebase written in Swift, Objective-C, Kotlin, Java, TypeScript, JavaScript/JSON, CSS, or SCSS.

Diez reduces the cost of delivering a consistent visual identity across your company's apps & websites.

What's in the box?

Diez's toolkit comes in four parts:

  • Compiler — Diez includes a novel open-source compiler that converts (transpiles) TypeScript tokens into native packages for iOS, Android, and Web.

  • Framework — Diez's framework is a library of common design token patterns, including pre-written prefabs for Typography, Colors, Images, Drop Shadows, Dimensions, and more. Prefabs can be configured, nested, and reused to express any style, brand, or theme you can imagine.

    You can also write your own custom prefabs. Open-source contributions welcome!

  • Extractors — Diez's extractors automate the retrieval of design tokens from Figma, Sketch, Adobe XD, and InVision DSM. These command-line utilities are powerful tools for customizing your own design/developer hand-offs and are a great fit for CI servers.

  • Documentation Generator — Diez DocsGen builds customizable static HTML docs from any Diez project, complete with markdown-rendered code comments. Technically implemented as an additional compiler target, Diez DocsGen helps keep your styleguide and documentation perfectly up-to-date with your design token source of truth.

    See an example Diez project and its DocsGen output.

Getting Started & Installation

Generate a new Diez project with:

yarn create diez

or

npx diez create

Check out diez.org/getting-started for more thorough installation instructions and a robust set of guides.

Examples

Basic example

const tokens = {
  // Use for all primary type and monochromatic assets.
  foregroundColor: Color.hex('#AE0000'),
  // Use this sparingly, as it's very strong.
  foregroundAccent: Color.hex('#FF0000'),
  // This is our "canvas" color and default background.
  backgroundColor: Color.hex('#231020'),
}

The above TypeScript definition will compile to native packages on iOS and Android, where you can access your tokens like:

tokens.foregroundColor

From the above definition, Diez will also generate SCSS variables that can be used like:

#some-element {
  background-color: $tokens-background-color;
}

The inline comments and static values will also be built into the native SDKs, where developers can read the comments from autocomplete prompts.

Semantic tokens example

Diez robustly supports the "semantic tokens" pattern, of separating the value of design tokens from their semantic purpose, for example maintaining a separate set of "raw colors" vs. a semantic mapping of their intended use.

This example also shows one of Diez's several built-in helpers, [Color].lighten — these helpers make it easy to avoid duplicating "sources of truth" in your tokens.

//colors.ts
import {Color} from '@diez/prefabs';

export const rawColors = {
  tiger: Color.rgba(241, 93, 74, 1),
  marigold: Color.rgba(255, 172, 57, 1),
  clover: Color.rgba(163, 206, 50, 1),
  cyan: Color.rgba(4, 182, 203, 1),
};

export const semanticColors = {
  foreground: rawColors.tiger,
  foreground50: rawColors.tiger.lighten(.5),
  background: rawColors.clover,
  background50: rawColors.clover.lighten(.5),
}

Nesting & reuse example

This slightly more complex example shows how multiple prefabs (in this case Typograph, Color, and the primitive type number) naturally compose to express complex hierarchies of data — without needing to maintain multiple declarations of the same data.

This example also shows how tokens can be separated into multiple files and easily imported/reused.

//typography.ts
import {Typograph} from '@diez/prefabs';
import {sizes} from './sizes';
import {semanticColors} from './colors'; //from example above

export const typography = {
  heading1: new Typograph({
    color: semanticColors.foreground,
    font: fonts.PoppinsExtraBold.Regular,
    fontSize: sizes.xxl
  }),
  heading2: new Typograph({
    color: semanticColors.foreground50,
    font: fonts.PoppinsExtraBold.Regular,
    fontSize: sizes.xl
  }),
  body: new Typograph({
    color: semanticColors.foreground,
    font: shibuiFonts.Poppins.Regular,
    fontSize: sizes.sm
  }),
}
//sizes.ts
export const sizes = {
  xxl: 66,
  xl: 41,
  l: 35,
  md: 24,
  sm: 18,
  xs: 12,
}

Design file Extractor example

From this example Figma File:

Diez's Extractor generates design token code that looks like:

/**
 * GENERATED CODE
 * This file is generated by a Diez Extractor and is not intended to be edited by hand.
 * This file may be overwritten.
 *
 * FromFigma.ts
 *
 */
import { Color, DropShadow, File, Font, GradientStop, Image, LinearGradient, Point2D, Typograph } from "@diez/prefabs";

const fromFigmaColors = {
    teal50: Color.rgba(77, 197, 208, 1),
    teal40: Color.rgba(119, 221, 231, 1),
    // abbreviated for terseness
};

const fromFigmaGradients = {
    grad1: new LinearGradient({ stops: [GradientStop.make(0, Color.rgba(141, 245, 255, 1)), GradientStop.make(1, Color.rgba(183, 162, 255, 1))], start: Point2D.make(0.865941961194631, 0.131944384027248), end: Point2D.make(0.105072476657214, 0.937499990588448) })
};

const fromFigmaShadows = {
    shad20: new DropShadow({ offset: Point2D.make(0, 1), radius: 4, color: Color.rgba(0, 0, 0, 0.25) }),
    // abbreviated for terseness
};

export const fromFigmaFonts = {
    Poppins: {
        Bold: Font.fromFile("assets/FromFigma.figma.contents/fonts/Poppins-Bold.otf"),
        Regular: Font.fromFile("assets/FromFigma.figma.contents/fonts/Poppins-Regular.otf")
    }
};

const fromFigmaTypography = {
    heading1: new Typograph({ color: Color.rgba(0, 0, 0, 1), font: fromFigmaFonts.Poppins.Bold, fontSize: 18 }),
    body: new Typograph({ color: Color.rgba(0, 0, 0, 1), font: fromFigmaFonts.Poppins.Regular, fontSize: 12 })
};

export const fromFigmaImagesFiles = {
    iconFastFoodHotDog: new File({ src: "assets/FromFigma.figma.contents/images/IconFastFoodHotDog.png" }),
    iconFastFoodHotDog2x: new File({ src: "assets/FromFigma.figma.contents/images/[email protected]" }),
    iconFastFoodHotDog3x: new File({ src: "assets/FromFigma.figma.contents/images/[email protected]" }),
    iconFastFoodHotDog4x: new File({ src: "assets/FromFigma.figma.contents/images/[email protected]" }),
    // abbreviated for terseness
};

export const fromFigmaImages = {
    iconFastFoodHotDog: Image.responsive("assets/FromFigma.figma.contents/images/IconFastFoodHotDog.png", 24, 24),
    iconBinocular: Image.responsive("assets/FromFigma.figma.contents/images/IconBinocular.png", 24, 24),
    // abbreviated for terseness
};

export const fromFigmaTokens = {
    colors: fromFigmaColors,
    gradients: fromFigmaGradients,
    shadows: fromFigmaShadows,
    typography: fromFigmaTypography
};

Extracted tokens are intended to be imported and referenced by other files in your project — then updated through design tools, and extracted again. As another application of "semantic tokens," this separation of concerns allows you to treat design files as versionable code assets.

For example:

//colors.ts, pulling data right out of Figma
import {fromFigmaColors} from './designs/FromFigma';

const semanticColors = {
  foreground: fromFigmaColors.teal50,
  background: fromFigmaColors.purp60,
}

More Examples

See complete, compilable examples here, or at the Haiku Team's Diez-powered design language, Shibui.

When you run yarn create diez or npx diez create, you will also be given an option to generate a starter project that includes several functional examples.

FAQ

What are design tokens?

Think of design tokens as "design data": concepts like colors, typography definitions, spacings, sizings, and drop shadows — agnostic of any particular design tool or programming language. Design tokens are the basic building blocks that allow you to express any design language as pure data.

The magic of design tokens is they sit right at the gap between design and code — they're design concepts, but since they have no opinions about rendering or technologies, they're adaptable into any codebase with the right tooling (like Diez's cross-platform native compiler).

Design tokens are a community movement and the creators of Diez are actively contributing to the emerging W3C Design Tokens Community Group and specification.

What does the name Diez mean?

Diez is the Spanish number 10. This project is called Diez for two reasons:

  • In Spanish, Diez is pronounced roughly like saying the English letters "D S" — like design system.
  • El Diez is the magic jersey number in soccer/football, reserved for the star player on the team. We hope Diez is such a time-saver and collaboration-aid for your team that it earns its place as El Diez!

We came up with the "codename Diez" during a Haiku team summit in Patagonia. Then we decided to make the "codename" the "real name." And here we are.

Why TypeScript?

While design tokens are often expressed in JSON or YAML, TypeScript solves several problems faced when wrangling real-world design tokens:

  • Complexity: As codebases grow and change, YAML and JSON get complex and hard to reason about. With limited or no affordances for multiple files, references, or comments, YAML and JSON quickly snowball into complexity or "no one touch this or it will break everything!"

  • Modularity & reuse: Maintainers of design tokens often find a need to reuse certain chunks of tokens across files. A common example: a color palette may need to be referenced both in a typography definition and in a panel style — or in both a dark-mode and a light-mode theme. In these cases, YAML and JSON leave authors holding the bag — either contrive a module system for JSON, or copy, paste, and pray no one needs to update this again.

  • Expressions & permutations: Wouldn't it be nice to store your core color palette once, and to express variations — for example shades and tints, or theme variations — as a function of that core palette? TypeScript handles all of this out-of-the-box, and Diez offers helpers for variants like .lighten and .darken. See an example here

  • Hierarchy, branding, and theming: Real-world design systems often encompass multiple products, brands, and themes. In the ideal world, your team could maintain a core set of shared values, then extend and override them hierarchically for different layers of your "brand tree." Thanks to imports, exports, and native code reuse in TypeScript, this is completely doable. Our team is also hard at work on a first-class Theming solution within Diez, which makes this set of functionality quicker & easier to manage.

  • Stability & scale: TypeScript was designed for exactly this. Design tokens are especially fragile because of how they touch multiple codebases and platforms. Thanks to static typing, typedefs & comments that transpile all the way to iOS and Android, and developer-delighting features like autocomplete popovers — your team can evolve tokens reliably & confidently.

Find more FAQ at diez.org/faq

Who's behind Diez?

Diez is built by a growing community of contributors and is maintained by Haiku as part of our continuing mission: to unlock creativity in software by unifying design & code. 🖖

Read more about Diez at https://diez.org and about Haiku at https://www.haikuforteams.com

Join the community

Join Diez's Slack Community and Spectrum Community to stay in the loop, get support, or share ideas. Feel free also to file a GitHub Issue if you encounter any bugs or would like to share ideas or feature-requests.

diez's People

Contributors

dbuscaglia avatar duncancarroll avatar gumptious avatar n8chur avatar roperzh avatar stristr avatar three97 avatar zackbrown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

diez's Issues

Sanitize property names before generating SDK

Prevent property names with reserved/invalid words in target lang, for example it is possible to define:

class CornerRadii {
  default = 4;
}

which compiles to the following in the JS SDK:

class CornerRadii {
  constructor({
    default = 4
  } = {}) {
    this.default = default;
  }
}

and it's invalid ES6 because default is a keyword.

SVG support (for web targets)

For Figma & Sketch (and DSM) extract SVG when available, attach to Image prefabs, whitelist for web only, expose as .svg file

Re: consumption/declaration with Image prefab -- auto-magically discover presence of e.g. .png and .svg files from a string describing the file w/o extension

Bug on extracting Figma tokens

Hello,
I have an issue on extracting my figma tokens, I have the following message in the console:

Figma authentication required.
ReferenceError: URLSearchParams is not defined

I have set the url in the .diezrc file and that's all (like you did in the video)
Is there something I am missing? How do you setup the auth?

thanks in advance

Error: Rate limit exceeded

Running into this error when executing yarn diez extract of what appears to be a big Figma project.

I understand the error but I'm unable to understand how this affects me/what are my next steps. I couldn't find any mention about this in docs/google/issues.

  • Am I supposed to wait a bit, and retry after a while?
  • Will Diez resume? So the downloaded/processed entities won't be requested again, making it run into the same issue at the same step.

Issues building within a monorepo

I'm trying to use Diez in a yarn workspaces monorepo and have been running into issues. If I use the stock tsconfig.json the build fails with errors from my other packages:

error TS6059: File '/Users/cwd/src/project/server/src/auth.ts' is not under 'rootDir' '/Users/cwd/src/project/design/src'. 'rootDir' is expected to contain all source files.

I've tried adding a rootDir to the config, but then I get:

Unable to proceed: TypeScript configuration at does not compile from src/. Please fix the TypeScript configuration and try again.

Another thing I've tried is extending my base typescript config from the root of my project. When I do this I get the following:

Cannot read property 'options' of undefined

This is what the other projects in our monorepo do without issue, so I feel like this one is the closest, but still runs into issues.

if I remove the design folder from the monorepo and run build it completes without issue. This is currently what we have to do whenever we make changes, but this effectively means nobody wants to ever change the design system, the exact opposite of what we're trying to use Diez for!

I know usage within a monorepo might not yet be supported, but I'd love to get this working if at all possible!

npx diez extract: fails with spaces in file name, partially fails otherwise

Diez version: 10.3.1

Issue 1

While in the design-language directory, I tried running npx diez extract with a Sketch file named COMMON color system.sketch in the designs directory. This failed, telling me a few times:

Creating necessary folders for CommonColorSystem.sketch
Running sketchtool export commands for CommonColorSystem.sketch
Error: Command failed: /Applications/Sketch.app/Contents/Resources/sketchtool/bin/sketchtool dump /Users/a9f0bzz/source/_diez-test/aura-diez/design-language/designs/COMMON color system.sketch
The file doesn’t exist.

(NSCocoaErrorDomain:4)

I noticed that it was trying to work with a file named CommonColorSystem.sketch (my filename converted to Pascal case), so I removed the spaces and that particular error stopped.

Issue 2

While in the design-language directory, I tried running npx diez extract with a Sketch file named commoncolorsystem.sketch in the designs directory. This partially failed, telling me:

Creating necessary folders for Commoncolorsystem.sketch
Running sketchtool export commands for Commoncolorsystem.sketch
RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded

After this task finished (npx showed no indication aside from returning me to the command prompt after a delay, but yarn told me it was "✨ Done in 16.27s."):

  • Slice exports show up in assets/CommonColorSystem.sketch.contents/slices as expected.
  • There is no src/designs folder.

bug: RangeError during Sketch extract

Node v10.17.0

From package.json:

"dependencies": {
    "@diez/engine": "^10.2.3",
    "@diez/prefabs": "^10.2.3"
  },
  "devDependencies": {
    "@diez/compiler-core": "^10.2.3",
    "@diez/extractors": "^10.2.3",
    "@diez/start": "^10.2.3",
    "@diez/stdlib": "^10.2.3",
    "diez": "^10.3.0",
    "semver": "^6.0.0",
    "typescript": "^3.7.2"
  },

In .diezrc:

{
  "designs": {
     "services": ["https://projects.invisionapp.com/dsm-export/[me]/[client]/style-data.json?exportFormat=list&key=rk6ZPwbX8"]
  }               
}

Output:

$ '/Users/me/Sites Github/dies-tt/tt/design-language/node_modules/.bin/diez' extract
Error: Unable to find appropriate extractor for https://projects.invisionapp.com/dsm-export/[me]/[client]/style-data.json?exportFormat=list&key=rk6ZPwbX8.
✨  Done in 2.79s.

Allow setting `font-display: swap`

The easiest way to avoid showing invisible text while custom fonts load is to temporarily show a system font. By including font-display: swap in your @font-face style, you can avoid FOIT in most modern browsers.

SyntaxError: Octal escape sequences are not allowed in strict mode

Upon extracting a Figma project with components named as a number

https://www.figma.com/file/05DmUqhAmIA7GhRjgwqZa8/Diez-Issue-Report?node-id=0%3A1

image

the generated file contains what seem to be invalid paths, that throw an error on compile:

export const diezIssueReportComponentsFiles = {
    2: new File({ src: "assets\DiezIssueReport.figma.contents\components\2.png" }),
    '22x': new File({ src: "assets\DiezIssueReport.figma.contents\components\[email protected]" }),
    '23x': new File({ src: "assets\DiezIssueReport.figma.contents\components\[email protected]" }),
    '24x': new File({ src: "assets\DiezIssueReport.figma.contents\components\[email protected]" })
};

Compiling project...
SyntaxError: Octal escape sequences are not allowed in strict mode.
error Command failed with exit code 1.

Step to reproduce

  • Initialize diez as usual
  • Add the linked Figma project to diezrc
  • Extract
  • Link the generated diezIssueReportTokens to the entrypoint
  • Run yarn diez compile

OS: Windows 10 1909
Diez: 10.3.0
Yarn: 1.22.0
Node: 10.16.3

Error when running yarn demo

After creating a project and attempting to launch the demo app I get the following error:

$ yarn demo


ERROR in ./src/App.module.scss (./node_modules/css-loader/dist/cjs.js??ref--5-1!./node_modules/sass-loader/dist/cjs.js!./src/App.module.scss)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):

  background-image: $palette-header-background;
                   ^
      Undefined variable: "$palette-header-background".
      in /Users/damianesteban/src/messaround/bpt-design/example-codebases/web/src/App.module.scss (line 21, column 21)
 @ ./src/App.module.scss 2:14-133 21:1-42:3 22:19-138
 @ ./src/App.jsx
 @ ./src/index.jsx
ℹ 「wdm」: Failed to compile.

add actual values to design system types

Right now if I mouse over something from my design system I get something like the following:

layoutValues.someHeight: number

It would be nice, as this is a constant to instead get:

layoutValues.someHeight: 30

same for colors and any other value really.

Check and warn for conflicts when merging dependencies in target compilers

Target SDKs can declare dependencies at compilation time, for example: if a design language has a Lottie animation, the Web compiler adds a dependency to lottie-web to the SDK package.json.

Our current method to merge dependencies is a bit naive and returns when a dependency conflict is found, the next best step would be to add a warning here instead of silently skipping.

Places to check out:

yarn 2 support

Add support for yarn 2, there are a couple of areas in which friction can be anticipated:

  • yarn create diez & yarn demo
  • Hot reloading in example projects (due to webpack aliases)
  • Autodiscovery of diez plugins
  • ...

Scaffolding does not create necessary package.json

Diez version: 10.3.1

Following the steps for project setup on https://diez.org/getting-started/#set-up, anything I try to do thereafter (e.g. npm run demo, npx diez extract) fails because there is no package.json. This occurs when setting up the official template project via both yarn create diez and npx diez create. Am I missing an additional step, or is the scaffolding supposed to include a package.json and it is missing?

Wrap token names with quotes

When extracting from Figma (not sure if it happens with other tools too) the extracted tokens use the literal syntax for object property names, like:

const figmaDesignSystemTemplateSetproductComCopyTypography = {
    10SpOverline: new Typograph({ fontSize: 10, color: Color.rgba(0, 0, 0, 0.8700000047683716), font: new Font({ name: "Roboto-Medium" }) }),
}

This throws an error for names that have leading numbers, illegal for JS identifiers.

How viable is to make the extractor to wrap all property names with quotes?

const figmaDesignSystemTemplateSetproductComCopyTypography = {
    '10SpOverline': new Typograph({ fontSize: 10, color: Color.rgba(0, 0, 0, 0.8700000047683716), font: new Font({ name: "Roboto-Medium" }) }),
}

Steps to reproduce:

[Question] Is is possible to export different assets depending on the target ?

I see that exists that target module https://diez.org/docs/latest/modules/targets.html#onlytarget.

But, my question is regarding how, if possible, to use the targets on the DesignLanguage.ts.

For instance:

const layoutValues = { 
  spacingSmall: 5,
  spacingMedium: 25,
  spacingLarge: 40,
  contentMargin: new Margin({
    top: 40,
    left: 10,
    right: 10,
    bottom: 10
  })
};

I would like the android version to have more spacings, like

const layoutValues = { 
  spacingSmall: 5,
  spacingSmallAndroid: 5, // only visible for android target
  spacingMedium: 25,
  spacingLarge: 40,
  contentMargin: new Margin({
    top: 40,
    left: 10,
    right: 10,
    bottom: 10
  })
};

Is there a way of doing this? Should we use the @diez/target module?

Ability to declare fonts by url

Expose a loadFontFromUrl property on Font prefab — overrides the local font string (and/or allows it to be undefined) — note: this is web-whitelisted for now.

Combine this with bundling Google Fonts (e.g., and pending validation that this is legally OK) locally with Diez, which each use the loadFrontFromUrlproperty.

[Questions] - Json output? React Native?

Hi!
I've been testing Diez and so far, very impressed! <3
I have a question: is it possible to generate a JSON output for the tokens?
Like a stand alone JSON file with the tokens

I'm looking for token management options that handle react, react-native, ios and android.
Our existing web and react native components are using styled-components with a shared json theme.

Diez seem to be so close to generate this as the tokens are already written in objects, right?

I also would like to know if you are planning on having React Native support. With a json output most of the web tokens would work, I believe that only a few properties would need changing (shadows for ex)

Thank you!

EPERM: operation not permitted, scandir '[ ... ]\example-codebases\web\public\diez'

Following the "Getting Started" steps, when executing
yarn demo the title's error shows up:

PS C:\Users\user\Desktop\org\unocero\design-language> yarn demo
yarn run v1.22.0
$ diez start web
Building Diez project for target web...
$ C:\Users\user\Desktop\org\unocero\design-language\node_modules.bin\diez compile -t web
Validating project structure at C:\Users\user\Desktop\org\unocero\design-language...
Compiling project...
Diez package compiled to C:\Users\user\Desktop\org\unocero\design-language\build\diez-unocero-web.

You can depend on Diez in package.json:

{
  "dependencies": {
    "diez-unocero": "*"
  }
}

You can use the variables and classes defined by Diez in your CSS or Sass styles.
CSS: rule: var(--palette-content-background);
Sass: rule: $palette-content-background;

You can also use Diez with JavaScript to bootstrap any of the components defined in your project.

new Diez(DesignLanguage).attach((component) => {
  // ...
});

Starting the Diez hot server...
Validating project structure at C:\Users\user\Desktop\org\unocero\design-language...
Compiling project...
Serving hot on port 8080.
Built in 4439ms.

Your Diez project is now running in hot mode for web.

In hot mode, Diez observes and emits changes to your design language in real time.

To learn more, follow along with the guide at:

https://diez.org/getting-started/javascript.html

$ webpack-dev-server
Enabling hot mode with URL: http://172.28.67.32:8080
i 「wds」: Project is running at http://localhost:8081/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from C:\Users\user\Desktop\org\unocero\example-codebases\web
i 「wdm」: wait until bundle finished: /
‼ 「copy-webpack-plugin」: unable to locate 'public\diez' at 'C:\Users\user\Desktop\org\unocero\example-codebases\web\public\diez'
glob error { [Error: EPERM: operation not permitted, scandir 'C:\Users\user\Desktop\org\unocero\example-codebases\web\public\diez']
errno: -4048,
code: 'EPERM',
syscall: 'scandir',
path:
'C:\Users\user\Desktop\org\unocero\example-codebases\web\public\diez' }
× 「wdm」:
ERROR in EPERM: operation not permitted, scandir 'C:\Users\user\Desktop\org\unocero\example-codebases\web\public\diez'
i 「wdm」: Failed to compile.
i 「wdm」: Compiling...
‼ 「copy-webpack-plugin」: unable to locate 'public\diez' at 'C:\Users\user\Desktop\org\unocero\example-codebases\web\public\diez'
glob error { [Error: EPERM: operation not permitted, scandir 'C:\Users\user\Desktop\org\unocero\example-codebases\web\public\diez']
errno: -4048,
code: 'EPERM',
syscall: 'scandir',
path:
'C:\Users\user\Desktop\org\unocero\example-codebases\web\public\diez' }
× 「wdm」:
ERROR in EPERM: operation not permitted, scandir 'C:\Users\user\Desktop\org\unocero\example-codebases\web\public\diez'
i 「wdm」: Failed to compile.

The tab http://localhost:8081/ opens up and shows the demo page, but hot reloading doesn't seem to be working because of the error.

OS: Windows 10 1909
Diez: 10.2.3
Yarn: 1.22.0
Node: 10.16.3

Batch Figma file extraction

Users are hitting rate limits from large figma files.

Context: the Figma API requires of two calls to get images: one call to ask for the links to the images (hosted in s3) and another call per image to download the image.

What we do now: since the first call allows to ask for more than one link, we ask for links in batches and once we have the links we just download all the images in parallel.

Proposed solution: implement a stream mechanism that:

1- Does not wait to have all the image links to start downloading, thus does not make all the requests for links together.
2- Downloads images in batches of N numbers

'yarn demo' errors after scaffolding project

After scaffolding my Diez project by following the getting started instructions, I'm stuck on an error when running yarn demo.

'C:\VinnuStundIntelliJ\VVFrontEndModules\packages\apps\vv-design\design-language\node_modules\diez\bin\diez' is not recognized as an internal or external command,
operable program or batch file.
Command failed: C:\VinnuStundIntelliJ\VVFrontEndModules\packages\apps\vv-design\design-language\node_modules\diez\bin\diez compile -t web
error Command failed with exit code 1.

Screenshots from git bash:
image

Strangely, I was able to call the compile command straight from node_modules, but only if I had quotes around the path (since it was backwards slash).
image

Also worked by directly using node
image

image

I've tried different versions of node, with no luck.
I've also tried using cmd, but the same error occured.

Software Version
nodejs 12.13.0, 10.16.3
yarn 1.19.1
diez ^10.0.0-beta.6

OS: Windows 10
Terminal: Hyper with git bash, cmd

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.