Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use node16 in tsconfig.json #2052

Merged
merged 2 commits into from
Oct 11, 2023
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/typespec-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"generate-tsp-only:rlc": "ts-node ./test/commands/gen-cadl-ranch.ts --tag=rlc",
"generate-tsp-only:modular": "ts-node ./test/commands/gen-cadl-ranch.ts --tag=modular",
"integration-test:alone": "npm run integration-test:alone:rlc && npm run integration-test:alone:modular",
"integration-test:alone:rlc": "cross-env TS_NODE_PROJECT=tsconfig.test.json mocha -r ts-node/register --experimental-specifier-resolution=node --timeout 4000 ./test/integration/*.spec.ts",
"integration-test:alone:modular": "cross-env TS_NODE_PROJECT=tsconfig.test.json mocha -r ts-node/register --experimental-specifier-resolution=node --timeout 4000 ./test/modularIntegration/*.spec.ts",
"integration-test:alone:rlc": "cross-env TS_NODE_PROJECT=tsconfig.integration.json mocha -r ts-node/register --experimental-specifier-resolution=node --timeout 4000 ./test/integration/*.spec.ts",
"integration-test:alone:modular": "cross-env TS_NODE_PROJECT=tsconfig.integration.json mocha -r ts-node/register --experimental-specifier-resolution=node --timeout 4000 ./test/modularIntegration/*.spec.ts",
"stop-test-server": "npx cadl-ranch server stop",
"unit-test": "npm run unit-test:rlc && npm run unit-test:modular",
"unit-test:rlc": "cross-env TS_NODE_PROJECT=tsconfig.json mocha -r ts-node/register --experimental-specifier-resolution=node --experimental-modules=true --timeout 4000 './test/unit/**/*.spec.ts'",
Expand Down
4 changes: 4 additions & 0 deletions packages/typespec-ts/test/integration/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../../tsconfig.integration.json",
"include": ["./**/*.ts"]
}
3 changes: 2 additions & 1 deletion packages/typespec-ts/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"extends": "../tsconfig.test.json",
"include": ["./**/*.ts", "./**/**/*.ts"]
"include": ["./**/*.ts", "./**/**/*.ts"],
"exclude": ["./integration/**/*.ts"]
}
7 changes: 7 additions & 0 deletions packages/typespec-ts/tsconfig.integration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node"
}
}
4 changes: 2 additions & 2 deletions packages/typespec-ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"composite": true,
"lib": ["ES2019"],
"target": "es2019",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"module": "node16",
Copy link
Member

@MaryGao MaryGao Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change! The issue we found happens in dev version e.g "@azure-tools/typespec-azure-core": "0.35.0-dev.11" and see pr #2053. And in our main we use the stable version not dev one.

Can you also make a pr to apply your change in my test branch? So we could verify it works or not.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That change should happen regardless of the version of typespec that you are using. You might get into the same issue with other packages in the future. So I would just merge that if it is not causing any issues anyway. If there is more problem to the dev version then we can investigate further.

"moduleResolution": "node16",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to this file shouldn't actually be needed if you prefer to stay to nodenext

"declaration": true,
"declarationMap": true,
"sourceMap": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-ts/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node"
"module": "node16",
"moduleResolution": "node16"
timotheeguerin marked this conversation as resolved.
Show resolved Hide resolved
}
}
Loading