add test coverage of SWC-TypeScript path aliases for UI and API imports

This commit is contained in:
Nacho Codoñer
2025-08-13 13:26:42 +02:00
parent 42dd571ef8
commit b66c48d85d
4 changed files with 14 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
{
"jsc": {
"baseUrl": "./",
"paths": {
"@ui/*": ["imports/ui/*"],
"@api/*": ["imports/api/*"]
}
}
}

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { Meteor } from 'meteor/meteor';
import { App } from '/imports/ui/App';
import { App } from '@ui/App';
Meteor.startup(() => {
const container = document.getElementById('react-target');

View File

@@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { Link, LinksCollection } from '/imports/api/links';
import { Link, LinksCollection } from '@api/links';
async function insertLink({ title, url }: Pick<Link, 'title' | 'url'>) {
await LinksCollection.insertAsync({ title, url, createdAt: new Date() });

View File

@@ -26,6 +26,9 @@
"paths": {
/* Support absolute /imports/* with a leading '/' */
"/*": ["*"],
/* Test aliases */
"@ui/*": ["imports/ui/*"],
"@api/*": ["imports/api/*"],
/* Pull in type declarations for Meteor packages from either zodern:types or @types/meteor packages */
"meteor/*": [
"node_modules/@types/meteor/*",