Skip to content

Commit

Permalink
[patch] use new augment-vir
Browse files Browse the repository at this point in the history
  • Loading branch information
electrovir committed Sep 14, 2024
1 parent 05b6b73 commit 71bf3a4
Show file tree
Hide file tree
Showing 80 changed files with 1,678 additions and 1,428 deletions.
1,740 changes: 1,076 additions & 664 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@virmator/mono-repo-root",
"version": "13.3.12",
"version": "13.3.13",
"private": true,
"type": "module",
"workspaces": [
Expand Down Expand Up @@ -33,7 +33,7 @@
"esbuild": "^0.23.1",
"eslint": "^9.10.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsdoc": "^50.2.2",
"eslint-plugin-jsdoc": "^50.2.3",
"eslint-plugin-monorepo-cop": "^1.0.2",
"eslint-plugin-playwright": "^1.6.2",
"eslint-plugin-prettier": "^5.2.1",
Expand Down
19 changes: 10 additions & 9 deletions packages/compile/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@virmator/compile",
"version": "13.3.12",
"version": "13.3.13",
"description": "Default TS compile plugin for virmator.",
"keywords": [
"virmator",
Expand Down Expand Up @@ -31,20 +31,21 @@
"test:update": "npm test update"
},
"dependencies": {
"@augment-vir/common": "^29.3.0",
"@augment-vir/node-js": "^29.3.0",
"@virmator/core": "^13.3.12",
"run-time-assertions": "^1.5.2"
"@augment-vir/assert": "^30.0.4",
"@augment-vir/common": "^30.0.4",
"@augment-vir/node": "^30.0.4",
"@virmator/core": "^13.3.13"
},
"devDependencies": {
"@types/node": "^22.5.4",
"@virmator/plugin-testing": "^13.3.12",
"@augment-vir/test": "^30.0.4",
"@types/node": "^22.5.5",
"@virmator/plugin-testing": "^13.3.13",
"c8": "^10.1.2",
"chalk": "^5.3.0",
"concurrently": "^9.0.0",
"concurrently": "^9.0.1",
"istanbul-smart-text-reporter": "^1.1.4",
"mono-vir": "^1.0.1",
"tsx": "^4.19.0",
"tsx": "^4.19.1",
"typescript": "^5.6.2"
},
"peerDependencies": {
Expand Down
9 changes: 5 additions & 4 deletions packages/compile/src/compile.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import {LogOutputType, runShellCommand} from '@augment-vir/node-js';
import {LogOutputType} from '@augment-vir/common';
import {runShellCommand} from '@augment-vir/node';
import {describe, it, type UniversalTestContext} from '@augment-vir/test';
import {testPlugin} from '@virmator/plugin-testing';
import {join} from 'node:path';
import {describe, it, TestContext} from 'node:test';
import {virmatorCompilePlugin} from './compile.js';
import {testFilesDir} from './file-paths.mock.js';

describe(virmatorCompilePlugin.name, () => {
async function testVirmatorCompilePlugin(
shouldPass: boolean,
context: TestContext,
context: UniversalTestContext,
cwd: string,
) {
await testPlugin(shouldPass, context, virmatorCompilePlugin, 'compile', cwd, {
Expand All @@ -17,7 +18,7 @@ describe(virmatorCompilePlugin.name, () => {
* This log transform removes excessive TypeScript help logging so that test results
* are stable.
*/
if (logType === LogOutputType.standard) {
if (logType === LogOutputType.Standard) {
return arg;
}
return arg;
Expand Down
27 changes: 13 additions & 14 deletions packages/compile/src/compile.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import {isTruthy} from '@augment-vir/common';
import {logColors} from '@augment-vir/node-js';
import {check} from '@augment-vir/assert';
import {logColors, RuntimeEnv} from '@augment-vir/common';
import {
copyConfigFile,
defineVirmatorPlugin,
NpmDepType,
PackageType,
parseTsConfig,
VirmatorEnv,
VirmatorPluginExecutorParams,
} from '@virmator/core';
import type {ChalkInstance} from 'chalk';
Expand Down Expand Up @@ -46,8 +45,8 @@ export const virmatorCompilePlugin = defineVirmatorPlugin(
copyFromPath: join('configs', 'tsconfig.package.json'),
copyToPath: 'tsconfig.json',
env: [
VirmatorEnv.Node,
VirmatorEnv.Web,
RuntimeEnv.Node,
RuntimeEnv.Web,
],
packageType: [
PackageType.TopPackage,
Expand All @@ -58,8 +57,8 @@ export const virmatorCompilePlugin = defineVirmatorPlugin(
copyFromPath: join('configs', 'tsconfig.mono-package.json'),
copyToPath: 'tsconfig.json',
env: [
VirmatorEnv.Node,
VirmatorEnv.Web,
RuntimeEnv.Node,
RuntimeEnv.Web,
],
packageType: [
PackageType.MonoPackage,
Expand All @@ -70,8 +69,8 @@ export const virmatorCompilePlugin = defineVirmatorPlugin(
copyFromPath: join('configs', 'tsconfig.mono.json'),
copyToPath: join('configs', 'tsconfig.base.json'),
env: [
VirmatorEnv.Node,
VirmatorEnv.Web,
RuntimeEnv.Node,
RuntimeEnv.Web,
],
packageType: [
PackageType.MonoRoot,
Expand All @@ -83,8 +82,8 @@ export const virmatorCompilePlugin = defineVirmatorPlugin(
typescript: {
type: NpmDepType.Dev,
env: [
VirmatorEnv.Node,
VirmatorEnv.Web,
RuntimeEnv.Node,
RuntimeEnv.Web,
],
packageType: [
PackageType.TopPackage,
Expand All @@ -93,8 +92,8 @@ export const virmatorCompilePlugin = defineVirmatorPlugin(
'mono-vir': {
type: NpmDepType.Dev,
env: [
VirmatorEnv.Node,
VirmatorEnv.Web,
RuntimeEnv.Node,
RuntimeEnv.Web,
],
packageType: [
PackageType.MonoRoot,
Expand Down Expand Up @@ -177,7 +176,7 @@ async function createCompileCommandString(
tsconfig?.options.composite ? '-b' : '',
'--pretty',
...cliInputs.filteredArgs,
].filter(isTruthy);
].filter(check.isTruthy);

return fullCommand.join(' ');
}
14 changes: 7 additions & 7 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@virmator/core",
"version": "13.3.12",
"version": "13.3.13",
"description": "Shared core functionality for all virmator plugins and the virmator CLI.",
"keywords": [
"automation",
Expand Down Expand Up @@ -31,20 +31,20 @@
"test:update": "npm test update"
},
"dependencies": {
"@augment-vir/common": "^29.3.0",
"@augment-vir/node-js": "^29.3.0",
"@augment-vir/assert": "^30.0.4",
"@augment-vir/common": "^30.0.4",
"@augment-vir/node": "^30.0.4",
"chalk": "^5.3.0",
"cli-args-vir": "^0.0.3",
"concurrently": "^9.0.0",
"concurrently": "^9.0.1",
"mono-vir": "^1.0.1",
"run-time-assertions": "^1.5.2",
"semver": "^7.6.3",
"type-fest": "^4.26.1",
"typescript": "^5.6.2"
},
"devDependencies": {
"@augment-vir/testing": "^29.3.0",
"@types/node": "^22.5.4",
"@augment-vir/test": "^30.0.4",
"@types/node": "^22.5.5",
"@types/semver": "^7.5.8",
"esbuild": "^0.23.1"
},
Expand Down
47 changes: 24 additions & 23 deletions packages/core/src/api/copy-configs.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import {PackageType, VirmatorEnv} from '@virmator/core';
import assert from 'node:assert/strict';
import {assert} from '@augment-vir/assert';
import {RuntimeEnv} from '@augment-vir/common';
import {describe, it} from '@augment-vir/test';
import {PackageType} from '@virmator/core';
import {join} from 'node:path';
import {describe, it} from 'node:test';
import {flattenConfigs} from './copy-configs.js';

describe(flattenConfigs.name, () => {
it('flattens the compile configs', () => {
assert.deepStrictEqual(
assert.deepEquals(
flattenConfigs(
{
compile: {
Expand All @@ -20,8 +21,8 @@ describe(flattenConfigs.name, () => {
copyFromPath: join('configs', 'tsconfig.package.json'),
copyToPath: 'tsconfig.json',
env: [
VirmatorEnv.Node,
VirmatorEnv.Web,
RuntimeEnv.Node,
RuntimeEnv.Web,
],
packageType: [
PackageType.TopPackage,
Expand All @@ -32,8 +33,8 @@ describe(flattenConfigs.name, () => {
copyFromPath: join('configs', 'tsconfig.mono.json'),
copyToPath: join('configs', 'tsconfig.base.json'),
env: [
VirmatorEnv.Node,
VirmatorEnv.Web,
RuntimeEnv.Node,
RuntimeEnv.Web,
],
packageType: [
PackageType.MonoRoot,
Expand All @@ -52,8 +53,8 @@ describe(flattenConfigs.name, () => {
copyFromPath: join('configs', 'tsconfig.package.json'),
copyToPath: 'tsconfig.json',
env: [
VirmatorEnv.Node,
VirmatorEnv.Web,
RuntimeEnv.Node,
RuntimeEnv.Web,
],
packageType: [
PackageType.TopPackage,
Expand All @@ -71,8 +72,8 @@ describe(flattenConfigs.name, () => {
copyFromPath: join('configs', 'tsconfig.mono.json'),
copyToPath: join('configs', 'tsconfig.base.json'),
env: [
VirmatorEnv.Node,
VirmatorEnv.Web,
RuntimeEnv.Node,
RuntimeEnv.Web,
],
packageType: [
PackageType.MonoRoot,
Expand Down Expand Up @@ -100,8 +101,8 @@ describe(flattenConfigs.name, () => {
copyFromPath: join('configs', 'tsconfig.package.json'),
copyToPath: 'tsconfig.json',
env: [
VirmatorEnv.Node,
VirmatorEnv.Web,
RuntimeEnv.Node,
RuntimeEnv.Web,
],
packageType: [
PackageType.TopPackage,
Expand All @@ -119,8 +120,8 @@ describe(flattenConfigs.name, () => {
copyFromPath: join('configs', 'tsconfig.mono.json'),
copyToPath: join('configs', 'tsconfig.base.json'),
env: [
VirmatorEnv.Node,
VirmatorEnv.Web,
RuntimeEnv.Node,
RuntimeEnv.Web,
],
packageType: [
PackageType.MonoRoot,
Expand All @@ -133,7 +134,7 @@ describe(flattenConfigs.name, () => {
);
});
it('flattens the deps configs', () => {
assert.deepStrictEqual(
assert.deepEquals(
flattenConfigs(
{
deps: {
Expand Down Expand Up @@ -167,8 +168,8 @@ describe(flattenConfigs.name, () => {
copyFromPath: join('configs', 'dep-cruiser.config.ts'),
copyToPath: join('configs', 'dep-cruiser.config.ts'),
env: [
VirmatorEnv.Node,
VirmatorEnv.Web,
RuntimeEnv.Node,
RuntimeEnv.Web,
],
packageType: [
PackageType.MonoRoot,
Expand All @@ -193,8 +194,8 @@ describe(flattenConfigs.name, () => {
copyFromPath: join('configs', 'dep-cruiser.config.ts'),
copyToPath: join('configs', 'dep-cruiser.config.ts'),
env: [
VirmatorEnv.Node,
VirmatorEnv.Web,
RuntimeEnv.Node,
RuntimeEnv.Web,
],
packageType: [
PackageType.MonoRoot,
Expand Down Expand Up @@ -241,8 +242,8 @@ describe(flattenConfigs.name, () => {
'dep-cruiser.config.ts',
),
env: [
VirmatorEnv.Node,
VirmatorEnv.Web,
RuntimeEnv.Node,
RuntimeEnv.Web,
],
packageType: [
PackageType.MonoRoot,
Expand Down
7 changes: 3 additions & 4 deletions packages/core/src/api/copy-configs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {awaitedForEach, extractErrorMessage, MaybePromise} from '@augment-vir/common';
import {awaitedForEach, extractErrorMessage, MaybePromise, type Logger} from '@augment-vir/common';
import {existsSync} from 'node:fs';
import {mkdir, readFile, writeFile} from 'node:fs/promises';
import {basename, dirname, join} from 'node:path';
Expand All @@ -9,7 +9,6 @@ import {
UsedVirmatorPluginCommands,
VirmatorPluginResolvedConfigs,
} from '../plugin/plugin-executor.js';
import {PluginLogger} from '../plugin/plugin-logger.js';

/**
* Extracts a 1d array of virmator plugin config files from previously calculated used commands and
Expand Down Expand Up @@ -47,7 +46,7 @@ export async function copyPluginConfigs(
resolvedConfigs: Readonly<VirmatorPluginResolvedConfigs<any>>,
packageType: PackageType,
monoRepoPackages: MonoRepoPackage[],
log: PluginLogger,
log: Logger,
filteredArgs: string[],
) {
const configs = flattenConfigs(usedCommands, resolvedConfigs).sort((a, b) =>
Expand Down Expand Up @@ -84,7 +83,7 @@ export async function copyPluginConfigs(
/** Copies a single virmator plugin config file. */
export async function copyConfigFile(
config: Readonly<Pick<VirmatorPluginResolvedConfigFile, 'fullCopyFromPath' | 'fullCopyToPath'>>,
log: PluginLogger,
log: Logger,
/**
* If `true`, the config will be copied even if the copy destination already exists.
*
Expand Down
Loading

0 comments on commit 71bf3a4

Please sign in to comment.