Skip to content

Commit

Permalink
fix(docs): fix storybook build (#1166)
Browse files Browse the repository at this point in the history
* Fix SB build

* fix(docs): fix storybook build

* Fix linting issue
  • Loading branch information
YonatanKra committed Dec 23, 2021
1 parent 6a5e967 commit 7a8ae89
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .storybook/build-scripts/create-stories-from-md.mjs
Expand Up @@ -6,6 +6,7 @@ import { performance } from 'perf_hooks';
import glob from 'glob';
import showdown from 'showdown';
import showdownHtmlEscape from 'showdown-htmlescape';
import { removeDirSync } from "remove-dir-safe";

export default build;

Expand Down Expand Up @@ -132,7 +133,7 @@ function buildStoryJs(story, html) {
const
AUTOGENERATED_FOLDER_RELATIVE = 'assets/autogenerated',
AUTOGENERATED_FOLDER_ABSOLUTE = `.storybook/static/${AUTOGENERATED_FOLDER_RELATIVE}`;
fs.rmdirSync(AUTOGENERATED_FOLDER_ABSOLUTE, { recursive: true });
removeDirSync(AUTOGENERATED_FOLDER_ABSOLUTE, { recursive: true });
fs.mkdirSync(AUTOGENERATED_FOLDER_ABSOLUTE, { recursive: true });

/**
Expand Down
4 changes: 2 additions & 2 deletions common/design-tokens/src/builders/render-themes.js
Expand Up @@ -4,7 +4,7 @@ import StyleDictionaryPackage from 'style-dictionary';
import fs from 'fs';
import _ from 'lodash';
import R from 'ramda';
import {removeFolderSafely} from './utils.js';
import { removeDirSync } from 'remove-dir-safe';

const
propertiesPath = resolve('../../node_modules/@vonage/vvd-design-tokens-properties/dist'),
Expand Down Expand Up @@ -53,7 +53,7 @@ const alternateConfig = curriedGetStyleDictionaryConfig(R.__, 'alternate');
// TODO: [VIV-41] add accessible colors scheme
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const render = () => {
removeFolderSafely(OUTPUT_FOLDER);
removeDirSync(OUTPUT_FOLDER, { recursive: true });

['light', 'dark'].forEach(function (scheme) {
console.log(`\n🎨\x1b[2mProcessing: [\x1b[0m\x1b[36m${scheme}\x1b[0m\x1b[2m]\x1b[0m`);
Expand Down
Expand Up @@ -2,7 +2,7 @@ import fs from 'fs';
import { resolve } from 'path';
import _ from 'lodash';
import StyleDictionaryPackage from 'style-dictionary';
import {removeFolderSafely} from '../utils.js';
import {removeDirSync} from 'remove-dir-safe';

const TYPOGRAPHY_TYPES = ['web'],
CUSTOM_TYPOGRAPHY_FORMAT = 'custom/web/scss/typography',
Expand Down Expand Up @@ -47,7 +47,7 @@ function getStyleDictionaryConfig(type, defsFolder, dataFolder) {
export const render = () => {
console.log('\n📖\x1b[2mProcessing typography variables\x1b[0m');

removeFolderSafely(OUTPUT_FOLDER);
removeDirSync(OUTPUT_FOLDER, { recursive: true });
const propertiesFolder = resolve('../../node_modules/@vonage/vvd-design-tokens-properties');
const definitionsFolder = resolve(propertiesFolder, 'globals', 'typography');
const typographiesFolder = resolve(propertiesFolder, 'typography');
Expand Down
9 changes: 0 additions & 9 deletions common/design-tokens/src/builders/utils.js

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -124,6 +124,7 @@
"mocha": "^8.1.3",
"playwright": "^1.12.2",
"prism": "^4.1.2",
"remove-dir-safe": "^2.0.0",
"semver-compare": "^1.0.0",
"semver-diff": "^3.1.1",
"serve": "^11.3.2",
Expand Down Expand Up @@ -155,4 +156,4 @@
"disableUsageStatistics": true
},
"_void_cache": true
}
}
17 changes: 12 additions & 5 deletions yarn.lock
Expand Up @@ -11865,18 +11865,18 @@ is-path-in-cwd@^2.0.0:
dependencies:
is-path-inside "^2.1.0"

is-path-inside@3.0.3, is-path-inside@^3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283"
integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==

is-path-inside@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-2.1.0.tgz#7c9810587d659a40d27bcdb4d5616eab059494b2"
integrity sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==
dependencies:
path-is-inside "^1.0.2"

is-path-inside@^3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283"
integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==

is-plain-obj@^1.0.0, is-plain-obj@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e"
Expand Down Expand Up @@ -16440,6 +16440,13 @@ remark@^13.0.0:
remark-stringify "^9.0.0"
unified "^9.1.0"

remove-dir-safe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/remove-dir-safe/-/remove-dir-safe-2.0.0.tgz#6c8a435b670de8b85e3497281615746ce6915771"
integrity sha512-tzxFu1mfnzOXIaX1DHzkSSJvBA0EqkoLsDMUeWxIgGG07BuyJ9VnRHm28NsoQn9TtuHoDfnucai+Gn+NrjTPXw==
dependencies:
is-path-inside "3.0.3"

remove-trailing-separator@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef"
Expand Down

0 comments on commit 7a8ae89

Please sign in to comment.