@richapps/ong 0.1.3 → 0.1.4

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.
Files changed (2) hide show
  1. package/dist/config.js +12 -7
  2. package/package.json +1 -1
package/dist/config.js CHANGED
@@ -13,21 +13,18 @@ export function resolveTsconfigPaths(tsconfig, workspaceRoot) {
13
13
  let paths;
14
14
  let baseUrl = '.';
15
15
  // Walk the extends chain to find paths
16
- while (configPath && !paths) {
16
+ // Collect baseUrl from each level; paths from the first config that defines them
17
+ const configChain = [];
18
+ while (configPath) {
17
19
  if (!existsSync(configPath))
18
20
  break;
19
21
  const raw = readFileSync(configPath, 'utf-8');
20
22
  // Strip comments (single-line // and multi-line /* */)
21
23
  const stripped = raw.replace(/\/\/.*$/gm, '').replace(/\/\*[\s\S]*?\*\//g, '');
22
24
  const config = JSON.parse(stripped);
23
- const compilerOptions = config.compilerOptions ?? {};
24
- if (compilerOptions.paths) {
25
- paths = compilerOptions.paths;
26
- baseUrl = compilerOptions.baseUrl ?? '.';
27
- }
25
+ configChain.push(config);
28
26
  if (config.extends) {
29
27
  configPath = resolve(configPath, '..', config.extends);
30
- // Add .json if not present
31
28
  if (!configPath.endsWith('.json'))
32
29
  configPath += '.json';
33
30
  }
@@ -35,6 +32,14 @@ export function resolveTsconfigPaths(tsconfig, workspaceRoot) {
35
32
  break;
36
33
  }
37
34
  }
35
+ // Resolve inherited values: child overrides parent
36
+ for (let i = configChain.length - 1; i >= 0; i--) {
37
+ const compilerOptions = configChain[i].compilerOptions ?? {};
38
+ if (compilerOptions.baseUrl !== undefined)
39
+ baseUrl = compilerOptions.baseUrl;
40
+ if (compilerOptions.paths !== undefined)
41
+ paths = compilerOptions.paths;
42
+ }
38
43
  if (!paths)
39
44
  return aliases;
40
45
  const baseDir = resolve(workspaceRoot, baseUrl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@richapps/ong",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Angular CLI powered by Vite + OXC — blazing fast drop-in replacement for ng serve/build",
5
5
  "keywords": [
6
6
  "angular",