@fluid-experimental/oldest-client-observer 2.0.0-dev-rc.5.0.0.268409 → 2.0.0-dev-rc.5.0.0.270987
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/biome.jsonc
ADDED
|
@@ -65,22 +65,12 @@ const internal_1 = require("@fluidframework/core-utils/internal");
|
|
|
65
65
|
* @alpha
|
|
66
66
|
*/
|
|
67
67
|
class OldestClientObserver extends client_utils_1.TypedEventEmitter {
|
|
68
|
+
observable;
|
|
69
|
+
quorum;
|
|
70
|
+
currentIsOldest = false;
|
|
68
71
|
constructor(observable) {
|
|
69
72
|
super();
|
|
70
73
|
this.observable = observable;
|
|
71
|
-
this.currentIsOldest = false;
|
|
72
|
-
this.updateOldest = () => {
|
|
73
|
-
const oldest = this.computeIsOldest();
|
|
74
|
-
if (this.currentIsOldest !== oldest) {
|
|
75
|
-
this.currentIsOldest = oldest;
|
|
76
|
-
if (oldest) {
|
|
77
|
-
this.emit("becameOldest");
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
this.emit("lostOldest");
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
74
|
this.quorum = this.observable.getQuorum();
|
|
85
75
|
this.currentIsOldest = this.computeIsOldest();
|
|
86
76
|
this.quorum.on("addMember", this.updateOldest);
|
|
@@ -91,6 +81,18 @@ class OldestClientObserver extends client_utils_1.TypedEventEmitter {
|
|
|
91
81
|
isOldest() {
|
|
92
82
|
return this.currentIsOldest;
|
|
93
83
|
}
|
|
84
|
+
updateOldest = () => {
|
|
85
|
+
const oldest = this.computeIsOldest();
|
|
86
|
+
if (this.currentIsOldest !== oldest) {
|
|
87
|
+
this.currentIsOldest = oldest;
|
|
88
|
+
if (oldest) {
|
|
89
|
+
this.emit("becameOldest");
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
this.emit("lostOldest");
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
94
96
|
computeIsOldest() {
|
|
95
97
|
// If the container is detached, we are the only ones that know about it and are the oldest by default.
|
|
96
98
|
if (this.observable.attachState === container_definitions_1.AttachState.Detached) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oldestClientObserver.js","sourceRoot":"","sources":["../src/oldestClientObserver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AACjE,iFAAoE;AACpE,kEAA6D;AAS7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAa,oBACZ,SAAQ,gCAA8C;
|
|
1
|
+
{"version":3,"file":"oldestClientObserver.js","sourceRoot":"","sources":["../src/oldestClientObserver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AACjE,iFAAoE;AACpE,kEAA6D;AAS7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAa,oBACZ,SAAQ,gCAA8C;IAKzB;IAFZ,MAAM,CAAiB;IAChC,eAAe,GAAY,KAAK,CAAC;IACzC,YAA6B,UAAmC;QAC/D,KAAK,EAAE,CAAC;QADoB,eAAU,GAAV,UAAU,CAAyB;QAE/D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;QAC1C,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAC9C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC/C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAClD,UAAU,CAAC,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC9C,UAAU,CAAC,EAAE,CAAC,cAAc,EAAE,IAAI,CAAC,YAAY,C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AAc,EAAE,CAAC;gBACzE,OAAO,KAAK,CAAC;YACd,CAAC;QACF,CAAC;QAED,oCAAoC;QACpC,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAlED,oDAkEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { IQuorumClients } from \"@fluidframework/driver-definitions\";\n\nimport {\n\tIOldestClientObservable,\n\tIOldestClientObserver,\n\tIOldestClientObserverEvents,\n} from \"./interfaces.js\";\n\n/**\n * The `OldestClientObserver` is a utility inspect if the local client is the oldest amongst connected clients (in\n * terms of when they connected) and watch for changes.\n *\n * It is still experimental and under development. Please do try it out, but expect breaking changes in the future.\n *\n * @remarks\n * ### Creation\n *\n * The `OldestClientObserver` constructor takes an `IOldestClientObservable`. This is most easily satisfied with\n * either an `IContainerRuntime` or an `IFluidDataStoreRuntime`:\n *\n * ```typescript\n * // E.g. from within a BaseContainerRuntimeFactory:\n * protected async containerHasInitialized(runtime: IContainerRuntime) {\n * const oldestClientObserver = new OldestClientObserver(runtime);\n * // ...\n * }\n * ```\n *\n * ```typescript\n * // From within a DataObject\n * protected async hasInitialized() {\n * const oldestClientObserver = new OldestClientObserver(this.runtime);\n * // ...\n * }\n * ```\n *\n * ### Usage\n *\n * To check if the local client is the oldest, use the `isOldest()` method.\n *\n * ```typescript\n * if (oldestClientObserver.isOldest()) {\n * console.log(\"I'm the oldest\");\n * } else {\n * console.log(\"Someone else is older\");\n * }\n * ```\n *\n * ### Eventing\n *\n * `OldestClientObserver` is an `EventEmitter`, and will emit events when the local client becomes the oldest and when\n * it is no longer the oldest.\n *\n * ```typescript\n * oldestClientObserver.on(\"becameOldest\", () => {\n * console.log(\"I'm the oldest now\");\n * });\n *\n * oldestClientObserver.on(\"lostOldest\", () => {\n * console.log(\"I'm not the oldest anymore\");\n * });\n * ```\n * @alpha\n */\nexport class OldestClientObserver\n\textends TypedEventEmitter<IOldestClientObserverEvents>\n\timplements IOldestClientObserver\n{\n\tprivate readonly quorum: IQuorumClients;\n\tprivate currentIsOldest: boolean = false;\n\tconstructor(private readonly observable: IOldestClientObservable) {\n\t\tsuper();\n\t\tthis.quorum = this.observable.getQuorum();\n\t\tthis.currentIsOldest = this.computeIsOldest();\n\t\tthis.quorum.on(\"addMember\", this.updateOldest);\n\t\tthis.quorum.on(\"removeMember\", this.updateOldest);\n\t\tobservable.on(\"connected\", this.updateOldest);\n\t\tobservable.on(\"disconnected\", this.updateOldest);\n\t}\n\n\tpublic isOldest(): boolean {\n\t\treturn this.currentIsOldest;\n\t}\n\n\tprivate readonly updateOldest = (): void => {\n\t\tconst oldest = this.computeIsOldest();\n\t\tif (this.currentIsOldest !== oldest) {\n\t\t\tthis.currentIsOldest = oldest;\n\t\t\tif (oldest) {\n\t\t\t\tthis.emit(\"becameOldest\");\n\t\t\t} else {\n\t\t\t\tthis.emit(\"lostOldest\");\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate computeIsOldest(): boolean {\n\t\t// If the container is detached, we are the only ones that know about it and are the oldest by default.\n\t\tif (this.observable.attachState === AttachState.Detached) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// If we're not connected we can't be the oldest connected client.\n\t\tif (!this.observable.connected) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// TODO: Clean up error code linter violations repo-wide.\n\t\tassert(\n\t\t\tthis.observable.clientId !== undefined,\n\t\t\t// eslint-disable-next-line unicorn/numeric-separators-style\n\t\t\t0x1da /* \"Client id should be set if connected\" */,\n\t\t);\n\n\t\tconst selfSequencedClient = this.quorum.getMember(this.observable.clientId);\n\t\t// When in readonly mode our clientId will not be present in the quorum.\n\t\tif (selfSequencedClient === undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst members = this.quorum.getMembers();\n\t\tfor (const sequencedClient of members.values()) {\n\t\t\tif (sequencedClient.sequenceNumber < selfSequencedClient.sequenceNumber) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// No member of the quorum was older\n\t\treturn true;\n\t}\n}\n"]}
|
|
@@ -62,22 +62,12 @@ import { assert } from "@fluidframework/core-utils/internal";
|
|
|
62
62
|
* @alpha
|
|
63
63
|
*/
|
|
64
64
|
export class OldestClientObserver extends TypedEventEmitter {
|
|
65
|
+
observable;
|
|
66
|
+
quorum;
|
|
67
|
+
currentIsOldest = false;
|
|
65
68
|
constructor(observable) {
|
|
66
69
|
super();
|
|
67
70
|
this.observable = observable;
|
|
68
|
-
this.currentIsOldest = false;
|
|
69
|
-
this.updateOldest = () => {
|
|
70
|
-
const oldest = this.computeIsOldest();
|
|
71
|
-
if (this.currentIsOldest !== oldest) {
|
|
72
|
-
this.currentIsOldest = oldest;
|
|
73
|
-
if (oldest) {
|
|
74
|
-
this.emit("becameOldest");
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
this.emit("lostOldest");
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
71
|
this.quorum = this.observable.getQuorum();
|
|
82
72
|
this.currentIsOldest = this.computeIsOldest();
|
|
83
73
|
this.quorum.on("addMember", this.updateOldest);
|
|
@@ -88,6 +78,18 @@ export class OldestClientObserver extends TypedEventEmitter {
|
|
|
88
78
|
isOldest() {
|
|
89
79
|
return this.currentIsOldest;
|
|
90
80
|
}
|
|
81
|
+
updateOldest = () => {
|
|
82
|
+
const oldest = this.computeIsOldest();
|
|
83
|
+
if (this.currentIsOldest !== oldest) {
|
|
84
|
+
this.currentIsOldest = oldest;
|
|
85
|
+
if (oldest) {
|
|
86
|
+
this.emit("becameOldest");
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
this.emit("lostOldest");
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
91
93
|
computeIsOldest() {
|
|
92
94
|
// If the container is detached, we are the only ones that know about it and are the oldest by default.
|
|
93
95
|
if (this.observable.attachState === AttachState.Detached) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oldestClientObserver.js","sourceRoot":"","sources":["../src/oldestClientObserver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAS7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAM,OAAO,oBACZ,SAAQ,iBAA8C;
|
|
1
|
+
{"version":3,"file":"oldestClientObserver.js","sourceRoot":"","sources":["../src/oldestClientObserver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAS7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAM,OAAO,oBACZ,SAAQ,iBAA8C;IAKzB;IAFZ,MAAM,CAAiB;IAChC,eAAe,GAAY,KAAK,CAAC;IACzC,YAA6B,UAAmC;QAC/D,KAAK,EAAE,CAAC;QADoB,eAAU,GAAV,UAAU,CAAyB;QAE/D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;QAC1C,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAC9C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC/C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,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I,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACzC,KAAK,MAAM,eAAe,IAAI,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;YAChD,IAAI,eAAe,CAAC,cAAc,GAAG,mBAAmB,CAAC,cAAc,EAAE,CAAC;gBACzE,OAAO,KAAK,CAAC;YACd,CAAC;QACF,CAAC;QAED,oCAAoC;QACpC,OAAO,IAAI,CAAC;IACb,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { IQuorumClients } from \"@fluidframework/driver-definitions\";\n\nimport {\n\tIOldestClientObservable,\n\tIOldestClientObserver,\n\tIOldestClientObserverEvents,\n} from \"./interfaces.js\";\n\n/**\n * The `OldestClientObserver` is a utility inspect if the local client is the oldest amongst connected clients (in\n * terms of when they connected) and watch for changes.\n *\n * It is still experimental and under development. Please do try it out, but expect breaking changes in the future.\n *\n * @remarks\n * ### Creation\n *\n * The `OldestClientObserver` constructor takes an `IOldestClientObservable`. This is most easily satisfied with\n * either an `IContainerRuntime` or an `IFluidDataStoreRuntime`:\n *\n * ```typescript\n * // E.g. from within a BaseContainerRuntimeFactory:\n * protected async containerHasInitialized(runtime: IContainerRuntime) {\n * const oldestClientObserver = new OldestClientObserver(runtime);\n * // ...\n * }\n * ```\n *\n * ```typescript\n * // From within a DataObject\n * protected async hasInitialized() {\n * const oldestClientObserver = new OldestClientObserver(this.runtime);\n * // ...\n * }\n * ```\n *\n * ### Usage\n *\n * To check if the local client is the oldest, use the `isOldest()` method.\n *\n * ```typescript\n * if (oldestClientObserver.isOldest()) {\n * console.log(\"I'm the oldest\");\n * } else {\n * console.log(\"Someone else is older\");\n * }\n * ```\n *\n * ### Eventing\n *\n * `OldestClientObserver` is an `EventEmitter`, and will emit events when the local client becomes the oldest and when\n * it is no longer the oldest.\n *\n * ```typescript\n * oldestClientObserver.on(\"becameOldest\", () => {\n * console.log(\"I'm the oldest now\");\n * });\n *\n * oldestClientObserver.on(\"lostOldest\", () => {\n * console.log(\"I'm not the oldest anymore\");\n * });\n * ```\n * @alpha\n */\nexport class OldestClientObserver\n\textends TypedEventEmitter<IOldestClientObserverEvents>\n\timplements IOldestClientObserver\n{\n\tprivate readonly quorum: IQuorumClients;\n\tprivate currentIsOldest: boolean = false;\n\tconstructor(private readonly observable: IOldestClientObservable) {\n\t\tsuper();\n\t\tthis.quorum = this.observable.getQuorum();\n\t\tthis.currentIsOldest = this.computeIsOldest();\n\t\tthis.quorum.on(\"addMember\", this.updateOldest);\n\t\tthis.quorum.on(\"removeMember\", this.updateOldest);\n\t\tobservable.on(\"connected\", this.updateOldest);\n\t\tobservable.on(\"disconnected\", this.updateOldest);\n\t}\n\n\tpublic isOldest(): boolean {\n\t\treturn this.currentIsOldest;\n\t}\n\n\tprivate readonly updateOldest = (): void => {\n\t\tconst oldest = this.computeIsOldest();\n\t\tif (this.currentIsOldest !== oldest) {\n\t\t\tthis.currentIsOldest = oldest;\n\t\t\tif (oldest) {\n\t\t\t\tthis.emit(\"becameOldest\");\n\t\t\t} else {\n\t\t\t\tthis.emit(\"lostOldest\");\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate computeIsOldest(): boolean {\n\t\t// If the container is detached, we are the only ones that know about it and are the oldest by default.\n\t\tif (this.observable.attachState === AttachState.Detached) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// If we're not connected we can't be the oldest connected client.\n\t\tif (!this.observable.connected) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// TODO: Clean up error code linter violations repo-wide.\n\t\tassert(\n\t\t\tthis.observable.clientId !== undefined,\n\t\t\t// eslint-disable-next-line unicorn/numeric-separators-style\n\t\t\t0x1da /* \"Client id should be set if connected\" */,\n\t\t);\n\n\t\tconst selfSequencedClient = this.quorum.getMember(this.observable.clientId);\n\t\t// When in readonly mode our clientId will not be present in the quorum.\n\t\tif (selfSequencedClient === undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst members = this.quorum.getMembers();\n\t\tfor (const sequencedClient of members.values()) {\n\t\t\tif (sequencedClient.sequenceNumber < selfSequencedClient.sequenceNumber) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// No member of the quorum was older\n\t\treturn true;\n\t}\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-experimental/oldest-client-observer",
|
|
3
|
-
"version": "2.0.0-dev-rc.5.0.0.
|
|
3
|
+
"version": "2.0.0-dev-rc.5.0.0.270987",
|
|
4
4
|
"description": "Data object to determine if the local client is the oldest amongst connected clients",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -67,19 +67,19 @@
|
|
|
67
67
|
"temp-directory": "nyc/.nyc_output"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@fluid-internal/client-utils": "2.0.0-dev-rc.5.0.0.
|
|
71
|
-
"@fluidframework/container-definitions": "2.0.0-dev-rc.5.0.0.
|
|
72
|
-
"@fluidframework/core-interfaces": "2.0.0-dev-rc.5.0.0.
|
|
73
|
-
"@fluidframework/core-utils": "2.0.0-dev-rc.5.0.0.
|
|
74
|
-
"@fluidframework/driver-definitions": "2.0.0-dev-rc.5.0.0.
|
|
70
|
+
"@fluid-internal/client-utils": "2.0.0-dev-rc.5.0.0.270987",
|
|
71
|
+
"@fluidframework/container-definitions": "2.0.0-dev-rc.5.0.0.270987",
|
|
72
|
+
"@fluidframework/core-interfaces": "2.0.0-dev-rc.5.0.0.270987",
|
|
73
|
+
"@fluidframework/core-utils": "2.0.0-dev-rc.5.0.0.270987",
|
|
74
|
+
"@fluidframework/driver-definitions": "2.0.0-dev-rc.5.0.0.270987"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@arethetypeswrong/cli": "^0.15.2",
|
|
78
78
|
"@biomejs/biome": "^1.7.3",
|
|
79
|
-
"@fluid-private/test-dds-utils": "2.0.0-dev-rc.5.0.0.
|
|
80
|
-
"@fluid-tools/build-cli": "^0.39.0
|
|
79
|
+
"@fluid-private/test-dds-utils": "2.0.0-dev-rc.5.0.0.270987",
|
|
80
|
+
"@fluid-tools/build-cli": "^0.39.0",
|
|
81
81
|
"@fluidframework/build-common": "^2.0.3",
|
|
82
|
-
"@fluidframework/build-tools": "^0.39.0
|
|
82
|
+
"@fluidframework/build-tools": "^0.39.0",
|
|
83
83
|
"@fluidframework/eslint-config-fluid": "^5.3.0",
|
|
84
84
|
"@microsoft/api-extractor": "^7.45.1",
|
|
85
85
|
"@types/node": "^18.19.0",
|
|
@@ -111,13 +111,16 @@
|
|
|
111
111
|
"build:docs": "api-extractor run --local",
|
|
112
112
|
"build:esnext": "tsc --project ./tsconfig.json",
|
|
113
113
|
"check:are-the-types-wrong": "attw --pack .",
|
|
114
|
+
"check:biome": "biome check . --formatter-enabled=true",
|
|
115
|
+
"check:format": "npm run check:prettier",
|
|
114
116
|
"check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
115
117
|
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
|
|
116
118
|
"ci:build:docs": "api-extractor run",
|
|
117
119
|
"clean": "rimraf --glob dist lib \"*.d.ts\" \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp",
|
|
118
120
|
"eslint": "eslint --format stylish src",
|
|
119
121
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
120
|
-
"format": "
|
|
122
|
+
"format": "npm run format:prettier",
|
|
123
|
+
"format:biome": "biome check . --formatter-enabled=true --apply",
|
|
121
124
|
"format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
122
125
|
"lint": "fluid-build . --task lint",
|
|
123
126
|
"lint:fix": "fluid-build . --task eslint:fix --task format",
|