Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@
"devDependencies": {
"@qiwi/npm-run-all": "^4.1.7",
"eslint": "^8.44.0",
"eslint-config-prettier": "^10.0.0",
"eslint-config-prettier": "^10.1.5",
"eslint-config-qiwi": "^2.1.3",
"finalhandler": "^2.1.0",
"jest": "^29.7.0",
"jsdoc": "^4.0.4",
"prettier": "^3.5.3",
"prettier-config-qiwi": "^3.0.1",
"serve-static": "^2.0.0"
"serve-static": "^2.2.0"
},
"engines": {
"node": ">=14",
"npm": ">=6"
},
"dependencies": {
"@11ty/eleventy": "^3.0.0",
"@11ty/eleventy": "^3.1.0",
"ajv": "^8.17.1",
"csv-parse": "^5.6.0",
"fs-extra": "^11.3.0",
Expand All @@ -58,10 +58,9 @@
"js-yaml": "^4.1.0",
"lodash-es": "^4.17.21",
"meow": "^12.0.1",
"nanoid": "^5.0.0",
"nanoid": "^5.1.5",
"slash": "^5.1.0",
"temp-dir": "^3.0.0",
"terser": "^5.39.0"
"terser": "^5.39.1"
},
"keywords": [
"radar",
Expand Down
4 changes: 2 additions & 2 deletions src/main/js/constants.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path, { dirname } from 'node:path'
import path from 'node:path'
import { fileURLToPath } from 'node:url'

export const rootDir = dirname(fileURLToPath(import.meta.url))
export const rootDir = path.dirname(fileURLToPath(import.meta.url))
export const tplDir = path.resolve(rootDir, '../tpl')
12 changes: 7 additions & 5 deletions src/main/js/util.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import fse from 'fs-extra'
import { nanoid } from 'nanoid'
import path from 'node:path'
import tempRoot from 'temp-dir'
import os from 'node:os'
import fs from 'node:fs'

export const mkdirp = async (dir) =>
(await fse.mkdir(dir, { recursive: true })) && dir
export function mkdirp(dirpath) {
!fs.existsSync(dirpath) && fs.mkdirSync(dirpath, { recursive: true, mode: 0o777 })
return dirpath
}

export const getDirs = (files) =>
files.map((f) =>
Expand All @@ -16,6 +18,6 @@ export const getDirs = (files) =>
export const tempDir = async (base) =>
base
? mkdirp(path.join(await base, nanoid(5)))
: path.join(tempRoot, `tech-radar-${nanoid(5)}`)
: mkdirp(path.join(os.tmpdir(), 'tech-radar', nanoid(5)))

export const asArray = (v) => (Array.isArray(v) ? v : [v])
Loading
Loading