Skip to content

Commit

Permalink
Merge pull request #2687 from SUI-Components/fix/ci
Browse files Browse the repository at this point in the history
fix(Root): ci
  • Loading branch information
andresin87 authored Jan 25, 2024
2 parents 88dd473 + 53d7cec commit 625920f
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions scripts/build-themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ const fse = require('fs-extra')
const fs = require('fs/promises')
const globby = require('globby')

const INSTALL_FLAGS = [
'--silent',
'--no-save',
'--no-audit',
'--no-fund',
'--no-package-lock'
]
const INSTALL_FLAGS = ['--silent', '--no-save', '--no-audit', '--no-fund', '--no-package-lock']

const THEMES_PACKAGES = [
'@adv-ui/adv-theme',
Expand All @@ -26,7 +20,8 @@ const THEMES_PACKAGES = [
'@adv-ui/hb-theme-v2',
'@adv-ui/ij-theme',
'@adv-ui/ma-theme',
'@adv-ui/mt-theme'
'@adv-ui/mt-theme',
'@adv-ui/adit-boros-tcf-ui-consent'
]

const cwd = process.cwd()
Expand All @@ -48,9 +43,7 @@ const checkFileExists = path => fse.pathExists(path)
const getThemesList = async () => {
console.log('[sui-studio] Getting themes list...')
const files = await fs.readdir(path.join(__dirname, '..', 'themes'))
return files
.filter(file => !file.startsWith('_'))
.map(file => file.split('.')[0])
return files.filter(file => !file.startsWith('_')).map(file => file.split('.')[0])
}

const installThemesPkgs = () => {
Expand All @@ -66,10 +59,10 @@ const writeThemesInDemoFolders = async themes => {
cwd
})

const paths = await globby(
[path.join(cwd, 'components', '**', '**', 'demo'), '!**/node_modules/**'],
{onlyDirectories: true, cwd}
)
const paths = await globby([path.join(cwd, 'components', '**', '**', 'demo'), '!**/node_modules/**'], {
onlyDirectories: true,
cwd
})

paths
.filter(p => p.match(/\/components\/\w+\/\w+\/demo$/))
Expand All @@ -96,9 +89,7 @@ ${hasDemoStyles ? `@import '../index.scss';` : ''}

;(async () => {
if (CI && !NODE_AUTH_TOKEN) {
console.log(
'[sui-studio] Skipping themes installation as NODE_AUTH_TOKEN is not available'
)
console.log('[sui-studio] Skipping themes installation as NODE_AUTH_TOKEN is not available')
return
}

Expand Down

0 comments on commit 625920f

Please sign in to comment.