@magidoc/cli
Advanced tools
Comparing version 5.0.3 to 6.0.0
@@ -0,7 +1,7 @@ | ||
import path from 'path'; | ||
import { Option } from 'commander'; | ||
import runDevelopmentServer from './index.js'; | ||
import { newPortOption, PACKAGE_MANAGER_OPTION, CONFIG_FILE_OPTION, CLEAN_OPTION, STACKTRACE_OPTION } from '../utils/commander.js'; | ||
import { loadFileConfiguration } from '../utils/loadConfigFile.js'; | ||
import { withStacktrace } from '../utils/withStacktrace.js'; | ||
import runDevelopmentServer from './index.js'; | ||
import path from 'path'; | ||
import { newPortOption, PACKAGE_MANAGER_OPTION, CONFIG_FILE_OPTION, CLEAN_OPTION, STACKTRACE_OPTION } from '../utils/commander.js'; | ||
@@ -18,3 +18,3 @@ function buildDevCommand(program) { | ||
.addOption(STACKTRACE_OPTION()) | ||
.action(async ({ packageManager, host, port, file, stacktrace, clean, }) => { | ||
.action(async ({ packageManager, host, port, file, stacktrace, clean }) => { | ||
const fileConfiguration = await loadFileConfiguration(file, stacktrace); | ||
@@ -21,0 +21,0 @@ if (!fileConfiguration) { |
import { templates } from '@magidoc/plugin-starter-variables'; | ||
import { executeAllTasks } from '../../tasks/runner.js'; | ||
import { cleanTask } from '../../tasks/all/clean.js'; | ||
@@ -14,7 +13,8 @@ import { copyStaticAssetsTask } from '../../tasks/all/copyStaticAssets.js'; | ||
import { writeEnvFileTask } from '../../tasks/all/writeEnvFile.js'; | ||
import { executeAllTasks } from '../../tasks/runner.js'; | ||
import { loadFileConfiguration } from '../utils/loadConfigFile.js'; | ||
import { printSeparator, printInfo } from '../utils/log.js'; | ||
import { cyan } from '../utils/outputColors.js'; | ||
import { getPortAvailability } from '../utils/port.js'; | ||
import { watchFiles } from '../utils/watch.js'; | ||
import { printSeparator, printInfo } from '../utils/log.js'; | ||
import { getPortAvailability } from '../utils/port.js'; | ||
@@ -47,7 +47,3 @@ async function runDevelopmentServer(config) { | ||
}), | ||
watchFiles([ | ||
config.magidocConfigLocation, | ||
config.website.staticAssets, | ||
...config.dev.watch, | ||
], async () => { | ||
watchFiles([config.magidocConfigLocation, config.website.staticAssets, ...config.dev.watch], async () => { | ||
const newMagidocConfig = await loadFileConfiguration(config.magidocConfigLocation, config.stacktrace); | ||
@@ -58,7 +54,3 @@ const newDevConfig = { | ||
}; | ||
await executeAllTasks([ | ||
loadGraphQLSchemaTask(newDevConfig), | ||
copyStaticAssetsTask(newDevConfig), | ||
writeEnvFileTask(newDevConfig), | ||
], { | ||
await executeAllTasks([loadGraphQLSchemaTask(newDevConfig), copyStaticAssetsTask(newDevConfig), writeEnvFileTask(newDevConfig)], { | ||
ctx, | ||
@@ -65,0 +57,0 @@ silent: true, |
@@ -1,2 +0,2 @@ | ||
import { Command } from 'commander'; | ||
import { type Command } from 'commander'; | ||
export default function buildEjectCommand(program: Command): void; |
@@ -0,11 +1,11 @@ | ||
import path from 'path'; | ||
import { Option } from 'commander'; | ||
import eject from './index.js'; | ||
import { PACKAGE_MANAGER_TYPES } from '../../node/packageManager.js'; | ||
import { AVAILABLE_TEMPLATES } from '../../template/index.js'; | ||
import { getVersion } from '../../version.js'; | ||
import path from 'path'; | ||
import { withStacktrace } from '../utils/withStacktrace.js'; | ||
import { PACKAGE_MANAGER_TYPES } from '../../node/packageManager.js'; | ||
import { cyan } from '../utils/outputColors.js'; | ||
import { STACKTRACE_OPTION } from '../utils/commander.js'; | ||
import { printSeparator, printInfo, printLine } from '../utils/log.js'; | ||
import { cyan } from '../utils/outputColors.js'; | ||
@@ -25,3 +25,3 @@ function buildEjectCommand(program) { | ||
.addOption(STACKTRACE_OPTION()) | ||
.action(async ({ packageManager, template, templateVersion, destination, stacktrace, }) => { | ||
.action(async ({ packageManager, template, templateVersion, destination, stacktrace }) => { | ||
await withStacktrace(stacktrace, async () => { | ||
@@ -28,0 +28,0 @@ await eject({ |
@@ -1,9 +0,9 @@ | ||
import { executeAllTasks } from '../../tasks/runner.js'; | ||
import { determineTmpDirectoryTask } from '../../tasks/all/determineTmpDir.js'; | ||
import { fetchTemplateTask } from '../../tasks/all/fetchTemplate.js'; | ||
import { installDependenciesTask } from '../../tasks/all/installDependencies.js'; | ||
import { selectPackageManagerTask } from '../../tasks/all/selectPackageManager.js'; | ||
import { unzipTemplateTask } from '../../tasks/all/unzipTemplate.js'; | ||
import { verifyDestinationAvailableTask } from '../../tasks/all/verifyDestinationAvailable.js'; | ||
import { executeAllTasks } from '../../tasks/runner.js'; | ||
import { tmpLocation } from '../../template/tmp.js'; | ||
import { selectPackageManagerTask } from '../../tasks/all/selectPackageManager.js'; | ||
@@ -10,0 +10,0 @@ async function eject(config) { |
import generate from './index.js'; | ||
import { CONFIG_FILE_OPTION, PACKAGE_MANAGER_OPTION, CLEAN_OPTION, STACKTRACE_OPTION } from '../utils/commander.js'; | ||
import { loadFileConfiguration } from '../utils/loadConfigFile.js'; | ||
import { printSeparator, printInfo, printLine } from '../utils/log.js'; | ||
import { cyan } from '../utils/outputColors.js'; | ||
import { withStacktrace } from '../utils/withStacktrace.js'; | ||
import { cyan } from '../utils/outputColors.js'; | ||
import { CONFIG_FILE_OPTION, PACKAGE_MANAGER_OPTION, CLEAN_OPTION, STACKTRACE_OPTION } from '../utils/commander.js'; | ||
import { printSeparator, printInfo, printLine } from '../utils/log.js'; | ||
@@ -17,3 +17,3 @@ const DEFAULT_CONFIG_FILE = './magidoc.mjs'; | ||
.addOption(STACKTRACE_OPTION()) | ||
.action(async ({ packageManager, file, stacktrace, clean, }) => { | ||
.action(async ({ packageManager, file, stacktrace, clean }) => { | ||
const fileConfiguration = await loadFileConfiguration(file, stacktrace); | ||
@@ -20,0 +20,0 @@ if (!fileConfiguration) { |
@@ -1,2 +0,1 @@ | ||
import { executeAllTasks } from '../../tasks/runner.js'; | ||
import { buildTemplateTask } from '../../tasks/all/buildTemplate.js'; | ||
@@ -15,2 +14,3 @@ import { cleanTask } from '../../tasks/all/clean.js'; | ||
import { writeEnvFileTask } from '../../tasks/all/writeEnvFile.js'; | ||
import { executeAllTasks } from '../../tasks/runner.js'; | ||
@@ -17,0 +17,0 @@ async function generate(config) { |
@@ -1,7 +0,7 @@ | ||
import { withStacktrace } from '../utils/withStacktrace.js'; | ||
import path from 'path'; | ||
import { templates } from '@magidoc/plugin-starter-variables'; | ||
import preview from './index.js'; | ||
import { CONFIG_FILE_OPTION, newPortOption, STACKTRACE_OPTION } from '../utils/commander.js'; | ||
import { loadFileConfiguration } from '../utils/loadConfigFile.js'; | ||
import { templates } from '@magidoc/plugin-starter-variables'; | ||
import { CONFIG_FILE_OPTION, newPortOption, STACKTRACE_OPTION } from '../utils/commander.js'; | ||
import { withStacktrace } from '../utils/withStacktrace.js'; | ||
@@ -8,0 +8,0 @@ function buildPreviewCommand(program) { |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
import http from 'http'; | ||
@@ -3,0 +2,0 @@ export type PreviewConfig = { |
@@ -14,2 +14,6 @@ import http from 'http'; | ||
const server = http.createServer((req, res) => { | ||
res.setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, proxy-revalidate'); | ||
res.setHeader('Pragma', 'no-cache'); | ||
res.setHeader('Expires', '0'); | ||
res.setHeader('Surrogate-Control', 'no-store'); | ||
if (!config.siteRoot || req.url?.startsWith(config.siteRoot)) { | ||
@@ -16,0 +20,0 @@ req.url = req.url?.replace(config.siteRoot || '', ''); |
@@ -25,5 +25,5 @@ import { Option, InvalidArgumentError } from 'commander'; | ||
return new Option(flags, description).argParser((value) => { | ||
const parsed = parseInt(value, 10); | ||
if (isNaN(parsed)) { | ||
throw new InvalidArgumentError(`It is not a number`); | ||
const parsed = Number.parseInt(value, 10); | ||
if (Number.isNaN(parsed)) { | ||
throw new InvalidArgumentError('It is not a number'); | ||
} | ||
@@ -30,0 +30,0 @@ if (params?.min && parsed < params.min) { |
@@ -0,3 +1,3 @@ | ||
import path from 'path'; | ||
import { readConfiguration } from '../../config/reader.js'; | ||
import path from 'path'; | ||
import { printError, printStacktrace } from './log.js'; | ||
@@ -4,0 +4,0 @@ |
@@ -1,2 +0,1 @@ | ||
/* eslint-disable no-console */ | ||
function printLine() { | ||
@@ -3,0 +2,0 @@ console.log(); |
@@ -1,2 +0,1 @@ | ||
import { ZMagidocConfiguration } from './types.js'; | ||
import { templates } from '@magidoc/plugin-starter-variables'; | ||
@@ -6,2 +5,3 @@ import _ from 'lodash'; | ||
import { red } from '../commands/utils/outputColors.js'; | ||
import { ZMagidocConfiguration } from './types.js'; | ||
import { formatZodIssues } from './zod.js'; | ||
@@ -31,3 +31,2 @@ | ||
} | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
@@ -34,0 +33,0 @@ const zodType = variable.zod.type(z); |
@@ -18,3 +18,3 @@ import { existsSync } from 'fs'; | ||
// This is a hack to force NodeJS to ignore the cache | ||
const realPath = pathToFileURL(configPath).toString() + `?query=${timesLoaded}`; | ||
const realPath = `${pathToFileURL(configPath).toString()}?query=${timesLoaded}`; | ||
const config = (await import(realPath)).default; | ||
@@ -21,0 +21,0 @@ if (!config) { |
@@ -0,6 +1,6 @@ | ||
import path from 'path'; | ||
import z from 'zod'; | ||
import { isDirectory } from '../commands/utils/fileUtils.js'; | ||
import { AVAILABLE_TEMPLATES } from '../template/index.js'; | ||
import { getVersion } from '../version.js'; | ||
import path from 'path'; | ||
import { isDirectory } from '../commands/utils/fileUtils.js'; | ||
@@ -7,0 +7,0 @@ const ZPath = z |
@@ -9,3 +9,3 @@ import { cyan } from '../commands/utils/outputColors.js'; | ||
return ` ‣ Expected: '${issue.expected}' but received '${issue.received}' at path '${path}'`; | ||
case 'invalid_union': | ||
case 'invalid_union': { | ||
const formattedErrors = issue.unionErrors | ||
@@ -15,2 +15,3 @@ .flatMap((current) => current.issues.map((issue) => ` - ${issue.message}`)) | ||
return ` ‣ ${issue.message} at path '${path}':\n${formattedErrors}`; | ||
} | ||
default: | ||
@@ -24,3 +25,3 @@ return ` ‣ ${issue.message} at path '${path}'`; | ||
if (typeof current === 'number') | ||
return previous + `[${current}]`; | ||
return `${previous}[${current}]`; | ||
if (previous === '') | ||
@@ -27,0 +28,0 @@ return String(current); |
#! /usr/bin/env node | ||
import { Command } from 'commander'; | ||
import buildDevCommand from './commands/dev/command.js'; | ||
import buildEjectCommand from './commands/eject/command.js'; | ||
import buildGenerateCommand from './commands/generate/command.js'; | ||
import buildEjectCommand from './commands/eject/command.js'; | ||
import buildPreviewCommand from './commands/preview/command.js'; | ||
export { loadMarkdownPagesTree } from './utils/pages.js'; | ||
import { getVersion } from './version.js'; | ||
import buildDevCommand from './commands/dev/command.js'; | ||
export { loadMarkdownPagesTree } from './utils/pages.js'; | ||
@@ -10,0 +10,0 @@ const version = getVersion(); |
@@ -87,5 +87,3 @@ import { exec, spawn } from 'child_process'; | ||
const lowerKey = key.toLowerCase(); | ||
if (lowerKey.startsWith('vercel') || | ||
lowerKey.startsWith('netlify') || | ||
lowerKey.startsWith('cf_pages')) { | ||
if (lowerKey.startsWith('vercel') || lowerKey.startsWith('netlify') || lowerKey.startsWith('cf_pages')) { | ||
return previous; | ||
@@ -92,0 +90,0 @@ } |
@@ -1,4 +0,4 @@ | ||
import type { Task } from '../runner'; | ||
import type { PackageManager } from '../../node/packageManager'; | ||
import type { TmpLocation } from '../../template/tmp'; | ||
import type { Task } from '../runner'; | ||
type Ctx = { | ||
@@ -5,0 +5,0 @@ tmpDirectory: TmpLocation; |
function buildTemplateTask() { | ||
return { | ||
title: `Build template`, | ||
title: 'Build template', | ||
executor: async (ctx) => { | ||
@@ -5,0 +5,0 @@ await ctx.packageManager.buildProject({ |
@@ -1,4 +0,4 @@ | ||
import type { Task } from '../runner'; | ||
import type { WebsiteConfiguration } from '../../config/types'; | ||
import type { TmpLocation } from '../../template/tmp'; | ||
import type { Task } from '../runner'; | ||
type Config = { | ||
@@ -5,0 +5,0 @@ clean: boolean; |
@@ -0,3 +1,3 @@ | ||
import type { WebsiteConfiguration } from '../../config/types'; | ||
import type { Task } from '../runner'; | ||
import type { WebsiteConfiguration } from '../../config/types'; | ||
import type { ResolvedMagidocTemplateConfig } from './resolveTemplateConfig'; | ||
@@ -4,0 +4,0 @@ type Config = { |
@@ -5,3 +5,3 @@ import { copyStaticAssets } from '../../template/assets.js'; | ||
return { | ||
title: `Copy static assets`, | ||
title: 'Copy static assets', | ||
enabled: !!config.website.staticAssets, | ||
@@ -8,0 +8,0 @@ executor: async (ctx) => { |
@@ -0,4 +1,4 @@ | ||
import type { WebsiteConfiguration } from '../../config/types'; | ||
import { type TmpLocation } from '../../template/tmp'; | ||
import type { Task } from '../runner'; | ||
import { type TmpLocation } from '../../template/tmp'; | ||
import type { WebsiteConfiguration } from '../../config/types'; | ||
type Config = { | ||
@@ -5,0 +5,0 @@ tmpArchive?: TmpLocation; |
@@ -10,6 +10,4 @@ import { isTemplate } from '../../template/index.js'; | ||
const templateLocationName = `${config.website.template}@${config.website.templateVersion}`; | ||
ctx.tmpArchive = | ||
config.tmpArchive ?? tmpTemplateArchiveFile(templateLocationName); | ||
ctx.tmpDirectory = | ||
config.tmpDirectory ?? tmpTemplateDirectory(templateLocationName); | ||
ctx.tmpArchive = config.tmpArchive ?? tmpTemplateArchiveFile(templateLocationName); | ||
ctx.tmpDirectory = config.tmpDirectory ?? tmpTemplateDirectory(templateLocationName); | ||
} | ||
@@ -16,0 +14,0 @@ else { |
@@ -0,4 +1,4 @@ | ||
import type { WebsiteConfiguration } from '../../config/types'; | ||
import type { TmpLocation } from '../../template/tmp'; | ||
import type { Task } from '../runner'; | ||
import type { TmpLocation } from '../../template/tmp'; | ||
import type { WebsiteConfiguration } from '../../config/types'; | ||
type Config = { | ||
@@ -5,0 +5,0 @@ website: Pick<WebsiteConfiguration, 'template' | 'templateVersion'>; |
@@ -1,4 +0,4 @@ | ||
import type { Task } from '../runner'; | ||
import type { PackageManager } from '../../node/packageManager'; | ||
import type { TmpLocation } from '../../template/tmp'; | ||
import type { Task } from '../runner'; | ||
type Ctx = { | ||
@@ -5,0 +5,0 @@ tmpDirectory: TmpLocation; |
function installDependenciesTask() { | ||
return { | ||
title: `Install dependencies`, | ||
title: 'Install dependencies', | ||
executor: async (ctx) => { | ||
@@ -5,0 +5,0 @@ await ctx.packageManager.runInstall({ |
@@ -0,3 +1,3 @@ | ||
import type { IntrospectionConfiguration } from '../../config/types'; | ||
import type { Task } from '../runner'; | ||
import type { IntrospectionConfiguration } from '../../config/types'; | ||
import type { ResolvedMagidocTemplateConfig } from './resolveTemplateConfig'; | ||
@@ -4,0 +4,0 @@ type Config = { |
@@ -6,3 +6,3 @@ import { parseSchema, fetchSchema } from '@magidoc/rollup-plugin-gql-schema'; | ||
return { | ||
title: `Load GraphQL Schema`, | ||
title: 'Load GraphQL Schema', | ||
executor: async (ctx) => { | ||
@@ -9,0 +9,0 @@ switch (config.introspection.type) { |
@@ -1,4 +0,4 @@ | ||
import type { Task } from '../runner'; | ||
import type { WebsiteConfiguration } from '../../config/types'; | ||
import type { TmpLocation } from '../../template/tmp'; | ||
import type { Task } from '../runner'; | ||
type Ctx = { | ||
@@ -5,0 +5,0 @@ tmpDirectory: TmpLocation; |
@@ -6,3 +6,3 @@ import path from 'path'; | ||
return { | ||
title: `Move output`, | ||
title: 'Move output', | ||
executor: async (ctx, task) => { | ||
@@ -9,0 +9,0 @@ await moveOutputBuild(path.join(ctx.tmpDirectory.path, 'build'), config.website.output); |
import type { Variable } from '@magidoc/plugin-starter-variables'; | ||
import type { TmpLocation } from '../../template/tmp'; | ||
import type { Task } from '../runner'; | ||
import type { TmpLocation } from '../../template/tmp'; | ||
type Ctx = { | ||
@@ -5,0 +5,0 @@ tmpDirectory: TmpLocation; |
@@ -9,3 +9,3 @@ import path from 'path'; | ||
return { | ||
title: `Resolving template configuration`, | ||
title: 'Resolving template configuration', | ||
executor: async (ctx, task) => { | ||
@@ -12,0 +12,0 @@ const configPath = templateConfigurationFile(ctx.tmpDirectory.path); |
@@ -0,3 +1,3 @@ | ||
import { type PackageManager, type PackageManagerType } from '../../node/packageManager'; | ||
import type { Task } from '../runner'; | ||
import { type PackageManager, type PackageManagerType } from '../../node/packageManager'; | ||
type Ctx = { | ||
@@ -4,0 +4,0 @@ packageManager: PackageManager; |
@@ -0,3 +1,3 @@ | ||
import { yellow } from '../../commands/utils/outputColors.js'; | ||
import { getPackageManager, selectPackageManager } from '../../node/packageManager.js'; | ||
import { yellow } from '../../commands/utils/outputColors.js'; | ||
@@ -4,0 +4,0 @@ function selectPackageManagerTask(config) { |
@@ -0,4 +1,4 @@ | ||
import type { WebsiteConfiguration } from '../../config/types'; | ||
import type { TmpLocation } from '../../template/tmp'; | ||
import type { Task } from '../runner'; | ||
import type { TmpLocation } from '../../template/tmp'; | ||
import type { WebsiteConfiguration } from '../../config/types'; | ||
type Config = { | ||
@@ -5,0 +5,0 @@ website: Pick<WebsiteConfiguration, 'template'>; |
@@ -6,3 +6,3 @@ import { isTemplate } from '../../template/index.js'; | ||
return { | ||
title: `Unzip template`, | ||
title: 'Unzip template', | ||
enabled: isTemplate(config.website.template), | ||
@@ -9,0 +9,0 @@ executor: async (ctx, task) => { |
@@ -5,3 +5,3 @@ import { existsSync } from 'fs'; | ||
return { | ||
title: `Verifying destination directory`, | ||
title: 'Verifying destination directory', | ||
executor: () => { | ||
@@ -8,0 +8,0 @@ if (existsSync(config.destination)) { |
@@ -0,10 +1,9 @@ | ||
import { yellow } from '../../commands/utils/outputColors.js'; | ||
import { isTemplate } from '../../template/index.js'; | ||
import { getVersion } from '../../version.js'; | ||
import { isTemplate } from '../../template/index.js'; | ||
import { yellow } from '../../commands/utils/outputColors.js'; | ||
function warnVersionTask(config) { | ||
return { | ||
title: `Template version warning`, | ||
enabled: isTemplate(config.website.template) && | ||
config.website.templateVersion !== getVersion(), | ||
title: 'Template version warning', | ||
enabled: isTemplate(config.website.template) && config.website.templateVersion !== getVersion(), | ||
executor: (_, task) => { | ||
@@ -11,0 +10,0 @@ task.output(yellow('⚠️ Template version has been set to a different version that the current CLI version.\n⚠️ This may result in unexpected results.')); |
@@ -0,3 +1,3 @@ | ||
import type { WebsiteConfiguration } from '../../config/types'; | ||
import type { Task } from '../runner'; | ||
import type { WebsiteConfiguration } from '../../config/types'; | ||
import type { ResolvedMagidocTemplateConfig } from './resolveTemplateConfig'; | ||
@@ -4,0 +4,0 @@ type Config = { |
@@ -6,3 +6,3 @@ import { toVariablesFile } from '@magidoc/plugin-starter-variables'; | ||
return { | ||
title: `Write variables file`, | ||
title: 'Write variables file', | ||
executor: async (ctx) => { | ||
@@ -9,0 +9,0 @@ await writeFile(ctx.templateConfiguration.envFileLocation, toVariablesFile(config.website.options, ctx.templateConfiguration.supportedOptions)); |
@@ -14,3 +14,5 @@ import { Listr, PRESET_TIMER } from 'listr2'; | ||
task: (ctx, wrapper) => task.executor(ctx, { | ||
output: (message) => (wrapper.output = message), | ||
output: (message) => { | ||
wrapper.output = message; | ||
}, | ||
skip: (message) => wrapper.skip(message), | ||
@@ -17,0 +19,0 @@ }), |
@@ -0,9 +1,7 @@ | ||
import axios from 'axios'; | ||
import fs from 'fs-extra'; | ||
import axios from 'axios'; | ||
const templateUrl = 'https://github.com/magidoc-org/magidoc/releases/download/<version>/starter-<name>.zip'; | ||
async function fetchTemplate(config) { | ||
const targetUrl = templateUrl | ||
.replace('<version>', config.version) | ||
.replace('<name>', config.template); | ||
const targetUrl = templateUrl.replace('<version>', config.version).replace('<name>', config.template); | ||
await axios | ||
@@ -18,11 +16,8 @@ .request({ | ||
return new Promise((resolve, reject) => { | ||
writer.on('error', (error) => { | ||
error = error; | ||
writer.on('error', (err) => { | ||
writer.close(); | ||
reject(error); | ||
reject(err); | ||
}); | ||
writer.on('close', () => { | ||
{ | ||
resolve(true); | ||
} | ||
resolve(true); | ||
}); | ||
@@ -29,0 +24,0 @@ response.data.pipe(writer); |
@@ -1,8 +0,8 @@ | ||
import fs from 'fs-extra'; | ||
import os from 'os'; | ||
import path from 'path'; | ||
import fs from 'fs-extra'; | ||
const tmpDir = os.tmpdir(); | ||
function tmpTemplateArchiveFile(name) { | ||
const actualName = name.endsWith('.zip') ? name : name + '.zip'; | ||
const actualName = name.endsWith('.zip') ? name : `${name}.zip`; | ||
return tmpLocation(asTmpPath(actualName)); | ||
@@ -9,0 +9,0 @@ } |
import fs from 'fs'; | ||
import path from 'path'; | ||
import _ from 'lodash'; | ||
import path from 'path'; | ||
@@ -47,4 +47,4 @@ /** | ||
const parts = item.name.split('.'); | ||
const number = parseInt(parts[0], 10); | ||
if (isNaN(number)) { | ||
const number = Number.parseInt(parts[0], 10); | ||
if (Number.isNaN(number)) { | ||
throw new Error(`Invalid file name: ${item.name}. File and directory names must start with a number.`); | ||
@@ -51,0 +51,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"private": false, | ||
"version": "5.0.3", | ||
"version": "6.0.0", | ||
"type": "module", | ||
@@ -26,29 +26,29 @@ "license": "MIT", | ||
"dependencies": { | ||
"axios": "^1.6.8", | ||
"chokidar": "^3.6.0", | ||
"commander": "^12.0.0", | ||
"extract-zip": "^2.0.1", | ||
"fs-extra": "^11.2.0", | ||
"listr2": "^8.2.1", | ||
"lodash": "^4.17.21", | ||
"sirv": "^2.0.4", | ||
"zod": "^3.23.6", | ||
"@magidoc/plugin-starter-variables": "^5.0.3", | ||
"@magidoc/rollup-plugin-gql-schema": "^5.0.3" | ||
"axios": "1.7.2", | ||
"chokidar": "3.6.0", | ||
"commander": "12.1.0", | ||
"extract-zip": "2.0.1", | ||
"fs-extra": "11.2.0", | ||
"listr2": "8.2.3", | ||
"lodash": "4.17.21", | ||
"sirv": "2.0.4", | ||
"zod": "3.23.8", | ||
"@magidoc/rollup-plugin-gql-schema": "^6.0.0", | ||
"@magidoc/plugin-starter-variables": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-typescript": "^11.1.6", | ||
"@types/fs-extra": "^11.0.4", | ||
"@types/lodash": "^4.17.0", | ||
"@types/node": "^20.12.8", | ||
"@vitest/coverage-v8": "^1.6.0", | ||
"rollup": "^4.17.2", | ||
"rollup-plugin-preserve-shebang": "^1.0.1", | ||
"tslib": "^2.6.2", | ||
"typescript": "^5.4.5", | ||
"vite": "^5.2.11", | ||
"vitest": "^1.6.0" | ||
"@rollup/plugin-typescript": "11.1.6", | ||
"@types/fs-extra": "11.0.4", | ||
"@types/lodash": "4.17.5", | ||
"@types/node": "20.14.8", | ||
"@vitest/coverage-v8": "1.6.0", | ||
"rollup": "4.18.0", | ||
"rollup-plugin-preserve-shebang": "1.0.1", | ||
"tslib": "2.6.3", | ||
"typescript": "5.5.2", | ||
"vite": "5.3.1", | ||
"vitest": "1.6.0" | ||
}, | ||
"engines": { | ||
"node": ">=18" | ||
"node": ">=20" | ||
}, | ||
@@ -55,0 +55,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
118705
141
1846
+ Added@magidoc/plugin-starter-variables@6.2.0(transitive)
+ Added@magidoc/rollup-plugin-gql-schema@6.2.0(transitive)
+ Addedaxios@1.7.21.7.7(transitive)
+ Addedgraphql@16.9.0(transitive)
+ Addedlistr2@8.2.3(transitive)
+ Addedzod@3.23.8(transitive)
- Removed@magidoc/plugin-starter-variables@5.0.3(transitive)
- Removed@magidoc/rollup-plugin-gql-schema@5.0.3(transitive)
- Removedaxios@1.7.9(transitive)
- Removedgraphql@16.10.0(transitive)
- Removedlistr2@8.2.5(transitive)
- Removedzod@3.24.1(transitive)
Updatedaxios@1.7.2
Updatedchokidar@3.6.0
Updatedcommander@12.1.0
Updatedextract-zip@2.0.1
Updatedfs-extra@11.2.0
Updatedlistr2@8.2.3
Updatedlodash@4.17.21
Updatedsirv@2.0.4
Updatedzod@3.23.8