Skip to content

Commit

Permalink
Allow ts_project to see package.json (for esmodule resolution).
Browse files Browse the repository at this point in the history
  • Loading branch information
Zemnmez committed Jan 22, 2024
1 parent 5538c1d commit 58b2fc2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
7 changes: 5 additions & 2 deletions ts/math/conv_test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import * as cartesian from '#root/ts/math/cartesian.js';
import {
Cartestian as C,
Euler as E,
Quaternion as Q,
} from '#root/ts/math/conv.js';
import * as euler_angle from '#root/ts/math/euler_angle.js';
import * as quaternion from '#root/ts/math/quaternion.js';

import { Cartestian as C, Euler as E, Quaternion as Q } from './conv';

describe('Conversions', () => {
test('Quaternion from EulerAngles', () => {
const eulerAngles = new euler_angle.EulerAngle(
Expand Down
2 changes: 1 addition & 1 deletion ts/next.js/component/Redirect/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* app router.
*/

import Head from 'next/head';
import Head from 'next/head.js';
import { useRouter } from 'next/navigation';
import { useEffect } from 'react';

Expand Down
4 changes: 2 additions & 2 deletions ts/next.js/component/Redirect/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Head from 'next/head';
import { useRouter } from 'next/router';
import { Head } from 'next/head.js';
import { useRouter } from 'next/router.js';
import { useEffect } from 'react';

export interface Props {
Expand Down
2 changes: 1 addition & 1 deletion ts/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def ts_project(name, visibility = None, deps = [], ignores_lint = [], resolve_js

_ts_project(
name = name,
srcs = srcs,
srcs = srcs + [ "//:package_json" ],
tsconfig = tsconfig,
# swc injects this
deps = deps + ["//:node_modules/regenerator-runtime"],
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"module": "node16",
"module": "esnext",
"moduleResolution": "bundler",
"target": "es2020",
"strictFunctionTypes": true,
"esModuleInterop": true,
"moduleResolution": "node16",
"strict": true,
"jsx": "react-jsx",
"resolveJsonModule": true,
Expand Down

0 comments on commit 58b2fc2

Please sign in to comment.