Skip to content

Commit

Permalink
Polish.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Feb 10, 2024
1 parent 00f68ac commit 770e6a6
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 195 deletions.
14 changes: 0 additions & 14 deletions babel.config.js

This file was deleted.

34 changes: 0 additions & 34 deletions jest.config.js

This file was deleted.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
"node": "20.11.0"
},
"devDependencies": {
"@babel/core": "^7.23.9",
"@moonrepo/cli": "^1.21.3",
"@moonrepo/dev": "^2.0.1",
"@types/babel__core": "^7.20.5",
"@types/exit": "^0.1.31",
"@types/fs-extra": "^11.0.1",
"@types/lodash-es": "^4.17.12",
Expand All @@ -27,7 +25,6 @@
"@types/split": "^1.0.2",
"@types/wrap-ansi": "^3.0.0",
"@vitest/coverage-v8": "^1.2.2",
"babel-preset-moon": "^2.0.14",
"eslint": "^8.56.0",
"eslint-config-moon": "^2.1.1",
"fs-extra": "^11.1.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/decorators/src/Deprecate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export function Deprecate(message?: string) {
} else if (isProperty(target, property, descriptor)) {
console.debug(message ?? `Property \`${className + accessSymbol}\` has been deprecated.`);

// Param (Babel/Jest doesnt support them)
} /* istanbul ignore next */ else if (isParam(target, property, descriptor)) {
// Param
} else if (isParam(target, property, descriptor)) {
console.debug(
message ??
`Parameter ${descriptor} for \`${className + accessSymbol}()\` has been deprecated.`,
Expand Down
2 changes: 1 addition & 1 deletion packages/module/tests/requireModule.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ describe('requireModule()', () => {
expect(() => requireModule(getFixture('format-mjs.mjs'))).toThrow();
});

// Unable to test .ts, .tsx because of Jest require patching
// Unable to test .ts, .tsx because of require patching
});
});
4 changes: 2 additions & 2 deletions packages/test-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
![build status](https://img.shields.io/github/workflow/status/milesj/boost/Build)
![npm version](https://img.shields.io/npm/v/@boost/test-utils)

Jest testing utilities for [Boost](https://github.com/milesj/boost/) powered applications.
Vite testing utilities for [Boost](https://github.com/milesj/boost/) powered applications.

## Requirements

- Boost
- Jest
- Vite

## Installation

Expand Down
4 changes: 3 additions & 1 deletion tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"themes/*/types/**/*",
"website/src/**/*",
"website/types/**/*",
"types/**/*"
"types/**/*",
"*.config.js",
"*.config.ts"
]
}
6 changes: 0 additions & 6 deletions types/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
/* eslint-disable @typescript-eslint/method-signature-style */

declare namespace jest {
interface Matchers<R, T = {}> {
toBeFilePath(path: string): R;
}
}

declare const __DEV__: boolean;

declare function delay(time?: number): Promise<void>;
11 changes: 8 additions & 3 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { defineConfig } from 'vitest/config';
/* eslint-disable import/no-default-export */

import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';

export default defineConfig({
plugins: [
Expand All @@ -9,6 +12,8 @@ export default defineConfig({
if (id.startsWith('cjs-') || id.startsWith('esm-')) {
return `virtual:${id}`;
}

return null;
},
},
],
Expand All @@ -17,7 +22,6 @@ export default defineConfig({
},
test: {
coverage: {
provider: 'v8',
exclude: [
'__fixtures__',
'src/test.ts',
Expand All @@ -40,14 +44,15 @@ export default defineConfig({
'test-utils/src',
'website/src',
],
provider: 'v8',
thresholds: {
branches: 90,
functions: 99,
lines: 99,
statements: 99,
},
},
setupFiles: [path.join(import.meta.dirname, './tests/setup.ts')],
passWithNoTests: true,
setupFiles: [path.join(path.dirname(fileURLToPath(import.meta.url)), './tests/setup.ts')],
},
});
28 changes: 28 additions & 0 deletions website/docs/migrate/5.0.md
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
---
title: 5.0 migration
sidebar_label: '5.0'
---

## All packages

- Requires TypeScript v5 or greater.
- Dropped Node.js v14 support. Now requires v16.20 and above.
- Updated many dependencies to their latest major version.

### Migrated to ECMAScript modules (`.mjs`)

TODO

## @boost/common

- Migrated from `resolve` to `enhanced-resolve` for `PathResolver`. This is to support
`package.json` exports. We currently support the `import`, `require`, and `node` conditions.

## @boost/plugin

- Updated the `Loader` to use dynamic `import()` for loading modules, instead of our `requireModule`
function from `@boost/module`. This is to support both CJS and ESM files.

## @boost/test-utils

- Migrated from Jest to Vitest.
- Removed the `copyFixtureToMock` function.
2 changes: 1 addition & 1 deletion website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
type: 'category',
label: 'Migrations',
collapsed: true,
items: ['migrate/3.0', 'migrate/4.0'],
items: ['migrate/3.0', 'migrate/4.0', 'migrate/5.0'],
},
{
type: 'link',
Expand Down
Loading

0 comments on commit 770e6a6

Please sign in to comment.