diff --git a/packages/common/client-utils/jest.config.js b/packages/common/client-utils/jest.config.js index 8341b38a5c84..012abaedc52e 100644 --- a/packages/common/client-utils/jest.config.js +++ b/packages/common/client-utils/jest.config.js @@ -15,6 +15,6 @@ module.exports = { }, ], ], - testMatch: ["**/dist/test/jest/?(*.)+(spec|test).js"], + testMatch: ["**/dist/test/jest/?(*.)+(spec|test).?js"], testPathIgnorePatterns: ["/node_modules/"], }; diff --git a/packages/common/client-utils/package.json b/packages/common/client-utils/package.json index 0d608a0b555e..8a2693919756 100644 --- a/packages/common/client-utils/package.json +++ b/packages/common/client-utils/package.json @@ -11,11 +11,11 @@ "license": "MIT", "author": "Microsoft and contributors", "sideEffects": false, - "main": "dist/index.js", - "module": "lib/index.js", + "main": "dist/index.cjs", + "module": "lib/index.mjs", "browser": { - "./dist/indexNode.js": "./dist/indexBrowser.js", - "./lib/indexNode.js": "./lib/indexBrowser.js" + "./dist/indexNode.cjs": "./dist/indexBrowser.cjs", + "./lib/indexNode.mjs": "./lib/indexBrowser.mjs" }, "types": "dist/index.d.ts", "scripts": { @@ -26,11 +26,9 @@ "build:commonjs": "fluid-build . --task commonjs", "build:compile": "fluid-build . --task compile", "build:docs": "fluid-build . --task api", - "build:esnext": "tsc --project ./tsconfig.esnext.json", - "build:test": "concurrently npm:build:test:mocha npm:build:test:jest npm:build:test:types", - "build:test:jest": "tsc --project ./src/test/jest/tsconfig.json", - "build:test:mocha": "tsc --project ./src/test/mocha/tsconfig.json", - "build:test:types": "tsc --project ./src/test/types/tsconfig.json", + "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json", + "build:rename-types": "renamer \"lib/**\" -f .d.ts -r .d.mts --force", + "build:test": "tsc-multi --config ./tsc-multi.test.json", "check:are-the-types-wrong": "attw --pack", "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json", "ci:build:docs": "api-extractor run", @@ -45,8 +43,8 @@ "test": "npm run test:mocha && npm run test:jest", "test:coverage": "c8 npm test", "test:jest": "jest", - "test:mocha": "mocha --recursive \"dist/test/mocha/**/*.spec.js\" --exit --project test/tsconfig.json", - "tsc": "tsc", + "test:mocha": "mocha --recursive \"dist/test/mocha/**/*.spec.?js\" --exit --project test/tsconfig.json", + "tsc": "tsc-multi --config ../../../common/build/build-common/tsc-multi.cjs.json", "typetests:gen": "fluid-type-test-generator", "typetests:prepare": "flub typetests --dir . --reset --previous --normalize" }, @@ -82,6 +80,7 @@ }, "devDependencies": { "@arethetypeswrong/cli": "^0.13.3", + "@fluid-internal/client-utils-previous": "npm:@fluid-internal/client-utils@2.0.0-internal.7.3.0", "@fluid-tools/build-cli": "^0.28.0", "@fluidframework/build-common": "^2.0.3", "@fluidframework/build-tools": "^0.28.0", @@ -112,21 +111,17 @@ "moment": "^2.21.0", "prettier": "~3.0.3", "puppeteer": "^17.1.3", + "renamer": "^4.0.0", "rewire": "^5.0.0", "rimraf": "^4.4.0", "sinon": "^7.4.2", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", + "tsc-multi": "^1.1.0", "typescript": "~5.1.6" }, "fluidBuild": { "tasks": { - "eslint": [ - "tsc", - "build:test:mocha", - "build:test:jest", - "build:test:types" - ], "build:docs": { "dependsOn": [ "...", @@ -134,20 +129,10 @@ "api-extractor:esnext" ], "script": false - }, - "build:test:jest": [ - "tsc" - ], - "build:test:mocha": [ - "tsc" - ], - "build:test:types": [ - "tsc" - ] + } } }, "typeValidation": { - "disabled": true, "broken": {} } } diff --git a/packages/common/client-utils/src/test/jest/gitHash.spec.ts b/packages/common/client-utils/src/test/jest/gitHash.spec.ts index e9b4677ee195..76c503dcdcfc 100644 --- a/packages/common/client-utils/src/test/jest/gitHash.spec.ts +++ b/packages/common/client-utils/src/test/jest/gitHash.spec.ts @@ -15,7 +15,7 @@ import rewire from "rewire"; import * as HashNode from "../../hashFileNode"; // Use rewire to access private functions -const HashBrowser = rewire("../../hashFileBrowser"); +const HashBrowser = rewire("../../hashFileBrowser.cjs"); async function getFileContents(p: string): Promise { return new Promise((resolve, reject) => { diff --git a/packages/common/client-utils/src/test/mocha/eventForwarder.spec.ts b/packages/common/client-utils/src/test/mocha/eventForwarder.spec.ts index 7169842446ee..0f24df851175 100644 --- a/packages/common/client-utils/src/test/mocha/eventForwarder.spec.ts +++ b/packages/common/client-utils/src/test/mocha/eventForwarder.spec.ts @@ -6,7 +6,7 @@ import { strict as assert } from "node:assert"; import { EventEmitter } from "node:events"; import { IErrorEvent } from "@fluidframework/core-interfaces"; -import { EventForwarder } from "../.."; +import { EventForwarder } from "../../eventForwarder"; interface ITestEvents extends IErrorEvent { (event: "testEvent", listener: (name: string, count: number) => void); diff --git a/packages/common/client-utils/src/test/mocha/typedEventEmitter.spec.ts b/packages/common/client-utils/src/test/mocha/typedEventEmitter.spec.ts index 1a5ec561d98b..e4f2dbf08093 100644 --- a/packages/common/client-utils/src/test/mocha/typedEventEmitter.spec.ts +++ b/packages/common/client-utils/src/test/mocha/typedEventEmitter.spec.ts @@ -4,7 +4,7 @@ */ import { strict as assert } from "node:assert"; import { IErrorEvent } from "@fluidframework/core-interfaces"; -import { TypedEventEmitter } from "../.."; +import { TypedEventEmitter } from "../../typedEventEmitter"; describe("TypedEventEmitter", () => { it("Validate Function proxies", () => { diff --git a/packages/common/client-utils/src/test/types/validateClientUtilsPrevious.generated.ts b/packages/common/client-utils/src/test/types/validateClientUtilsPrevious.generated.ts new file mode 100644 index 000000000000..cc3d71be71df --- /dev/null +++ b/packages/common/client-utils/src/test/types/validateClientUtilsPrevious.generated.ts @@ -0,0 +1,502 @@ +/*! + * Copyright (c) Microsoft Corporation and contributors. All rights reserved. + * Licensed under the MIT License. + */ +/* + * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + * Generated by fluid-type-test-generator in @fluidframework/build-tools. + */ +import type * as old from "@fluid-internal/client-utils-previous"; +import type * as current from "../../index"; + + +// See 'build-tools/src/type-test-generator/compatibility.ts' for more information. +type TypeOnly = T extends number + ? number + : T extends string + ? string + : T extends boolean | bigint | symbol + ? T + : { + [P in keyof T]: TypeOnly; + }; + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "ClassDeclaration_Buffer": {"forwardCompat": false} +*/ +declare function get_old_ClassDeclaration_Buffer(): + TypeOnly; +declare function use_current_ClassDeclaration_Buffer( + use: TypeOnly): void; +use_current_ClassDeclaration_Buffer( + get_old_ClassDeclaration_Buffer()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "ClassDeclaration_Buffer": {"backCompat": false} +*/ +declare function get_current_ClassDeclaration_Buffer(): + TypeOnly; +declare function use_old_ClassDeclaration_Buffer( + use: TypeOnly): void; +use_old_ClassDeclaration_Buffer( + get_current_ClassDeclaration_Buffer()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "TypeAliasDeclaration_EventEmitterEventType": {"forwardCompat": false} +*/ +declare function get_old_TypeAliasDeclaration_EventEmitterEventType(): + TypeOnly; +declare function use_current_TypeAliasDeclaration_EventEmitterEventType( + use: TypeOnly): void; +use_current_TypeAliasDeclaration_EventEmitterEventType( + get_old_TypeAliasDeclaration_EventEmitterEventType()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "TypeAliasDeclaration_EventEmitterEventType": {"backCompat": false} +*/ +declare function get_current_TypeAliasDeclaration_EventEmitterEventType(): + TypeOnly; +declare function use_old_TypeAliasDeclaration_EventEmitterEventType( + use: TypeOnly): void; +use_old_TypeAliasDeclaration_EventEmitterEventType( + get_current_TypeAliasDeclaration_EventEmitterEventType()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "ClassDeclaration_EventForwarder": {"forwardCompat": false} +*/ +declare function get_old_ClassDeclaration_EventForwarder(): + TypeOnly; +declare function use_current_ClassDeclaration_EventForwarder( + use: TypeOnly): void; +use_current_ClassDeclaration_EventForwarder( + get_old_ClassDeclaration_EventForwarder()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "ClassDeclaration_EventForwarder": {"backCompat": false} +*/ +declare function get_current_ClassDeclaration_EventForwarder(): + TypeOnly; +declare function use_old_ClassDeclaration_EventForwarder( + use: TypeOnly): void; +use_old_ClassDeclaration_EventForwarder( + get_current_ClassDeclaration_EventForwarder()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "InterfaceDeclaration_ITraceEvent": {"forwardCompat": false} +*/ +declare function get_old_InterfaceDeclaration_ITraceEvent(): + TypeOnly; +declare function use_current_InterfaceDeclaration_ITraceEvent( + use: TypeOnly): void; +use_current_InterfaceDeclaration_ITraceEvent( + get_old_InterfaceDeclaration_ITraceEvent()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "InterfaceDeclaration_ITraceEvent": {"backCompat": false} +*/ +declare function get_current_InterfaceDeclaration_ITraceEvent(): + TypeOnly; +declare function use_old_InterfaceDeclaration_ITraceEvent( + use: TypeOnly): void; +use_old_InterfaceDeclaration_ITraceEvent( + get_current_InterfaceDeclaration_ITraceEvent()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "VariableDeclaration_IsoBuffer": {"forwardCompat": false} +*/ +declare function get_old_VariableDeclaration_IsoBuffer(): + TypeOnly; +declare function use_current_VariableDeclaration_IsoBuffer( + use: TypeOnly): void; +use_current_VariableDeclaration_IsoBuffer( + get_old_VariableDeclaration_IsoBuffer()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "VariableDeclaration_IsoBuffer": {"backCompat": false} +*/ +declare function get_current_VariableDeclaration_IsoBuffer(): + TypeOnly; +declare function use_old_VariableDeclaration_IsoBuffer( + use: TypeOnly): void; +use_old_VariableDeclaration_IsoBuffer( + get_current_VariableDeclaration_IsoBuffer()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "TypeAliasDeclaration_IsoBuffer": {"forwardCompat": false} +*/ +declare function get_old_TypeAliasDeclaration_IsoBuffer(): + TypeOnly; +declare function use_current_TypeAliasDeclaration_IsoBuffer( + use: TypeOnly): void; +use_current_TypeAliasDeclaration_IsoBuffer( + get_old_TypeAliasDeclaration_IsoBuffer()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "TypeAliasDeclaration_IsoBuffer": {"backCompat": false} +*/ +declare function get_current_TypeAliasDeclaration_IsoBuffer(): + TypeOnly; +declare function use_old_TypeAliasDeclaration_IsoBuffer( + use: TypeOnly): void; +use_old_TypeAliasDeclaration_IsoBuffer( + get_current_TypeAliasDeclaration_IsoBuffer()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "TypeAliasDeclaration_IsomorphicPerformance": {"forwardCompat": false} +*/ +declare function get_old_TypeAliasDeclaration_IsomorphicPerformance(): + TypeOnly; +declare function use_current_TypeAliasDeclaration_IsomorphicPerformance( + use: TypeOnly): void; +use_current_TypeAliasDeclaration_IsomorphicPerformance( + get_old_TypeAliasDeclaration_IsomorphicPerformance()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "TypeAliasDeclaration_IsomorphicPerformance": {"backCompat": false} +*/ +declare function get_current_TypeAliasDeclaration_IsomorphicPerformance(): + TypeOnly; +declare function use_old_TypeAliasDeclaration_IsomorphicPerformance( + use: TypeOnly): void; +use_old_TypeAliasDeclaration_IsomorphicPerformance( + get_current_TypeAliasDeclaration_IsomorphicPerformance()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "ClassDeclaration_Trace": {"forwardCompat": false} +*/ +declare function get_old_ClassDeclaration_Trace(): + TypeOnly; +declare function use_current_ClassDeclaration_Trace( + use: TypeOnly): void; +use_current_ClassDeclaration_Trace( + get_old_ClassDeclaration_Trace()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "ClassDeclaration_Trace": {"backCompat": false} +*/ +declare function get_current_ClassDeclaration_Trace(): + TypeOnly; +declare function use_old_ClassDeclaration_Trace( + use: TypeOnly): void; +use_old_ClassDeclaration_Trace( + get_current_ClassDeclaration_Trace()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "ClassDeclaration_TypedEventEmitter": {"forwardCompat": false} +*/ +declare function get_old_ClassDeclaration_TypedEventEmitter(): + TypeOnly>; +declare function use_current_ClassDeclaration_TypedEventEmitter( + use: TypeOnly>): void; +use_current_ClassDeclaration_TypedEventEmitter( + get_old_ClassDeclaration_TypedEventEmitter()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "ClassDeclaration_TypedEventEmitter": {"backCompat": false} +*/ +declare function get_current_ClassDeclaration_TypedEventEmitter(): + TypeOnly>; +declare function use_old_ClassDeclaration_TypedEventEmitter( + use: TypeOnly>): void; +use_old_ClassDeclaration_TypedEventEmitter( + get_current_ClassDeclaration_TypedEventEmitter()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "TypeAliasDeclaration_TypedEventTransform": {"forwardCompat": false} +*/ +declare function get_old_TypeAliasDeclaration_TypedEventTransform(): + TypeOnly>; +declare function use_current_TypeAliasDeclaration_TypedEventTransform( + use: TypeOnly>): void; +use_current_TypeAliasDeclaration_TypedEventTransform( + get_old_TypeAliasDeclaration_TypedEventTransform()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "TypeAliasDeclaration_TypedEventTransform": {"backCompat": false} +*/ +declare function get_current_TypeAliasDeclaration_TypedEventTransform(): + TypeOnly>; +declare function use_old_TypeAliasDeclaration_TypedEventTransform( + use: TypeOnly>): void; +use_old_TypeAliasDeclaration_TypedEventTransform( + get_current_TypeAliasDeclaration_TypedEventTransform()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "FunctionDeclaration_Uint8ArrayToArrayBuffer": {"forwardCompat": false} +*/ +declare function get_old_FunctionDeclaration_Uint8ArrayToArrayBuffer(): + TypeOnly; +declare function use_current_FunctionDeclaration_Uint8ArrayToArrayBuffer( + use: TypeOnly): void; +use_current_FunctionDeclaration_Uint8ArrayToArrayBuffer( + get_old_FunctionDeclaration_Uint8ArrayToArrayBuffer()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "FunctionDeclaration_Uint8ArrayToArrayBuffer": {"backCompat": false} +*/ +declare function get_current_FunctionDeclaration_Uint8ArrayToArrayBuffer(): + TypeOnly; +declare function use_old_FunctionDeclaration_Uint8ArrayToArrayBuffer( + use: TypeOnly): void; +use_old_FunctionDeclaration_Uint8ArrayToArrayBuffer( + get_current_FunctionDeclaration_Uint8ArrayToArrayBuffer()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "FunctionDeclaration_Uint8ArrayToString": {"forwardCompat": false} +*/ +declare function get_old_FunctionDeclaration_Uint8ArrayToString(): + TypeOnly; +declare function use_current_FunctionDeclaration_Uint8ArrayToString( + use: TypeOnly): void; +use_current_FunctionDeclaration_Uint8ArrayToString( + get_old_FunctionDeclaration_Uint8ArrayToString()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "FunctionDeclaration_Uint8ArrayToString": {"backCompat": false} +*/ +declare function get_current_FunctionDeclaration_Uint8ArrayToString(): + TypeOnly; +declare function use_old_FunctionDeclaration_Uint8ArrayToString( + use: TypeOnly): void; +use_old_FunctionDeclaration_Uint8ArrayToString( + get_current_FunctionDeclaration_Uint8ArrayToString()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "VariableDeclaration_bufferToString": {"forwardCompat": false} +*/ +declare function get_old_VariableDeclaration_bufferToString(): + TypeOnly; +declare function use_current_VariableDeclaration_bufferToString( + use: TypeOnly): void; +use_current_VariableDeclaration_bufferToString( + get_old_VariableDeclaration_bufferToString()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "VariableDeclaration_bufferToString": {"backCompat": false} +*/ +declare function get_current_VariableDeclaration_bufferToString(): + TypeOnly; +declare function use_old_VariableDeclaration_bufferToString( + use: TypeOnly): void; +use_old_VariableDeclaration_bufferToString( + get_current_VariableDeclaration_bufferToString()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "VariableDeclaration_fromBase64ToUtf8": {"forwardCompat": false} +*/ +declare function get_old_VariableDeclaration_fromBase64ToUtf8(): + TypeOnly; +declare function use_current_VariableDeclaration_fromBase64ToUtf8( + use: TypeOnly): void; +use_current_VariableDeclaration_fromBase64ToUtf8( + get_old_VariableDeclaration_fromBase64ToUtf8()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "VariableDeclaration_fromBase64ToUtf8": {"backCompat": false} +*/ +declare function get_current_VariableDeclaration_fromBase64ToUtf8(): + TypeOnly; +declare function use_old_VariableDeclaration_fromBase64ToUtf8( + use: TypeOnly): void; +use_old_VariableDeclaration_fromBase64ToUtf8( + get_current_VariableDeclaration_fromBase64ToUtf8()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "VariableDeclaration_fromUtf8ToBase64": {"forwardCompat": false} +*/ +declare function get_old_VariableDeclaration_fromUtf8ToBase64(): + TypeOnly; +declare function use_current_VariableDeclaration_fromUtf8ToBase64( + use: TypeOnly): void; +use_current_VariableDeclaration_fromUtf8ToBase64( + get_old_VariableDeclaration_fromUtf8ToBase64()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "VariableDeclaration_fromUtf8ToBase64": {"backCompat": false} +*/ +declare function get_current_VariableDeclaration_fromUtf8ToBase64(): + TypeOnly; +declare function use_old_VariableDeclaration_fromUtf8ToBase64( + use: TypeOnly): void; +use_old_VariableDeclaration_fromUtf8ToBase64( + get_current_VariableDeclaration_fromUtf8ToBase64()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "FunctionDeclaration_gitHashFile": {"forwardCompat": false} +*/ +declare function get_old_FunctionDeclaration_gitHashFile(): + TypeOnly; +declare function use_current_FunctionDeclaration_gitHashFile( + use: TypeOnly): void; +use_current_FunctionDeclaration_gitHashFile( + get_old_FunctionDeclaration_gitHashFile()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "FunctionDeclaration_gitHashFile": {"backCompat": false} +*/ +declare function get_current_FunctionDeclaration_gitHashFile(): + TypeOnly; +declare function use_old_FunctionDeclaration_gitHashFile( + use: TypeOnly): void; +use_old_FunctionDeclaration_gitHashFile( + get_current_FunctionDeclaration_gitHashFile()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "FunctionDeclaration_hashFile": {"forwardCompat": false} +*/ +declare function get_old_FunctionDeclaration_hashFile(): + TypeOnly; +declare function use_current_FunctionDeclaration_hashFile( + use: TypeOnly): void; +use_current_FunctionDeclaration_hashFile( + get_old_FunctionDeclaration_hashFile()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "FunctionDeclaration_hashFile": {"backCompat": false} +*/ +declare function get_current_FunctionDeclaration_hashFile(): + TypeOnly; +declare function use_old_FunctionDeclaration_hashFile( + use: TypeOnly): void; +use_old_FunctionDeclaration_hashFile( + get_current_FunctionDeclaration_hashFile()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "VariableDeclaration_performance": {"forwardCompat": false} +*/ +declare function get_old_VariableDeclaration_performance(): + TypeOnly; +declare function use_current_VariableDeclaration_performance( + use: TypeOnly): void; +use_current_VariableDeclaration_performance( + get_old_VariableDeclaration_performance()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "VariableDeclaration_performance": {"backCompat": false} +*/ +declare function get_current_VariableDeclaration_performance(): + TypeOnly; +declare function use_old_VariableDeclaration_performance( + use: TypeOnly): void; +use_old_VariableDeclaration_performance( + get_current_VariableDeclaration_performance()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "FunctionDeclaration_stringToBuffer": {"forwardCompat": false} +*/ +declare function get_old_FunctionDeclaration_stringToBuffer(): + TypeOnly; +declare function use_current_FunctionDeclaration_stringToBuffer( + use: TypeOnly): void; +use_current_FunctionDeclaration_stringToBuffer( + get_old_FunctionDeclaration_stringToBuffer()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "FunctionDeclaration_stringToBuffer": {"backCompat": false} +*/ +declare function get_current_FunctionDeclaration_stringToBuffer(): + TypeOnly; +declare function use_old_FunctionDeclaration_stringToBuffer( + use: TypeOnly): void; +use_old_FunctionDeclaration_stringToBuffer( + get_current_FunctionDeclaration_stringToBuffer()); + +/* +* Validate forward compat by using old type in place of current type +* If breaking change required, add in package.json under typeValidation.broken: +* "VariableDeclaration_toUtf8": {"forwardCompat": false} +*/ +declare function get_old_VariableDeclaration_toUtf8(): + TypeOnly; +declare function use_current_VariableDeclaration_toUtf8( + use: TypeOnly): void; +use_current_VariableDeclaration_toUtf8( + get_old_VariableDeclaration_toUtf8()); + +/* +* Validate back compat by using current type in place of old type +* If breaking change required, add in package.json under typeValidation.broken: +* "VariableDeclaration_toUtf8": {"backCompat": false} +*/ +declare function get_current_VariableDeclaration_toUtf8(): + TypeOnly; +declare function use_old_VariableDeclaration_toUtf8( + use: TypeOnly): void; +use_old_VariableDeclaration_toUtf8( + get_current_VariableDeclaration_toUtf8()); diff --git a/packages/common/client-utils/tsc-multi.test.json b/packages/common/client-utils/tsc-multi.test.json new file mode 100644 index 000000000000..ea43dadf7600 --- /dev/null +++ b/packages/common/client-utils/tsc-multi.test.json @@ -0,0 +1,4 @@ +{ + "targets": [{ "extname": ".cjs", "module": "CommonJS", "moduleResolution": "Node16" }], + "projects": ["./tsconfig.json", "./src/test/jest/tsconfig.json", "./src/test/mocha/tsconfig.json"] +} diff --git a/packages/common/client-utils/tsconfig.esnext.json b/packages/common/client-utils/tsconfig.esnext.json deleted file mode 100644 index 3c2dddb86236..000000000000 --- a/packages/common/client-utils/tsconfig.esnext.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["./tsconfig.json", "../../../common/build/build-common/tsconfig.esm.json"], - "compilerOptions": { - "outDir": "./lib", - }, -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 69e2e81fd65d..2f97c9de9473 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5997,6 +5997,7 @@ importers: packages/common/client-utils: specifiers: '@arethetypeswrong/cli': ^0.13.3 + '@fluid-internal/client-utils-previous': npm:@fluid-internal/client-utils@2.0.0-internal.7.3.0 '@fluid-tools/build-cli': ^0.28.0 '@fluidframework/build-common': ^2.0.3 '@fluidframework/build-tools': ^0.28.0 @@ -6034,12 +6035,14 @@ importers: moment: ^2.21.0 prettier: ~3.0.3 puppeteer: ^17.1.3 + renamer: ^4.0.0 rewire: ^5.0.0 rimraf: ^4.4.0 sha.js: ^2.4.11 sinon: ^7.4.2 ts-jest: ^29.1.1 ts-node: ^10.9.1 + tsc-multi: ^1.1.0 typescript: ~5.1.6 dependencies: '@fluidframework/core-interfaces': link:../core-interfaces @@ -6052,6 +6055,7 @@ importers: sha.js: 2.4.11 devDependencies: '@arethetypeswrong/cli': 0.13.3 + '@fluid-internal/client-utils-previous': /@fluid-internal/client-utils/2.0.0-internal.7.3.0 '@fluid-tools/build-cli': 0.28.0_mhw3tufvtaceew37hrkkevjcli '@fluidframework/build-common': 2.0.3 '@fluidframework/build-tools': 0.28.0_@types+node@18.19.1 @@ -6082,11 +6086,13 @@ importers: moment: 2.29.4 prettier: 3.0.3 puppeteer: 17.1.3 + renamer: 4.0.0 rewire: 5.0.0 rimraf: 4.4.1 sinon: 7.5.0 ts-jest: 29.1.1_7c6s2cwl7nw46fjeerv4uupgbm ts-node: 10.9.1_ggysxzqxruqvydtrq6zb2nxvwm + tsc-multi: 1.1.0_44oayjl3iesbankmh6w6z32iii_typescript@5.1.6 typescript: 5.1.6 packages/common/container-definitions: @@ -15663,6 +15669,19 @@ packages: sha.js: 2.4.11 dev: true + /@fluid-internal/client-utils/2.0.0-internal.7.3.0: + resolution: {integrity: sha512-q+lf7BTbBYvtLfg0AJXvnn4+pdtYt/R44fkD+Srs9s2PenieOM5LEAeIABS0xG99d6ys8K54P4xvqpkctupYqg==} + dependencies: + '@fluidframework/core-interfaces': 2.0.0-internal.7.3.0 + '@fluidframework/core-utils': 2.0.0-internal.7.3.0 + '@types/events': 3.0.3 + base64-js: 1.5.1 + buffer: 6.0.3 + events: 3.3.0 + lodash: 4.17.21 + sha.js: 2.4.11 + dev: true + /@fluid-tools/benchmark/0.47.0: resolution: {integrity: sha512-lQ2ijhUJ68aOHqH1UxOBmAsSWfx2dIuI4vAlQ4e/ueh0a8KUZ8D8AUpJPu1k1pwuTlOuvb629BY9Q4HC6H/KBQ==} dependencies: @@ -16544,10 +16563,18 @@ packages: resolution: {integrity: sha512-RaI37klIYxUpCH5PHeIzkUjxXbA0Omytb22bzc6zoosXzwCDQ4EikFQ02qKqVZpl4wIC6Fw+B6uKIgaR7xNdCg==} dev: true + /@fluidframework/core-interfaces/2.0.0-internal.7.3.0: + resolution: {integrity: sha512-pPDhVlcr4Wm340TCgIkGV+QduKRcrYU44mdaEhBaRaubYrf742kjrpaqrT7JvQCP1KVSH9whRo4/WexANuu3BQ==} + dev: true + /@fluidframework/core-utils/2.0.0-internal.7.2.2: resolution: {integrity: sha512-UYRRyFDmq1KZXoeSxYIu5ra82XoeLT9S0Y/1HzLu9UnVz813TzgI2gvW+BG7yXC+E9lNIy7CWoSrD7itjjNAWQ==} dev: true + /@fluidframework/core-utils/2.0.0-internal.7.3.0: + resolution: {integrity: sha512-5yrf+YIWHMzyeZL4UI4w6j4Xrju3QKzbiIWj6H3+QsckrrRQdVzP7reSnj6sp3F59KmClajcJi4CAp4lU5Kx+g==} + dev: true + /@fluidframework/counter/2.0.0-internal.7.2.0: resolution: {integrity: sha512-QFjtHBAdwPR2eHRVoo7X8nncHdq4y6ZIX0LlEnvtA8WCoGDOALoK5KF40+B3fZ84q8NyDWtcXoU6SJSh/Q/ztA==} dependencies: