Skip to content

Commit

Permalink
chore(dependencies): update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Aug 16, 2023
1 parent 2d3be5f commit f2ad107
Show file tree
Hide file tree
Showing 9 changed files with 260 additions and 197 deletions.
379 changes: 231 additions & 148 deletions package-lock.json

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,21 @@
},
"homepage": "https://github.com/nfroidure/metapak#readme",
"dependencies": {
"@types/glob": "^8.0.0",
"@types/mkdirp": "^1.0.2",
"chalk": "^5.2.0",
"commander": "^9.4.1",
"common-services": "^12.1.0",
"@types/glob": "^8.1.0",
"@types/mkdirp": "^2.0.0",
"application-services": "^3.0.0",
"chalk": "^5.3.0",
"commander": "^11.0.0",
"common-services": "^14.0.0",
"debug": "^4.3.4",
"diff": "^5.1.0",
"glob": "^8.0.3",
"glob": "^10.3.3",
"knifecycle": "^16.0.0",
"mkdirp": "^1.0.4",
"mkdirp": "^3.0.1",
"pkg-dir": "^7.0.0",
"sort-keys": "^5.0.0",
"type-fest": "^3.5.0",
"yerror": "^6.2.1"
"type-fest": "^4.2.0",
"yerror": "^8.0.0"
},
"devDependencies": {
"@swc/cli": "^0.1.62",
Expand Down Expand Up @@ -200,4 +201,4 @@
],
"prettierPath": null
}
}
}
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import {
import initDebug from 'debug';
import os from 'os';
import path from 'path';
import glob from 'glob';
import { glob } from 'glob';
import { promisify } from 'util';
import { exec } from 'child_process';
import initFS from './services/fs.js';
import initMetapak from './services/metapak.js';
import initBuildPackageConf from './services/packageConf.js';
import initBuildPackageAssets from './services/assets.js';
import initBuildPackageGitHooks from './services/gitHooks.js';
import initProjectDir from './services/projectDir.js';
import { initProjectDirService } from 'application-services';
import initProgramOptions from './services/programOptions.js';
import type { MetapakService } from './services/metapak.js';
import type {
Expand Down Expand Up @@ -71,7 +71,7 @@ export async function prepareMetapak($ = new Knifecycle()) {
$.register(initLogService);
$.register(initImporterService);
$.register(initResolveService);
$.register(name('PROJECT_DIR', initProjectDir));
$.register(name('PROJECT_DIR', initProjectDirService));
$.register(name('GIT_HOOKS_DIR', autoService(initGitHooksDir)));

$.register(initBuildPackageConf);
Expand Down
14 changes: 7 additions & 7 deletions src/services/assets.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { autoService } from 'knifecycle';
import path from 'path';
import { identityAsync, mapConfigsSequentially } from '../libs/utils.js';
import { printStackTrace } from 'yerror';
import { YError, printStackTrace } from 'yerror';
import type { MetapakContext, MetapakPackageJson } from '../libs/utils.js';
import type Glob from 'glob';
import type { GlobOptions } from 'glob';
import type { FSService } from './fs.js';
import type { ImporterService, LogService } from 'common-services';

Expand Down Expand Up @@ -38,7 +38,7 @@ async function initBuildPackageAssets({
PROJECT_DIR: string;
fs: FSService;
log: LogService;
glob: (pattern: string, options: Glob.IOptions) => Promise<string[]>;
glob: (pattern: string, options: GlobOptions) => Promise<string[]>;
importer: ImporterService<{
default: PackageAssetsTransformer<unknown, unknown>;
}>;
Expand Down Expand Up @@ -73,7 +73,7 @@ async function initBuildPackageAssets({
'🤷 - No asset tranformation found at:',
packageAssetsTransformerPath,
);
log('debug-stack', printStackTrace(err));
log('debug-stack', printStackTrace(err as YError));
transformer = identityAsync;
}

Expand All @@ -98,7 +98,7 @@ async function initBuildPackageAssets({
return { assets, transformer };
} catch (err) {
log('debug', '🤷 - No assets found at:', packageAssetsDir);
log('debug-stack', printStackTrace(err));
log('debug-stack', printStackTrace(err as YError));
return { assets: [], transformer };
}
})
Expand Down Expand Up @@ -197,7 +197,7 @@ async function _processAsset(
.readFileAsync(path.join(PROJECT_DIR, newFile.name))
.catch((err) => {
log('debug', '🤷 - Asset not found:', path.join(dir, newFile.name));
log('debug-stack', printStackTrace(err));
log('debug-stack', printStackTrace(err as YError));
return Buffer.from('');
})) as Buffer
).toString(),
Expand Down Expand Up @@ -248,7 +248,7 @@ async function _ensureDirExists(
try {
await fs.accessAsync(dir);
} catch (err) {
log('debug-stack', printStackTrace(err));
log('debug-stack', printStackTrace(err as YError));
log('warning', `📁 - Creating a directory:`, dir);
await fs.mkdirpAsync(path.join(PROJECT_DIR, dir));
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/fs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { name, autoService } from 'knifecycle';
import { YError } from 'yerror';
import fs from 'fs';
import mkdirp from 'mkdirp';
import { mkdirp } from 'mkdirp';
import type { WriteFileOptions } from 'fs';
import type { LogService } from 'common-services';
import type { ProgramOptionsService } from './programOptions.js';
Expand Down
6 changes: 3 additions & 3 deletions src/services/gitHooks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';
import { autoService } from 'knifecycle';
import { mapConfigsSequentially, identity } from '../libs/utils.js';
import { printStackTrace } from 'yerror';
import { YError, printStackTrace } from 'yerror';
import type { MetapakPackageJson, MetapakContext } from '../libs/utils.js';
import type { FSService } from './fs.js';
import type { ImporterService, LogService } from 'common-services';
Expand Down Expand Up @@ -81,7 +81,7 @@ async function initBuildPackageGitHooks({
return (await importer(packageHooksPath)).default;
} catch (err) {
log('debug', '🤷 - No hooks found at:', packageHooksPath);
log('debug-stack', printStackTrace(err));
log('debug-stack', printStackTrace(err as YError));
}
return identity as GitHooksTransformer<unknown, unknown>;
},
Expand Down Expand Up @@ -109,7 +109,7 @@ async function initBuildPackageGitHooks({
currentHookContent = (await fs.readFileAsync(hookPath)).toString();
} catch (err) {
log('debug', '🤷 - No existing hook found:', hookPath);
log('debug-stack', printStackTrace(err));
log('debug-stack', printStackTrace(err as YError));
}
if (currentHookContent !== hookContent) {
await fs.writeFileAsync(hookPath, Buffer.from(hookContent), {
Expand Down
4 changes: 2 additions & 2 deletions src/services/metapak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ async function readMetapakModulesConfigs(
buildExists = true;
} catch (err) {
log('debug', `🏗 - No build path found (${eventualBuildDir}).`);
log('debug-stack', printStackTrace(err));
log('debug-stack', printStackTrace(err as YError));
}

const srcDir = buildExists ? 'dist' : 'src';
Expand All @@ -293,7 +293,7 @@ async function readMetapakModulesConfigs(
'error',
`❌ - No configs found at "${fullSrcDir}" for the module "${metapakModuleName}".`,
);
log('error-stack', printStackTrace(err));
log('error-stack', printStackTrace(err as YError));
throw err;
}

Expand Down
4 changes: 2 additions & 2 deletions src/services/packageConf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import sortKeys from 'sort-keys';
import { isDeepStrictEqual } from 'util';
import path from 'path';
import { mapConfigsSequentially, identity, buildDiff } from '../libs/utils.js';
import { printStackTrace } from 'yerror';
import { YError, printStackTrace } from 'yerror';
import type { MetapakContext } from '../libs/utils.js';
import type { ImporterService, LogService } from 'common-services';
import type {
Expand Down Expand Up @@ -68,7 +68,7 @@ async function initBuildPackageConf({
'debug',
`🤷 - No package tranformation found at: ${packageTransformPath}`,
);
log('debug-stack', printStackTrace(err));
log('debug-stack', printStackTrace(err as YError));
}
return identity;
},
Expand Down
21 changes: 0 additions & 21 deletions src/services/projectDir.ts

This file was deleted.

0 comments on commit f2ad107

Please sign in to comment.