1
0
mirror of https://github.com/robonen/tools.git synced 2026-03-20 02:44:45 +00:00

feat(monorepo): migrate vue packages and apply oxlint refactors

This commit is contained in:
2026-03-07 18:07:22 +07:00
parent abd6605db3
commit 41d5e18f6b
286 changed files with 10295 additions and 5028 deletions

View File

@@ -1,15 +1,15 @@
import { defineConfig } from 'oxlint';
import { compose, base, typescript, imports } from '@robonen/oxlint';
import { compose, base, typescript, imports, stylistic } from '@robonen/oxlint';
export default defineConfig(
compose(base, typescript, imports, {
overrides: [
{
files: ['src/multi/global/index.ts'],
rules: {
'unicorn/prefer-global-this': 'off',
},
},
],
}),
compose(base, typescript, imports, stylistic, {
overrides: [
{
files: ['src/multi/global/index.ts'],
rules: {
'unicorn/prefer-global-this': 'off',
},
},
],
}),
);

View File

@@ -18,7 +18,7 @@
"url": "git+https://github.com/robonen/tools.git",
"directory": "packages/platform"
},
"packageManager": "pnpm@10.29.3",
"packageManager": "pnpm@10.30.3",
"engines": {
"node": ">=24.13.1"
},
@@ -39,7 +39,8 @@
}
},
"scripts": {
"lint": "oxlint -c oxlint.config.ts",
"lint:check": "oxlint -c oxlint.config.ts",
"lint:fix": "oxlint -c oxlint.config.ts --fix",
"test": "vitest run",
"dev": "vitest dev",
"build": "tsdown"
@@ -48,6 +49,7 @@
"@robonen/oxlint": "workspace:*",
"@robonen/tsconfig": "workspace:*",
"@robonen/tsdown": "workspace:*",
"@stylistic/eslint-plugin": "catalog:",
"oxlint": "catalog:",
"tsdown": "catalog:"
}

View File

@@ -8,7 +8,7 @@ describe('focusGuard', () => {
it('initialize with the correct default namespace', () => {
const guard = focusGuard();
expect(guard.selector).toBe('data-focus-guard');
});
@@ -31,7 +31,7 @@ describe('focusGuard', () => {
guard.removeGuard();
const guards = document.querySelectorAll(`[${guard.selector}]`);
expect(guards.length).toBe(0);
});
@@ -66,4 +66,4 @@ describe('focusGuard', () => {
expect(element.getAttribute('tabindex')).toBe('0');
expect(element.getAttribute('style')).toBe('outline: none; opacity: 0; pointer-events: none; position: fixed;');
});
});
});

View File

@@ -2,20 +2,20 @@
* @name focusGuard
* @category Browsers
* @description Adds a pair of focus guards at the boundaries of the DOM tree to ensure consistent focus behavior
*
*
* @param {string} namespace - The namespace to use for the guard attributes
* @returns {Object} - An object containing the selector, createGuard, and removeGuard functions
*
*
* @example
* const guard = focusGuard();
* guard.createGuard();
* guard.removeGuard();
*
*
* @example
* const guard = focusGuard('focus-guard');
* guard.createGuard();
* guard.removeGuard();
*
*
* @since 0.0.3
*/
export function focusGuard(namespace = 'focus-guard') {
@@ -29,7 +29,7 @@ export function focusGuard(namespace = 'focus-guard') {
};
const removeGuard = () => {
document.querySelectorAll(`[${guardAttr}]`).forEach((element) => element.remove());
document.querySelectorAll(`[${guardAttr}]`).forEach(element => element.remove());
};
return {
@@ -47,4 +47,4 @@ export function createGuardAttrs(namespace = 'focus-guard') {
element.setAttribute('style', 'outline: none; opacity: 0; pointer-events: none; position: fixed;');
return element;
}
}

View File

@@ -1 +1 @@
export * from './focusGuard';
export * from './focusGuard';

View File

@@ -7,8 +7,8 @@
*
* @since 0.0.1
*/
export const _global =
typeof globalThis !== 'undefined'
export const _global
= typeof globalThis !== 'undefined'
? globalThis
: typeof window !== 'undefined'
? window
@@ -22,7 +22,7 @@ export const _global =
* @name isClient
* @category Multi
* @description Check if the current environment is the client
*
*
* @since 0.0.1
*/
export const isClient = typeof window !== 'undefined' && typeof document !== 'undefined';
export const isClient = typeof window !== 'undefined' && typeof document !== 'undefined';

View File

@@ -1,2 +1,2 @@
export * from './global';
// export * from './debounce';
// export * from './debounce';

View File

@@ -7,4 +7,4 @@ export default defineConfig({
browsers: 'src/browsers/index.ts',
multi: 'src/multi/index.ts',
},
});
});

View File

@@ -5,4 +5,3 @@ export default defineConfig({
environment: 'jsdom',
},
});