Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 7 additions & 1 deletion .erb/configs/webpack.config.renderer.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ const configuration: webpack.Configuration = {
include: /\.module\.s?(c|a)ss$/,
},
{
test: /\.s?css$/,
test: /\.css$/,
resourceQuery: { not: [/raw/] },
use: ['style-loader', 'css-loader'],
exclude: /\.module\.s?(c|a)ss$/,
},
{
test: /\.s(c|a)ss$/,
resourceQuery: { not: [/raw/] },
use: ['style-loader', 'css-loader', 'sass-loader'],
exclude: /\.module\.s?(c|a)ss$/,
Expand Down
8 changes: 7 additions & 1 deletion .erb/configs/webpack.config.renderer.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ const configuration: webpack.Configuration = {
include: /\.module\.s?(c|a)ss$/,
},
{
test: /\.s?(a|c)ss$/,
test: /\.css$/,
resourceQuery: { not: [/raw/] },
use: [MiniCssExtractPlugin.loader, 'css-loader'],
exclude: /\.module\.s?(c|a)ss$/,
},
{
test: /\.s(a|c)ss$/,
resourceQuery: { not: [/raw/] },
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
exclude: /\.module\.s?(c|a)ss$/,
Expand Down
46 changes: 45 additions & 1 deletion .erb/scripts/unlink-dev-packages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,46 @@
import { DEV_REPOS, execInRepo } from './dev-package-utils';
import fs from 'fs';
import path from 'path';
import { DEV_REPOS, REPO_ROOT, execInRepo } from './dev-package-utils';

function fixYalcInLockFile(): void {
const lockFilePath = path.resolve(REPO_ROOT, 'package-lock.json');
const lockContent = fs.readFileSync(lockFilePath, 'utf8');

if (!lockContent.includes('.yalc')) return;

console.log('Detected .yalc entries in package-lock.json, cleaning up...');

// Find all node_modules/* entries whose resolved path points into .yalc
const lock: { packages?: Record<string, { resolved?: string }> } = JSON.parse(lockContent);
const packagesToReinstall: string[] = Object.entries(lock.packages ?? {})
.filter(
([key, value]) => key.startsWith('node_modules/') && value.resolved?.startsWith('.yalc'),
)
.map(([key]) => {
const packageName = key.slice('node_modules/'.length);

// Remove the symlink (or broken directory) from node_modules so npm re-downloads it
const nodeModulesPath = path.resolve(REPO_ROOT, key);
try {
const stat = fs.lstatSync(nodeModulesPath);
if (stat.isSymbolicLink()) {
fs.unlinkSync(nodeModulesPath);
} else {
fs.rmSync(nodeModulesPath, { recursive: true, force: true });
}
console.log(`Removed ${nodeModulesPath}`);
} catch {
// Already gone — nothing to do
}

return packageName;
});

if (packagesToReinstall.length > 0) {
console.log(`Re-installing from registry: ${packagesToReinstall.join(', ')}`);
execInRepo(`npm install ${packagesToReinstall.join(' ')} --ignore-scripts`);
}
}

function unlinkDevPackages(): void {
try {
Expand All @@ -9,6 +51,8 @@ function unlinkDevPackages(): void {
});
});

fixYalcInLockFile();

console.log('Unlinked dev packages');
} catch (err) {
console.error('Error: Failed to unlink dev packages.');
Expand Down
9 changes: 8 additions & 1 deletion .eslintrc.ai.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {

// === Styling (Tailwind) ===

// No hardcoded colors - use theme tokens (tw-bg-background, tw-text-foreground)
// No hardcoded colors - use theme tokens (tw:bg-background, tw:text-foreground)
// See: Code-Style-Guide.md "Theming Requirements"
'paranext/no-hardcoded-tailwind-colors': 'error',

Expand Down Expand Up @@ -65,6 +65,13 @@ module.exports = {
'paranext/registration-cleanup': 'warn',
},
overrides: [
{
// Service files are not WebView source files even if they live in a web-views subfolder
files: ['src/renderer/services/**'],
rules: {
'paranext/webview-file-naming': 'off',
},
},
{
// Extension entry points - strict registration and cleanup
files: ['extensions/src/**/main.ts', 'src/extension-host/**/*.ts'],
Expand Down
8 changes: 8 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ module.exports = {
],
},
},
{
// Playwright e2e test fixtures use a `use()` callback that is Playwright's fixture API,
// not a React hook. react-hooks/rules-of-hooks v5 incorrectly flags these calls.
files: ['e2e-tests/**/*.ts', 'e2e-tests/**/*.tsx'],
rules: {
'react-hooks/rules-of-hooks': 'off',
},
},
{
// Vitest test rules and globals (replaces eslint-plugin-jest that was previously bundled in erb)
files: ['*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx'],
Expand Down
Loading
Loading