Updated generated files
MODIFY
packages/@romejs/core/server/fs/runtime-modules.ts
packages/@romejs/core/server/fs/runtime-modules.ts
@@ -14,19 +14,19 @@ modules.set(
new Map([
[
"index.ts",
- '/**\r\n * Copyright (c) Facebook, Inc. and its affiliates.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n */\r\n\r\nexport {TestHelper, test, testOptions} from "./test";\r\n',
+ '/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport {TestHelper, test, testOptions} from "./test";\n',
],
[
"package.json",
- '{\r\n "name": "@romejs-runtime/rome",\r\n "type": "module",\r\n "private": true,\r\n "main": "index.ts"\r\n}\r\n',
+ '{\n "name": "@romejs-runtime/rome",\n "type": "module",\n "private": true,\n "main": "index.ts"\n}\n',
],
[
"test.ts",
- '/**\r\n * Copyright (c) Facebook, Inc. and its affiliates.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n */\r\n\r\nimport {JSONPropertyValue} from "./types";\r\n\r\nexport type AsyncFunc = () => void | undefined | Promise<void>;\r\n\r\nexport type SyncThrower = () => void;\r\n\r\nexport type ExpectedError = undefined | string | RegExp | Function;\r\n\r\nexport type TestSnapshotOptions = {\r\n\tfilename?: string;\r\n\tlanguage?: string;\r\n};\r\n\r\n// These diagnostics are subsets of the official diagnostics\r\n// We can potentially normalize these and ensure backwards compatibility with the official diagnostics\r\n\r\nexport type TestDiagnosticLogCategory = "none" | "info" | "warn" | "error";\r\n\r\nexport type TestDiagnosticAdviceInspect = {\r\n\ttype: "inspect";\r\n\tdata: JSONPropertyValue;\r\n};\r\n\r\nexport type TestDiagnosticAdviceList = {\r\n\ttype: "list";\r\n\tlist: Array<string>;\r\n};\r\n\r\nexport type TestDiagnosticAdviceCode = {\r\n\ttype: "code";\r\n\tcode: string;\r\n};\r\n\r\nexport type TestDiagnosticAdviceLog = {\r\n\ttype: "log";\r\n\tcategory: TestDiagnosticLogCategory;\r\n\ttext: string;\r\n};\r\n\r\nexport type TestDiagnosticAdviceItem =\r\n\t| TestDiagnosticAdviceInspect\r\n\t| TestDiagnosticAdviceCode\r\n\t| TestDiagnosticAdviceLog\r\n\t| TestDiagnosticAdviceList;\r\n\r\nexport interface TestHelper {\r\n\taddToAdvice(item: TestDiagnosticAdviceItem): void;\r\n\tclearAdvice(): void;\r\n\tonTeardown(callback: AsyncFunc): void;\r\n\tclearTimeout(): void;\r\n\textendTimeout(time: number): void;\r\n\tsetTimeout(time: number): void;\r\n\tcheckTimeout(): void;\r\n\ttruthy(value: unknown, message?: string): void;\r\n\tfalsy(value: unknown, message?: string): void;\r\n\ttrue(value: unknown, message?: string): void;\r\n\tfalse(value: unknown, message?: string): void;\r\n\tis(received: unknown, expected: unknown, message?: string): void;\r\n\tnot(received: unknown, expected: unknown, message?: string): void;\r\n\tlooksLike(received: unknown, expected: unknown, message?: string): void;\r\n\tnotLooksLike(received: unknown, expected: unknown, message?: string): void;\r\n\tthrows(\r\n\t\tthrower: SyncThrower,\r\n\t\texpected?: ExpectedError,\r\n\t\tmessage?: string,\r\n\t): void;\r\n\tthrowsAsync(\r\n\t\tthrower: AsyncFunc,\r\n\t\texpected?: ExpectedError,\r\n\t\tmessage?: string,\r\n\t): Promise<void>;\r\n\tnotThrows(nonThrower: SyncThrower, message?: string): void;\r\n\tnotThrowsAsync(nonThrower: AsyncFunc, message?: string): Promise<void>;\r\n\tregex(contents: string, regex: RegExp, message?: string): void;\r\n\tnotRegex(contents: string, regex: RegExp, message?: string): void;\r\n\tsnapshot(\r\n\t\texpected: unknown,\r\n\t\tmessage?: string,\r\n\t\topts?: TestSnapshotOptions,\r\n\t): string;\r\n\tinlineSnapshot(received: unknown, expected?: string | boolean | number): void;\r\n\tnamedSnapshot(\r\n\t\tname: string,\r\n\t\texpected: unknown,\r\n\t\tmessage?: string,\r\n\t\topts?: TestSnapshotOptions,\r\n\t): string;\r\n}\r\n\r\nexport type TestName = string | Array<string>;\r\n\r\ndeclare const __ROME__TEST_OPTIONS__: GlobalTestOptions;\r\n\r\nexport type GlobalTestOptions =\r\n\t| undefined\r\n\t| {\r\n\t\t\tdirname?: string;\r\n\t\t\tregister?: (err: Error, opts: TestOptions, callback: TestCallback) => void;\r\n\t\t};\r\n\r\ntype NamelessTestOptions = {\r\n\ttimeout?: number;\r\n\tonly?: boolean;\r\n};\r\n\r\nexport type TestCallback = (t: TestHelper) => void | undefined | Promise<void>;\r\n\r\nexport type TestOptions = NamelessTestOptions & {\r\n\tname: TestName;\r\n};\r\n\r\ntype TestArg = TestName | NamelessTestOptions | TestCallback | undefined;\r\n\r\nexport const testOptions: NonNullable<GlobalTestOptions> =\r\n\t__ROME__TEST_OPTIONS__ === undefined ? {} : __ROME__TEST_OPTIONS__;\r\n\r\nfunction registerTest(\r\n\tcallsiteError: Error,\r\n\topts: TestOptions,\r\n\tcallback: TestCallback,\r\n) {\r\n\tconst register = testOptions.register;\r\n\r\n\tif (typeof register !== "function") {\r\n\t\tthrow new Error("Test harness does not exist");\r\n\t}\r\n\r\n\tregister(callsiteError, opts, callback);\r\n}\r\n\r\nfunction isOptionsObject(arg: TestArg): arg is NamelessTestOptions {\r\n\treturn typeof arg === "object" && arg != null && !Array.isArray(arg);\r\n}\r\n\r\nfunction splitArgs(\r\n\targs: TestRegisterFunctionArgs,\r\n): {\r\n\toptions: TestOptions;\r\n\tcallback: TestCallback;\r\n} {\r\n\tconst name = args.shift();\r\n\tif (typeof name !== "string" && !Array.isArray(name)) {\r\n\t\tthrow new Error("Expected test name to be a string or an array of strings");\r\n\t}\r\n\r\n\tconst callback = args.pop();\r\n\tif (typeof callback !== "function") {\r\n\t\tthrow new Error("Expected options callback");\r\n\t}\r\n\r\n\tconst options = args.pop();\r\n\tif (options !== undefined && !isOptionsObject(options)) {\r\n\t\tthrow new Error("Expected options object");\r\n\t}\r\n\r\n\tif (args.length > 0) {\r\n\t\tthrow new Error("Expected to have exhausted test register arguments");\r\n\t}\r\n\r\n\treturn {\r\n\t\toptions: {\r\n\t\t\t...options,\r\n\t\t\tname,\r\n\t\t},\r\n\t\tcallback,\r\n\t};\r\n}\r\n\r\ntype TestRegisterFunctionArgs =\r\n\t| [TestName, TestCallback]\r\n\t| [TestName, NamelessTestOptions, TestCallback];\r\n\r\ntype TestRegisterFunction = (...args: TestRegisterFunctionArgs) => void;\r\n\r\nexport const test: TestRegisterFunction & {\r\n\tonly: TestRegisterFunction;\r\n} = function(...args: TestRegisterFunctionArgs) {\r\n\tconst {options, callback} = splitArgs(args);\r\n\tregisterTest(new Error(), options, callback);\r\n};\r\n\r\ntest.only = function(...args: TestRegisterFunctionArgs) {\r\n\tconst {options, callback} = splitArgs(args);\r\n\tregisterTest(\r\n\t\tnew Error(),\r\n\t\t{\r\n\t\t\t...options,\r\n\t\t\tonly: true,\r\n\t\t},\r\n\t\tcallback,\r\n\t);\r\n};\r\n',
+ '/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {JSONPropertyValue} from "./types";\n\nexport type AsyncFunc = () => void | undefined | Promise<void>;\n\nexport type SyncThrower = () => void;\n\nexport type ExpectedError = undefined | string | RegExp | Function;\n\nexport type TestSnapshotOptions = {\n\tfilename?: string;\n\tlanguage?: string;\n};\n\n// These diagnostics are subsets of the official diagnostics\n// We can potentially normalize these and ensure backwards compatibility with the official diagnostics\n\nexport type TestDiagnosticLogCategory = "none" | "info" | "warn" | "error";\n\nexport type TestDiagnosticAdviceInspect = {\n\ttype: "inspect";\n\tdata: JSONPropertyValue;\n};\n\nexport type TestDiagnosticAdviceList = {\n\ttype: "list";\n\tlist: Array<string>;\n};\n\nexport type TestDiagnosticAdviceCode = {\n\ttype: "code";\n\tcode: string;\n};\n\nexport type TestDiagnosticAdviceLog = {\n\ttype: "log";\n\tcategory: TestDiagnosticLogCategory;\n\ttext: string;\n};\n\nexport type TestDiagnosticAdviceItem =\n\t| TestDiagnosticAdviceInspect\n\t| TestDiagnosticAdviceCode\n\t| TestDiagnosticAdviceLog\n\t| TestDiagnosticAdviceList;\n\nexport interface TestHelper {\n\taddToAdvice(item: TestDiagnosticAdviceItem): void;\n\tclearAdvice(): void;\n\tonTeardown(callback: AsyncFunc): void;\n\tclearTimeout(): void;\n\textendTimeout(time: number): void;\n\tsetTimeout(time: number): void;\n\tcheckTimeout(): void;\n\ttruthy(value: unknown, message?: string): void;\n\tfalsy(value: unknown, message?: string): void;\n\ttrue(value: unknown, message?: string): void;\n\tfalse(value: unknown, message?: string): void;\n\tis(received: unknown, expected: unknown, message?: string): void;\n\tnot(received: unknown, expected: unknown, message?: string): void;\n\tlooksLike(received: unknown, expected: unknown, message?: string): void;\n\tnotLooksLike(received: unknown, expected: unknown, message?: string): void;\n\tthrows(\n\t\tthrower: SyncThrower,\n\t\texpected?: ExpectedError,\n\t\tmessage?: string,\n\t): void;\n\tthrowsAsync(\n\t\tthrower: AsyncFunc,\n\t\texpected?: ExpectedError,\n\t\tmessage?: string,\n\t): Promise<void>;\n\tnotThrows(nonThrower: SyncThrower, message?: string): void;\n\tnotThrowsAsync(nonThrower: AsyncFunc, message?: string): Promise<void>;\n\tregex(contents: string, regex: RegExp, message?: string): void;\n\tnotRegex(contents: string, regex: RegExp, message?: string): void;\n\tsnapshot(\n\t\texpected: unknown,\n\t\tmessage?: string,\n\t\topts?: TestSnapshotOptions,\n\t): string;\n\tinlineSnapshot(received: unknown, expected?: string | boolean | number): void;\n\tnamedSnapshot(\n\t\tname: string,\n\t\texpected: unknown,\n\t\tmessage?: string,\n\t\topts?: TestSnapshotOptions,\n\t): string;\n}\n\nexport type TestName = string | Array<string>;\n\ndeclare const __ROME__TEST_OPTIONS__: GlobalTestOptions;\n\nexport type GlobalTestOptions =\n\t| undefined\n\t| {\n\t\t\tdirname?: string;\n\t\t\tregister?: (err: Error, opts: TestOptions, callback: TestCallback) => void;\n\t\t};\n\ntype NamelessTestOptions = {\n\ttimeout?: number;\n\tonly?: boolean;\n};\n\nexport type TestCallback = (t: TestHelper) => void | undefined | Promise<void>;\n\nexport type TestOptions = NamelessTestOptions & {\n\tname: TestName;\n};\n\ntype TestArg = TestName | NamelessTestOptions | TestCallback | undefined;\n\nexport const testOptions: NonNullable<GlobalTestOptions> =\n\t__ROME__TEST_OPTIONS__ === undefined ? {} : __ROME__TEST_OPTIONS__;\n\nfunction registerTest(\n\tcallsiteError: Error,\n\topts: TestOptions,\n\tcallback: TestCallback,\n) {\n\tconst register = testOptions.register;\n\n\tif (typeof register !== "function") {\n\t\tthrow new Error("Test harness does not exist");\n\t}\n\n\tregister(callsiteError, opts, callback);\n}\n\nfunction isOptionsObject(arg: TestArg): arg is NamelessTestOptions {\n\treturn typeof arg === "object" && arg != null && !Array.isArray(arg);\n}\n\nfunction splitArgs(\n\targs: TestRegisterFunctionArgs,\n): {\n\toptions: TestOptions;\n\tcallback: TestCallback;\n} {\n\tconst name = args.shift();\n\tif (typeof name !== "string" && !Array.isArray(name)) {\n\t\tthrow new Error("Expected test name to be a string or an array of strings");\n\t}\n\n\tconst callback = args.pop();\n\tif (typeof callback !== "function") {\n\t\tthrow new Error("Expected options callback");\n\t}\n\n\tconst options = args.pop();\n\tif (options !== undefined && !isOptionsObject(options)) {\n\t\tthrow new Error("Expected options object");\n\t}\n\n\tif (args.length > 0) {\n\t\tthrow new Error("Expected to have exhausted test register arguments");\n\t}\n\n\treturn {\n\t\toptions: {\n\t\t\t...options,\n\t\t\tname,\n\t\t},\n\t\tcallback,\n\t};\n}\n\ntype TestRegisterFunctionArgs =\n\t| [TestName, TestCallback]\n\t| [TestName, NamelessTestOptions, TestCallback];\n\ntype TestRegisterFunction = (...args: TestRegisterFunctionArgs) => void;\n\nexport const test: TestRegisterFunction & {\n\tonly: TestRegisterFunction;\n} = function(...args: TestRegisterFunctionArgs) {\n\tconst {options, callback} = splitArgs(args);\n\tregisterTest(new Error(), options, callback);\n};\n\ntest.only = function(...args: TestRegisterFunctionArgs) {\n\tconst {options, callback} = splitArgs(args);\n\tregisterTest(\n\t\tnew Error(),\n\t\t{\n\t\t\t...options,\n\t\t\tonly: true,\n\t\t},\n\t\tcallback,\n\t);\n};\n',
],
[
"types.ts",
- "/**\r\n * Copyright (c) Facebook, Inc. and its affiliates.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n */\r\n\r\n// These are copied from packages/@romejs/codec-json/types.ts\r\nexport type JSONValue =\r\n\t| null\r\n\t| string\r\n\t| number\r\n\t| boolean\r\n\t| JSONObject\r\n\t| JSONArray;\r\n\r\nexport type JSONPropertyValue = undefined | void | JSONValue;\r\n\r\nexport type JSONObject = {\r\n\t[x: string]: JSONPropertyValue;\r\n};\r\n\r\nexport type JSONArray = Array<JSONValue>;\r\n",
+ "/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n// These are copied from packages/@romejs/codec-json/types.ts\nexport type JSONValue =\n\t| null\n\t| string\n\t| number\n\t| boolean\n\t| JSONObject\n\t| JSONArray;\n\nexport type JSONPropertyValue = undefined | void | JSONValue;\n\nexport type JSONObject = {\n\t[x: string]: JSONPropertyValue;\n};\n\nexport type JSONArray = Array<JSONValue>;\n",
],
]),
);

Updated generated files