@fluidframework/tool-utils 0.54.0-47413 → 0.55.0-48551

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.
package/.eslintrc.js CHANGED
@@ -5,12 +5,24 @@
5
5
 
6
6
  module.exports = {
7
7
  "extends": [
8
- "@fluidframework/eslint-config-fluid/eslint7"
8
+ "@fluidframework/eslint-config-fluid"
9
9
  ],
10
10
  "parserOptions": {
11
11
  "project": ["./tsconfig.json", "./src/test/tsconfig.json"]
12
12
  },
13
13
  "rules": {
14
- "@typescript-eslint/strict-boolean-expressions": "off"
14
+ "@typescript-eslint/strict-boolean-expressions": "off",
15
+ "unicorn/filename-case": [
16
+ "error",
17
+ {
18
+ "cases": {
19
+ "camelCase": true,
20
+ "pascalCase": true
21
+ },
22
+ "ignore": [
23
+ /.*fluidToolRC\.ts$/,
24
+ ]
25
+ }
26
+ ],
15
27
  }
16
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fluidToolRC.d.ts","sourceRoot":"","sources":["../src/fluidToolRC.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,MAAM,WAAW,WAAW,CAAC,IAAI,EAAE,MAAM;IACrC,GAAG,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC5C,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CACnD;AAED,MAAM,WAAW,UAAU;IACvB,MAAM,CAAC,EAAE;QACL,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE;YACF,CAAC,GAAG,EAAE,MAAM,GAAG;gBACX,OAAO,CAAC,EAAE,WAAW,CAAC;gBACtB,IAAI,CAAC,EAAE,WAAW,CAAA;aACrB,CAAA;SACJ,CAAA;KACJ,CAAA;CACJ;AAID,wBAAsB,MAAM,IAAI,OAAO,CAAC,UAAU,CAAC,CAclD;AAED,wBAAsB,MAAM,CAAC,EAAE,EAAE,UAAU,iBAI1C;AAGD,wBAAsB,MAAM,iBAS3B"}
1
+ {"version":3,"file":"fluidToolRC.d.ts","sourceRoot":"","sources":["../src/fluidToolRC.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,MAAM,WAAW,WAAW,CAAC,IAAI,EAAE,MAAM;IACrC,GAAG,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC5C,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CACnD;AAED,MAAM,WAAW,UAAU;IACvB,MAAM,CAAC,EAAE;QACL,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE;YACF,CAAC,GAAG,EAAE,MAAM,GAAG;gBACX,OAAO,CAAC,EAAE,WAAW,CAAC;gBACtB,IAAI,CAAC,EAAE,WAAW,CAAA;aACrB,CAAA;SACJ,CAAA;KACJ,CAAA;CACJ;AAID,wBAAsB,MAAM,IAAI,OAAO,CAAC,UAAU,CAAC,CAclD;AAED,wBAAsB,MAAM,CAAC,EAAE,EAAE,UAAU,iBAI1C;AAED,wBAAsB,MAAM,iBAS3B"}
@@ -8,7 +8,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
8
8
  };
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.lockRC = exports.saveRC = exports.loadRC = void 0;
11
- /* eslint-disable unicorn/filename-case */
12
11
  const fs_1 = __importDefault(require("fs"));
13
12
  const os_1 = __importDefault(require("os"));
14
13
  const path_1 = __importDefault(require("path"));
@@ -38,7 +37,6 @@ async function saveRC(rc) {
38
37
  return writeFile(getRCFileName(), Buffer.from(content, "utf8"));
39
38
  }
40
39
  exports.saveRC = saveRC;
41
- // eslint-disable-next-line prefer-arrow/prefer-arrow-functions
42
40
  async function lockRC() {
43
41
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
44
42
  return proper_lockfile_1.lock(getRCFileName(), {
@@ -1 +1 @@
1
- {"version":3,"file":"fluidToolRC.js","sourceRoot":"","sources":["../src/fluidToolRC.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,0CAA0C;AAE1C,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AACxB,qDAAuC;AAqBvC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,CAAC;AAE7D,KAAK,UAAU,MAAM;IACxB,MAAM,QAAQ,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,aAAa,EAAE,CAAC;IACjC,IAAI,MAAM,MAAM,CAAC,QAAQ,CAAC,EAAE;QACxB,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACrC,IAAI;YACA,+DAA+D;YAC/D,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;SAC3C;QAAC,OAAO,CAAC,EAAE;YACR,UAAU;SACb;KACJ;IACD,OAAO,EAAE,CAAC;AACd,CAAC;AAdD,wBAcC;AAEM,KAAK,UAAU,MAAM,CAAC,EAAc;IACvC,MAAM,SAAS,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;IACjD,OAAO,SAAS,CAAC,aAAa,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AACpE,CAAC;AAJD,wBAIC;AAED,+DAA+D;AACxD,KAAK,UAAU,MAAM;IACxB,+DAA+D;IAC/D,OAAO,sBAAI,CAAC,aAAa,EAAE,EAAE;QACzB,OAAO,EAAE;YACL,OAAO,EAAE,IAAI;SAChB;QACD,KAAK,EAAC,KAAK;QACX,QAAQ,EAAE,KAAK;KAClB,CAAC,CAAC;AACP,CAAC;AATD,wBASC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable unicorn/filename-case */\n\nimport fs from \"fs\";\nimport os from \"os\";\nimport path from \"path\";\nimport util from \"util\";\nimport { lock } from \"proper-lockfile\";\nimport { IOdspTokens } from \"@fluidframework/odsp-doclib-utils\";\n\nexport interface IAsyncCache<TKey, TValue> {\n get(key: TKey): Promise<TValue | undefined>;\n save(key: TKey, value: TValue): Promise<void>;\n lock<T>(callback: () => Promise<T>): Promise<T>;\n}\n\nexport interface IResources {\n tokens?: {\n version?: number;\n data: {\n [key: string]: {\n storage?: IOdspTokens,\n push?: IOdspTokens\n }\n }\n }\n}\n\nconst getRCFileName = () => path.join(os.homedir(), \".fluidtoolrc\");\n\nexport async function loadRC(): Promise<IResources> {\n const readFile = util.promisify(fs.readFile);\n const exists = util.promisify(fs.exists);\n const fileName = getRCFileName();\n if (await exists(fileName)) {\n const buf = await readFile(fileName);\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return JSON.parse(buf.toString(\"utf8\"));\n } catch (e) {\n // Nothing\n }\n }\n return {};\n}\n\nexport async function saveRC(rc: IResources) {\n const writeFile = util.promisify(fs.writeFile);\n const content = JSON.stringify(rc, undefined, 2);\n return writeFile(getRCFileName(), Buffer.from(content, \"utf8\"));\n}\n\n// eslint-disable-next-line prefer-arrow/prefer-arrow-functions\nexport async function lockRC() {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return lock(getRCFileName(), {\n retries: {\n forever: true,\n },\n stale:60000,\n realpath: false,\n });\n}\n"]}
1
+ {"version":3,"file":"fluidToolRC.js","sourceRoot":"","sources":["../src/fluidToolRC.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AACxB,qDAAuC;AAqBvC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,CAAC;AAE7D,KAAK,UAAU,MAAM;IACxB,MAAM,QAAQ,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,aAAa,EAAE,CAAC;IACjC,IAAI,MAAM,MAAM,CAAC,QAAQ,CAAC,EAAE;QACxB,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACrC,IAAI;YACA,+DAA+D;YAC/D,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;SAC3C;QAAC,OAAO,CAAC,EAAE;YACR,UAAU;SACb;KACJ;IACD,OAAO,EAAE,CAAC;AACd,CAAC;AAdD,wBAcC;AAEM,KAAK,UAAU,MAAM,CAAC,EAAc;IACvC,MAAM,SAAS,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;IACjD,OAAO,SAAS,CAAC,aAAa,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AACpE,CAAC;AAJD,wBAIC;AAEM,KAAK,UAAU,MAAM;IACxB,+DAA+D;IAC/D,OAAO,sBAAI,CAAC,aAAa,EAAE,EAAE;QACzB,OAAO,EAAE;YACL,OAAO,EAAE,IAAI;SAChB;QACD,KAAK,EAAC,KAAK;QACX,QAAQ,EAAE,KAAK;KAClB,CAAC,CAAC;AACP,CAAC;AATD,wBASC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport fs from \"fs\";\nimport os from \"os\";\nimport path from \"path\";\nimport util from \"util\";\nimport { lock } from \"proper-lockfile\";\nimport { IOdspTokens } from \"@fluidframework/odsp-doclib-utils\";\n\nexport interface IAsyncCache<TKey, TValue> {\n get(key: TKey): Promise<TValue | undefined>;\n save(key: TKey, value: TValue): Promise<void>;\n lock<T>(callback: () => Promise<T>): Promise<T>;\n}\n\nexport interface IResources {\n tokens?: {\n version?: number;\n data: {\n [key: string]: {\n storage?: IOdspTokens,\n push?: IOdspTokens\n }\n }\n }\n}\n\nconst getRCFileName = () => path.join(os.homedir(), \".fluidtoolrc\");\n\nexport async function loadRC(): Promise<IResources> {\n const readFile = util.promisify(fs.readFile);\n const exists = util.promisify(fs.exists);\n const fileName = getRCFileName();\n if (await exists(fileName)) {\n const buf = await readFile(fileName);\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return JSON.parse(buf.toString(\"utf8\"));\n } catch (e) {\n // Nothing\n }\n }\n return {};\n}\n\nexport async function saveRC(rc: IResources) {\n const writeFile = util.promisify(fs.writeFile);\n const content = JSON.stringify(rc, undefined, 2);\n return writeFile(getRCFileName(), Buffer.from(content, \"utf8\"));\n}\n\nexport async function lockRC() {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return lock(getRCFileName(), {\n retries: {\n forever: true,\n },\n stale:60000,\n realpath: false,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"httpHelpers.d.ts","sourceRoot":"","sources":["../src/httpHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAE7B,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,UAAU,IAAI,IAAI,CAAC;CACtB;AACD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,CAAC,eAAe,GAAG,kBAAkB,CAe3G;AACD,oBAAY,mBAAmB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,IAAI,CAAC,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AACzG,oBAAY,kBAAkB,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9D,eAAO,MAAM,qBAAqB,YAAmB,MAAM,2DAiBrD,CAAC;AAEP,eAAO,MAAM,WAAW,aAAoB,KAAK,cAAc,KAAG,QAAQ,IAAI,CAM5E,CAAC"}
1
+ {"version":3,"file":"httpHelpers.d.ts","sourceRoot":"","sources":["../src/httpHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAE7B,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,UAAU,IAAI,IAAI,CAAC;CACtB;AACD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,CAAC,eAAe,GAAG,kBAAkB,CAe3G;AACD,oBAAY,mBAAmB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,IAAI,CAAC,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AACzG,oBAAY,kBAAkB,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9D,eAAO,MAAM,qBAAqB,YAAmB,MAAM,2DAmBrD,CAAC;AAEP,eAAO,MAAM,WAAW,aAAoB,KAAK,cAAc,KAAG,QAAQ,IAAI,CAM5E,CAAC"}
@@ -24,7 +24,10 @@ function createTrackedServer(port, requestListener) {
24
24
  };
25
25
  }
26
26
  exports.createTrackedServer = createTrackedServer;
27
- const serverListenAndHandle = async (port, handler) => new Promise((outerResolve, outerReject) => {
27
+ const serverListenAndHandle = async (port, handler) =>
28
+ // eslint-disable-next-line promise/param-names
29
+ new Promise((outerResolve, outerReject) => {
30
+ // eslint-disable-next-line promise/param-names
28
31
  const innerP = new Promise((innerResolve, innerReject) => {
29
32
  const httpServer = createTrackedServer(port, (req, res) => {
30
33
  // ignore favicon
@@ -1 +1 @@
1
- {"version":3,"file":"httpHelpers.js","sourceRoot":"","sources":["../src/httpHelpers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,gDAAwB;AAQxB,SAAgB,mBAAmB,CAAC,IAAY,EAAE,eAAqC;IACnF,MAAM,MAAM,GAAG,cAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,MA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ChC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAChC,CAAC;QACN,CAAC,CAAC,CAAC;QACH,YAAY,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAjBM,QAAA,qBAAqB,yBAiB3B;AAEA,MAAM,WAAW,GAAG,KAAK,EAAE,QAA6B,EAAiB,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IAC/G,IAAI;QACA,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;KACzB;IAAC,OAAO,KAAK,EAAE;QACZ,MAAM,CAAC,KAAK,CAAC,CAAC;KACjB;AACL,CAAC,CAAC,CAAC;AANU,QAAA,WAAW,eAMrB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport http from \"http\";\nimport { Socket } from \"net\";\n\nexport interface ITrackedHttpServer {\n readonly server: http.Server;\n readonly sockets: Set<Socket>;\n fullyClose(): void;\n}\nexport function createTrackedServer(port: number, requestListener: http.RequestListener): ITrackedHttpServer {\n const server = http.createServer(requestListener).listen(port);\n const sockets = new Set<Socket>();\n\n server.on(\"connection\", (socket) => {\n sockets.add(socket);\n socket.on(\"close\", () => sockets.delete(socket));\n });\n\n return {\n server, sockets, fullyClose() {\n server.close();\n sockets.forEach((socket) => socket.destroy());\n },\n };\n}\nexport type OnceListenerHandler<T> = (req: http.IncomingMessage, res: http.ServerResponse) => Promise<T>;\nexport type OnceListenerResult<T> = Promise<() => Promise<T>>;\nexport const serverListenAndHandle = async <T>(port: number, handler: OnceListenerHandler<T>): OnceListenerResult<T> =>\n new Promise((outerResolve, outerReject) => {\n const innerP = new Promise<T>((innerResolve, innerReject) => {\n const httpServer = createTrackedServer(port, (req, res) => {\n // ignore favicon\n if (req.url === \"/favicon.ico\") {\n res.writeHead(200, { \"Content-Type\": \"image/x-icon\" });\n res.end();\n return;\n }\n handler(req, res).finally(() => httpServer.fullyClose()).then(\n (result) => innerResolve(result),\n (error) => innerReject(error),\n );\n });\n outerResolve(async () => innerP);\n });\n });\n\nexport const endResponse = async (response: http.ServerResponse): Promise<void> => new Promise((resolve, reject) => {\n try {\n response.end(resolve);\n } catch (error) {\n reject(error);\n }\n});\n"]}
1
+ {"version":3,"file":"httpHelpers.js","sourceRoot":"","sources":["../src/httpHelpers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,gDAAwB;AAQxB,SAAgB,mBAAmB,CAAC,IAAY,EAAE,eAAqC;IACnF,MAAM,MAAM,GAAG,cAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAElC,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE;QAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,OAAO;QACH,MAAM,EAAE,OAAO,EAAE,UAAU;YACvB,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QAClD,CAAC;KACJ,CAAC;AACN,CAAC;AAfD,kDAeC;AAGM,MAAM,qBAAqB,GAAG,KAAK,EAAK,IAAY,EAAE,OAA+B,EAAyB,EAAE;AACnH,+CAA+C;AAC/C,IAAI,OAAO,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,EAAE;IAC1C,+CAA+C;IAC3C,MAAM,MAAM,GAAG,IAAI,OAAO,CAAI,CAAC,YAAY,EAAE,WAAW,EAAE,EAAE;QACxD,MAAM,UAAU,GAAG,mBAAmB,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YACtD,iBAAiB;YACjB,IAAI,GAAG,CAAC,GAAG,KAAK,cAAc,EAAE;gBAC5B,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;gBACvD,GAAG,CAAC,GAAG,EAAE,CAAC;gBACV,OAAO;aACV;YACD,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CACzD,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,EAChC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAChC,CAAC;QACN,CAAC,CAAC,CAAC;QACH,YAAY,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAnBM,QAAA,qBAAqB,yBAmB3B;AAEA,MAAM,WAAW,GAAG,KAAK,EAAE,QAA6B,EAAiB,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IAC/G,IAAI;QACA,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;KACzB;IAAC,OAAO,KAAK,EAAE;QACZ,MAAM,CAAC,KAAK,CAAC,CAAC;KACjB;AACL,CAAC,CAAC,CAAC;AANU,QAAA,WAAW,eAMrB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport http from \"http\";\nimport { Socket } from \"net\";\n\nexport interface ITrackedHttpServer {\n readonly server: http.Server;\n readonly sockets: Set<Socket>;\n fullyClose(): void;\n}\nexport function createTrackedServer(port: number, requestListener: http.RequestListener): ITrackedHttpServer {\n const server = http.createServer(requestListener).listen(port);\n const sockets = new Set<Socket>();\n\n server.on(\"connection\", (socket) => {\n sockets.add(socket);\n socket.on(\"close\", () => sockets.delete(socket));\n });\n\n return {\n server, sockets, fullyClose() {\n server.close();\n sockets.forEach((socket) => socket.destroy());\n },\n };\n}\nexport type OnceListenerHandler<T> = (req: http.IncomingMessage, res: http.ServerResponse) => Promise<T>;\nexport type OnceListenerResult<T> = Promise<() => Promise<T>>;\nexport const serverListenAndHandle = async <T>(port: number, handler: OnceListenerHandler<T>): OnceListenerResult<T> =>\n // eslint-disable-next-line promise/param-names\n new Promise((outerResolve, outerReject) => {\n // eslint-disable-next-line promise/param-names\n const innerP = new Promise<T>((innerResolve, innerReject) => {\n const httpServer = createTrackedServer(port, (req, res) => {\n // ignore favicon\n if (req.url === \"/favicon.ico\") {\n res.writeHead(200, { \"Content-Type\": \"image/x-icon\" });\n res.end();\n return;\n }\n handler(req, res).finally(() => httpServer.fullyClose()).then(\n (result) => innerResolve(result),\n (error) => innerReject(error),\n );\n });\n outerResolve(async () => innerP);\n });\n });\n\nexport const endResponse = async (response: http.ServerResponse): Promise<void> => new Promise((resolve, reject) => {\n try {\n response.end(resolve);\n } catch (error) {\n reject(error);\n }\n});\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/tool-utils";
8
- export declare const pkgVersion = "0.54.0-47413";
8
+ export declare const pkgVersion = "0.55.0-48551";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/tool-utils";
11
- exports.pkgVersion = "0.54.0-47413";
11
+ exports.pkgVersion = "0.55.0-48551";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,4BAA4B,CAAC;AACvC,QAAA,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tool-utils\";\nexport const pkgVersion = \"0.54.0-47413\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,4BAA4B,CAAC;AACvC,QAAA,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tool-utils\";\nexport const pkgVersion = \"0.55.0-48551\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"fluidToolRC.d.ts","sourceRoot":"","sources":["../src/fluidToolRC.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,MAAM,WAAW,WAAW,CAAC,IAAI,EAAE,MAAM;IACrC,GAAG,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC5C,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,C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E,UAAU,iBAI1C;AAED,wBAAsB,MAAM,iBAS3B"}
@@ -2,7 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- /* eslint-disable unicorn/filename-case */
6
5
  import fs from "fs";
7
6
  import os from "os";
8
7
  import path from "path";
@@ -30,7 +29,6 @@ export async function saveRC(rc) {
30
29
  const content = JSON.stringify(rc, undefined, 2);
31
30
  return writeFile(getRCFileName(), Buffer.from(content, "utf8"));
32
31
  }
33
- // eslint-disable-next-line prefer-arrow/prefer-arrow-functions
34
32
  export async function lockRC() {
35
33
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
36
34
  return lock(getRCFileName(), {
@@ -1 +1 @@
1
- {"version":3,"file":"fluidToolRC.js","sourceRoot":"","sources":["../src/fluidToolRC.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,0CAA0C;AAE1C,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAqBvC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,CAAC;AAEpE,MAAM,CAAC,KAAK,UAAU,MAAM;IACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,aAAa,EAAE,CAAC;IACjC,IAAI,MAAM,MAAM,CAAC,QAAQ,CAAC,EAAE;QACxB,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACrC,IAAI;YACA,+DAA+D;YAC/D,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;SAC3C;QAAC,OAAO,CAAC,EAAE;YACR,UAAU;SACb;KACJ;IACD,OAAO,EAAE,CAAC;AACd,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,EAAc;IACvC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;IACjD,OAAO,SAAS,CAAC,aAAa,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,+DAA+D;AAC/D,MAAM,CAAC,KAAK,UAAU,MAAM;IACxB,+DAA+D;IAC/D,OAAO,IAAI,CAAC,aAAa,EAAE,EAAE;QACzB,OAAO,EAAE;YACL,OAAO,EAAE,IAAI;SAChB;QACD,KAAK,EAAC,KAAK;QACX,QAAQ,EAAE,KAAK;KAClB,CAAC,CAAC;AACP,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable unicorn/filename-case */\n\nimport fs from \"fs\";\nimport os from \"os\";\nimport path from \"path\";\nimport util from \"util\";\nimport { lock } from \"proper-lockfile\";\nimport { IOdspTokens } from \"@fluidframework/odsp-doclib-utils\";\n\nexport interface IAsyncCache<TKey, TValue> {\n get(key: TKey): Promise<TValue | undefined>;\n save(key: TKey, value: TValue): Promise<void>;\n lock<T>(callback: () => Promise<T>): Promise<T>;\n}\n\nexport interface IResources {\n tokens?: {\n version?: number;\n data: {\n [key: string]: {\n storage?: IOdspTokens,\n push?: IOdspTokens\n }\n }\n }\n}\n\nconst getRCFileName = () => path.join(os.homedir(), \".fluidtoolrc\");\n\nexport async function loadRC(): Promise<IResources> {\n const readFile = util.promisify(fs.readFile);\n const exists = util.promisify(fs.exists);\n const fileName = getRCFileName();\n if (await exists(fileName)) {\n const buf = await readFile(fileName);\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return JSON.parse(buf.toString(\"utf8\"));\n } catch (e) {\n // Nothing\n }\n }\n return {};\n}\n\nexport async function saveRC(rc: IResources) {\n const writeFile = util.promisify(fs.writeFile);\n const content = JSON.stringify(rc, undefined, 2);\n return writeFile(getRCFileName(), Buffer.from(content, \"utf8\"));\n}\n\n// eslint-disable-next-line prefer-arrow/prefer-arrow-functions\nexport async function lockRC() {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return lock(getRCFileName(), {\n retries: {\n forever: true,\n },\n stale:60000,\n realpath: false,\n });\n}\n"]}
1
+ {"version":3,"file":"fluidToolRC.js","sourceRoot":"","sources":["../src/fluidToolRC.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAqBvC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,CAAC;AAEpE,MAAM,CAAC,KAAK,UAAU,MAAM;IACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,aAAa,EAAE,CAAC;IACjC,IAAI,MAAM,MAAM,CAAC,QAAQ,CAAC,EAAE;QACxB,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACrC,IAAI;YACA,+DAA+D;YAC/D,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;SAC3C;QAAC,OAAO,CAAC,EAAE;YACR,UAAU;SACb;KACJ;IACD,OAAO,EAAE,CAAC;AACd,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,EAAc;IACvC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;IACjD,OAAO,SAAS,CAAC,aAAa,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM;IACxB,+DAA+D;IAC/D,OAAO,IAAI,CAAC,aAAa,EAAE,EAAE;QACzB,OAAO,EAAE;YACL,OAAO,EAAE,IAAI;SAChB;QACD,KAAK,EAAC,KAAK;QACX,QAAQ,EAAE,KAAK;KAClB,CAAC,CAAC;AACP,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport fs from \"fs\";\nimport os from \"os\";\nimport path from \"path\";\nimport util from \"util\";\nimport { lock } from \"proper-lockfile\";\nimport { IOdspTokens } from \"@fluidframework/odsp-doclib-utils\";\n\nexport interface IAsyncCache<TKey, TValue> {\n get(key: TKey): Promise<TValue | undefined>;\n save(key: TKey, value: TValue): Promise<void>;\n lock<T>(callback: () => Promise<T>): Promise<T>;\n}\n\nexport interface IResources {\n tokens?: {\n version?: number;\n data: {\n [key: string]: {\n storage?: IOdspTokens,\n push?: IOdspTokens\n }\n }\n }\n}\n\nconst getRCFileName = () => path.join(os.homedir(), \".fluidtoolrc\");\n\nexport async function loadRC(): Promise<IResources> {\n const readFile = util.promisify(fs.readFile);\n const exists = util.promisify(fs.exists);\n const fileName = getRCFileName();\n if (await exists(fileName)) {\n const buf = await readFile(fileName);\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return JSON.parse(buf.toString(\"utf8\"));\n } catch (e) {\n // Nothing\n }\n }\n return {};\n}\n\nexport async function saveRC(rc: IResources) {\n const writeFile = util.promisify(fs.writeFile);\n const content = JSON.stringify(rc, undefined, 2);\n return writeFile(getRCFileName(), Buffer.from(content, \"utf8\"));\n}\n\nexport async function lockRC() {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return lock(getRCFileName(), {\n retries: {\n forever: true,\n },\n stale:60000,\n realpath: false,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"httpHelpers.d.ts","sourceRoot":"","sources":["../src/httpHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAE7B,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,UAAU,IAAI,IAAI,CAAC;CACtB;AACD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,CAAC,eAAe,GAAG,kBAAkB,CAe3G;AACD,oBAAY,mBAAmB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,IAAI,CAAC,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AACzG,oBAAY,kBAAkB,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9D,eAAO,MAAM,qBAAqB,YAAmB,MAAM,2DAiBrD,CAAC;AAEP,eAAO,MAAM,WAAW,aAAoB,KAAK,cAAc,KAAG,QAAQ,IAAI,CAM5E,CAAC"}
1
+ {"version":3,"file":"httpHelpers.d.ts","sourceRoot":"","sources":["../src/httpHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAE7B,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,UAAU,IAAI,IAAI,CAAC;CACtB;AACD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,CAAC,eAAe,GAAG,kBAAkB,CAe3G;AACD,oBAAY,mBAAmB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,IAAI,CAAC,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AACzG,oBAAY,kBAAkB,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9D,eAAO,MAAM,qBAAqB,YAAmB,MAAM,2DAmBrD,CAAC;AAEP,eAAO,MAAM,WAAW,aAAoB,KAAK,cAAc,KAAG,QAAQ,IAAI,CAM5E,CAAC"}
@@ -17,7 +17,10 @@ export function createTrackedServer(port, requestListener) {
17
17
  },
18
18
  };
19
19
  }
20
- export const serverListenAndHandle = async (port, handler) => new Promise((outerResolve, outerReject) => {
20
+ export const serverListenAndHandle = async (port, handler) =>
21
+ // eslint-disable-next-line promise/param-names
22
+ new Promise((outerResolve, outerReject) => {
23
+ // eslint-disable-next-line promise/param-names
21
24
  const innerP = new Promise((innerResolve, innerReject) => {
22
25
  const httpServer = createTrackedServer(port, (req, res) => {
23
26
  // ignore favicon
@@ -1 +1 @@
1
- {"version":3,"file":"httpHelpers.js","sourceRoot":"","sources":["../src/httpHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AAQxB,MAAM,UAAU,mBAAmB,CAAC,IAAY,EAAE,eAAqC;IACnF,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAElC,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE;QAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,OAAO;QACH,MAAM,EAAE,OAAO,EAAE,UAAU;YACvB,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QAClD,CAAC;KACJ,CAAC;AACN,CAAC;AAGD,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EAAK,IAAY,EAAE,OAA+B,EAAyB,EAAE,CACnH,IAAI,OAAO,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,EAAE;IACtC,MAAM,MAAM,GAAG,IAAI,OAAO,CAAI,CAAC,YAAY,EAAE,WAAW,EAAE,EAAE;QACxD,MAAM,UAAU,GAAG,mBAAmB,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YACtD,iBAAiB;YACjB,IAAI,GAAG,CAAC,GAAG,KAAK,cAAc,EAAE;gBAC5B,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;gBACvD,GAAG,CAAC,GAAG,EAAE,CAAC;gBACV,OAAO;aACV;YACD,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CACzD,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,EAChC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAChC,CAAC;QACN,CAAC,CAAC,CAAC;QACH,YAAY,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEP,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,QAA6B,EAAiB,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IAC/G,IAAI;QACA,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;KACzB;IAAC,OAAO,KAAK,EAAE;QACZ,MAAM,CAAC,KAAK,CAAC,CAAC;KACjB;AACL,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport http from \"http\";\nimport { Socket } from \"net\";\n\nexport interface ITrackedHttpServer {\n readonly server: http.Server;\n readonly sockets: Set<Socket>;\n fullyClose(): void;\n}\nexport function createTrackedServer(port: number, requestListener: http.RequestListener): ITrackedHttpServer {\n const server = http.createServer(requestListener).listen(port);\n const sockets = new Set<Socket>();\n\n server.on(\"connection\", (socket) => {\n sockets.add(socket);\n socket.on(\"close\", () => sockets.delete(socket));\n });\n\n return {\n server, sockets, fullyClose() {\n server.close();\n sockets.forEach((socket) => socket.destroy());\n },\n };\n}\nexport type OnceListenerHandler<T> = (req: http.IncomingMessage, res: http.ServerResponse) => Promise<T>;\nexport type OnceListenerResult<T> = Promise<() => Promise<T>>;\nexport const serverListenAndHandle = async <T>(port: number, handler: OnceListenerHandler<T>): OnceListenerResult<T> =>\n new Promise((outerResolve, outerReject) => {\n const innerP = new Promise<T>((innerResolve, innerReject) => {\n const httpServer = createTrackedServer(port, (req, res) => {\n // ignore favicon\n if (req.url === \"/favicon.ico\") {\n res.writeHead(200, { \"Content-Type\": \"image/x-icon\" });\n res.end();\n return;\n }\n handler(req, res).finally(() => httpServer.fullyClose()).then(\n (result) => innerResolve(result),\n (error) => innerReject(error),\n );\n });\n outerResolve(async () => innerP);\n });\n });\n\nexport const endResponse = async (response: http.ServerResponse): Promise<void> => new Promise((resolve, reject) => {\n try {\n response.end(resolve);\n } catch (error) {\n reject(error);\n }\n});\n"]}
1
+ {"version":3,"file":"httpHelpers.js","sourceRoot":"","sources":["../src/httpHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AAQxB,MAAM,UAAU,mBAAmB,CAAC,IAAY,EAAE,eAAqC;IACnF,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAElC,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE;QAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,OAAO;QACH,MAAM,EAAE,OAAO,EAAE,UAAU;YACvB,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OA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AAC;KACjB;AACL,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport http from \"http\";\nimport { Socket } from \"net\";\n\nexport interface ITrackedHttpServer {\n readonly server: http.Server;\n readonly sockets: Set<Socket>;\n fullyClose(): void;\n}\nexport function createTrackedServer(port: number, requestListener: http.RequestListener): ITrackedHttpServer {\n const server = http.createServer(requestListener).listen(port);\n const sockets = new Set<Socket>();\n\n server.on(\"connection\", (socket) => {\n sockets.add(socket);\n socket.on(\"close\", () => sockets.delete(socket));\n });\n\n return {\n server, sockets, fullyClose() {\n server.close();\n sockets.forEach((socket) => socket.destroy());\n },\n };\n}\nexport type OnceListenerHandler<T> = (req: http.IncomingMessage, res: http.ServerResponse) => Promise<T>;\nexport type OnceListenerResult<T> = Promise<() => Promise<T>>;\nexport const serverListenAndHandle = async <T>(port: number, handler: OnceListenerHandler<T>): OnceListenerResult<T> =>\n // eslint-disable-next-line promise/param-names\n new Promise((outerResolve, outerReject) => {\n // eslint-disable-next-line promise/param-names\n const innerP = new Promise<T>((innerResolve, innerReject) => {\n const httpServer = createTrackedServer(port, (req, res) => {\n // ignore favicon\n if (req.url === \"/favicon.ico\") {\n res.writeHead(200, { \"Content-Type\": \"image/x-icon\" });\n res.end();\n return;\n }\n handler(req, res).finally(() => httpServer.fullyClose()).then(\n (result) => innerResolve(result),\n (error) => innerReject(error),\n );\n });\n outerResolve(async () => innerP);\n });\n });\n\nexport const endResponse = async (response: http.ServerResponse): Promise<void> => new Promise((resolve, reject) => {\n try {\n response.end(resolve);\n } catch (error) {\n reject(error);\n }\n});\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/tool-utils";
8
- export declare const pkgVersion = "0.54.0-47413";
8
+ export declare const pkgVersion = "0.55.0-48551";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/tool-utils";
8
- export const pkgVersion = "0.54.0-47413";
8
+ export const pkgVersion = "0.55.0-48551";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,4BAA4B,CAAC;AACpD,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tool-utils\";\nexport const pkgVersion = \"0.54.0-47413\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,4BAA4B,CAAC;AACpD,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tool-utils\";\nexport const pkgVersion = \"0.55.0-48551\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/tool-utils",
3
- "version": "0.54.0-47413",
3
+ "version": "0.55.0-48551",
4
4
  "description": "Common utilities for Fluid tools",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": "https://github.com/microsoft/FluidFramework",
@@ -23,7 +23,7 @@
23
23
  "ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/* ../../../_api-extractor-temp/",
24
24
  "clean": "rimraf dist *.tsbuildinfo *.build.log",
25
25
  "eslint": "eslint --format stylish src",
26
- "eslint:fix": "eslint --format stylish src --fix",
26
+ "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
27
27
  "lint": "npm run eslint",
28
28
  "lint:fix": "npm run eslint:fix",
29
29
  "test": "npm run test:mocha",
@@ -57,7 +57,7 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@fluidframework/common-utils": "^0.32.1",
60
- "@fluidframework/odsp-doclib-utils": "0.54.0-47413",
60
+ "@fluidframework/odsp-doclib-utils": "0.55.0-48551",
61
61
  "@fluidframework/protocol-base": "^0.1034.0",
62
62
  "@fluidframework/protocol-definitions": "^0.1026.0",
63
63
  "async-mutex": "^0.3.1",
@@ -67,25 +67,26 @@
67
67
  },
68
68
  "devDependencies": {
69
69
  "@fluidframework/build-common": "^0.23.0",
70
- "@fluidframework/eslint-config-fluid": "^0.24.0",
71
- "@fluidframework/mocha-test-setup": "0.54.0-47413",
70
+ "@fluidframework/eslint-config-fluid": "^0.25.0-0",
71
+ "@fluidframework/mocha-test-setup": "0.55.0-48551",
72
72
  "@microsoft/api-extractor": "^7.16.1",
73
+ "@rushstack/eslint-config": "^2.5.1",
73
74
  "@types/debug": "^4.1.5",
74
75
  "@types/jwt-decode": "^2.2.1",
75
76
  "@types/mocha": "^8.2.2",
76
77
  "@types/node": "^14.18.0",
77
- "@typescript-eslint/eslint-plugin": "~4.14.0",
78
- "@typescript-eslint/parser": "~4.14.0",
78
+ "@typescript-eslint/eslint-plugin": "~5.9.0",
79
+ "@typescript-eslint/parser": "~5.9.0",
79
80
  "concurrently": "^6.2.0",
80
81
  "copyfiles": "^2.1.0",
81
82
  "cross-env": "^7.0.2",
82
- "eslint": "~7.18.0",
83
+ "eslint": "~8.6.0",
84
+ "eslint-plugin-editorconfig": "~3.2.0",
83
85
  "eslint-plugin-eslint-comments": "~3.2.0",
84
- "eslint-plugin-import": "~2.22.1",
86
+ "eslint-plugin-import": "~2.25.4",
85
87
  "eslint-plugin-no-null": "~1.0.2",
86
- "eslint-plugin-prefer-arrow": "~1.2.2",
87
- "eslint-plugin-react": "~7.22.0",
88
- "eslint-plugin-unicorn": "~26.0.1",
88
+ "eslint-plugin-react": "~7.28.0",
89
+ "eslint-plugin-unicorn": "~40.0.0",
89
90
  "mocha": "^8.4.0",
90
91
  "nyc": "^15.0.0",
91
92
  "rimraf": "^2.6.2",
@@ -3,8 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- /* eslint-disable unicorn/filename-case */
7
-
8
6
  import fs from "fs";
9
7
  import os from "os";
10
8
  import path from "path";
@@ -54,7 +52,6 @@ export async function saveRC(rc: IResources) {
54
52
  return writeFile(getRCFileName(), Buffer.from(content, "utf8"));
55
53
  }
56
54
 
57
- // eslint-disable-next-line prefer-arrow/prefer-arrow-functions
58
55
  export async function lockRC() {
59
56
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
60
57
  return lock(getRCFileName(), {
@@ -30,7 +30,9 @@ export function createTrackedServer(port: number, requestListener: http.RequestL
30
30
  export type OnceListenerHandler<T> = (req: http.IncomingMessage, res: http.ServerResponse) => Promise<T>;
31
31
  export type OnceListenerResult<T> = Promise<() => Promise<T>>;
32
32
  export const serverListenAndHandle = async <T>(port: number, handler: OnceListenerHandler<T>): OnceListenerResult<T> =>
33
+ // eslint-disable-next-line promise/param-names
33
34
  new Promise((outerResolve, outerReject) => {
35
+ // eslint-disable-next-line promise/param-names
34
36
  const innerP = new Promise<T>((innerResolve, innerReject) => {
35
37
  const httpServer = createTrackedServer(port, (req, res) => {
36
38
  // ignore favicon
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/tool-utils";
9
- export const pkgVersion = "0.54.0-47413";
9
+ export const pkgVersion = "0.55.0-48551";