@aamini/config 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/vite.shared.ts CHANGED
@@ -85,7 +85,7 @@ function stylesPlugin(root: string): Plugin {
85
85
  }
86
86
  }
87
87
 
88
- const stylesSetup = new URL('setup/styles.ts', import.meta.url).pathname
88
+ const stylesSetup = '@aamini/config/setup/styles'
89
89
 
90
90
  function mergeProjectConfig(
91
91
  base: TestProjectConfiguration,
@@ -123,7 +123,6 @@ function createBaseConfig(
123
123
  },
124
124
  plugins: [
125
125
  tailwindcss(),
126
- viteReact(),
127
126
  svgr({
128
127
  include: '**/*.svg',
129
128
  svgrOptions: { exportType: 'default' },
@@ -228,10 +227,13 @@ export function createAppConfig(
228
227
  projectOverrides: ProjectOverrides = {},
229
228
  overrides: TestProjectInlineConfiguration = {},
230
229
  ) {
231
- return mergeConfig(
232
- createFrameworkConfig(root),
233
- createBaseConfig(root, overrides, projectOverrides),
234
- )
230
+ return {
231
+ ...workspaceConfig,
232
+ ...mergeConfig(
233
+ createFrameworkConfig(root),
234
+ createBaseConfig(root, overrides, projectOverrides),
235
+ ),
236
+ }
235
237
  }
236
238
 
237
239
  // Helper to create config from import.meta.url
@@ -240,36 +242,143 @@ export function baseConfigFor(configUrl: string | URL) {
240
242
  return createAppConfig(root)
241
243
  }
242
244
 
243
- // Workspace-level shared config (lint, fmt, staged)
244
- // Cast to any because Vite+ extensions (fmt, lint, staged) aren't in standard Vite types
245
- export const workspaceConfig = defineConfig({
245
+ // Workspace-level Vite+ config shared by monorepo roots.
246
+ export const workspaceConfig = {
246
247
  fmt: {
247
248
  singleQuote: true,
248
249
  semi: false,
249
250
  useTabs: true,
251
+ experimentalTailwindcss: {},
250
252
  printWidth: 80,
253
+ experimentalSortPackageJson: false,
251
254
  proseWrap: 'always',
252
255
  ignorePatterns: [
253
256
  '**/.vercel',
254
257
  '**/.output',
258
+ '**/dist/**',
255
259
  '**/env.d.ts',
256
260
  'pnpm-lock.yaml',
257
- 'routeTree.gen.ts',
261
+ '**/routeTree.gen.ts',
262
+ 'infra/manifests/gitops/flux-system/gotk-components.yaml',
263
+ 'infra/charts/**/templates/**/*.{yml,yaml}',
258
264
  '**/charts/**',
259
265
  '**/*.yaml',
260
266
  '**/*.yml',
261
267
  ],
268
+ overrides: [
269
+ {
270
+ files: ['*.{yaml,yml}'],
271
+ options: {
272
+ useTabs: false,
273
+ },
274
+ },
275
+ ],
262
276
  },
263
277
  lint: {
264
- plugins: ['typescript', 'react', 'unicorn'],
278
+ plugins: [
279
+ 'eslint',
280
+ 'unicorn',
281
+ 'typescript',
282
+ 'oxc',
283
+ 'react',
284
+ 'react-perf',
285
+ 'import',
286
+ 'jsdoc',
287
+ 'jsx-a11y',
288
+ 'node',
289
+ 'promise',
290
+ ],
291
+ categories: {},
265
292
  options: {
266
293
  typeAware: true,
267
294
  typeCheck: true,
268
295
  },
269
296
  rules: {
297
+ 'no-empty-pattern': 'off',
270
298
  'no-console': ['error', { allow: ['warn', 'error'] }],
271
299
  },
300
+ settings: {
301
+ 'jsx-a11y': {
302
+ components: {},
303
+ attributes: {},
304
+ },
305
+ react: {
306
+ formComponents: [],
307
+ linkComponents: [],
308
+ },
309
+ jsdoc: {
310
+ ignorePrivate: false,
311
+ ignoreInternal: false,
312
+ ignoreReplacesDocs: true,
313
+ overrideReplacesDocs: true,
314
+ augmentsExtendsReplacesDocs: false,
315
+ implementsReplacesDocs: false,
316
+ exemptDestructuredRootsFromChecks: false,
317
+ tagNamePreference: {},
318
+ },
319
+ },
320
+ env: {
321
+ builtin: true,
322
+ },
323
+ globals: {},
324
+ ignorePatterns: ['**/dist/**'],
272
325
  overrides: [
326
+ {
327
+ files: ['**/*.test.unit.ts'],
328
+ rules: {
329
+ 'eslint/no-restricted-imports': [
330
+ 'error',
331
+ {
332
+ patterns: [
333
+ {
334
+ group: ['@aamini/config-testing/test/*'],
335
+ message:
336
+ 'Unit tests should not import test fixtures. Use plain vitest imports instead.',
337
+ },
338
+ ],
339
+ },
340
+ ],
341
+ },
342
+ },
343
+ {
344
+ files: ['**/*.test.tsx'],
345
+ rules: {
346
+ 'eslint/no-restricted-imports': [
347
+ 'error',
348
+ {
349
+ paths: [
350
+ {
351
+ name: '@aamini/config-testing/test/server',
352
+ message:
353
+ 'Browser tests (*.test.tsx) should use test/browser, not test/server.',
354
+ },
355
+ {
356
+ name: '@aamini/config-testing/test/db',
357
+ message:
358
+ 'Browser tests (*.test.tsx) should use test/browser, not test/db.',
359
+ },
360
+ ],
361
+ },
362
+ ],
363
+ },
364
+ },
365
+ {
366
+ files: ['**/*.test.ts'],
367
+ rules: {
368
+ 'eslint/no-restricted-imports': [
369
+ 'error',
370
+ {
371
+ paths: [
372
+ {
373
+ name: '@aamini/config-testing/test/browser',
374
+ message:
375
+ 'Server tests (*.test.ts) should use test/server or test/db, not test/browser.',
376
+ },
377
+ ],
378
+ },
379
+ ],
380
+ },
381
+ },
273
382
  {
274
383
  files: ['apps/**'],
275
384
  plugins: ['typescript', 'react'],
@@ -282,6 +391,10 @@ export const workspaceConfig = defineConfig({
282
391
  plugins: ['typescript', 'vitest'],
283
392
  rules: {
284
393
  '@typescript-eslint/no-explicit-any': 'off',
394
+ 'vitest/no-standalone-expect': [
395
+ 'warn',
396
+ { additionalTestBlockFunctions: ['test', 'test.skip'] },
397
+ ],
285
398
  },
286
399
  },
287
400
  {
@@ -295,4 +408,4 @@ export const workspaceConfig = defineConfig({
295
408
  staged: {
296
409
  '*.{js,ts,tsx}': 'vp check --fix',
297
410
  },
298
- } as any)
411
+ }