@fluidframework/core-utils 2.1.0-276985 → 2.1.0
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/CHANGELOG.md +4 -0
- package/README.md +98 -14
- package/api-extractor/api-extractor.current.json +5 -0
- package/api-extractor/api-extractor.legacy.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/core-utils.legacy.public.api.md +9 -0
- package/dist/legacy.d.ts +1 -1
- package/dist/public.d.ts +1 -1
- package/internal.d.ts +1 -1
- package/legacy.d.ts +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/public.d.ts +1 -1
- package/package.json +16 -14
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -3,10 +3,41 @@
|
|
|
3
3
|
This package is intended for sharing and promoting best-practice implementations of Fluid-agnostic utility functions
|
|
4
4
|
across packages in the Fluid Framework repo.
|
|
5
5
|
|
|
6
|
-
<!-- AUTO-GENERATED-CONTENT:START (
|
|
6
|
+
<!-- AUTO-GENERATED-CONTENT:START (LIBRARY_PACKAGE_README_HEADER) -->
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
<!-- prettier-ignore-start -->
|
|
9
|
+
<!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
|
|
10
|
+
|
|
11
|
+
## Using Fluid Framework libraries
|
|
12
|
+
|
|
13
|
+
When taking a dependency on a Fluid Framework library's public APIs, we recommend using a `^` (caret) version range, such as `^1.3.4`.
|
|
14
|
+
While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
|
|
15
|
+
library consumers should always prefer `^`.
|
|
16
|
+
|
|
17
|
+
If using any of Fluid Framework's unstable APIs (for example, its `beta` APIs), we recommend using a more constrained version range, such as `~`.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
To get started, install the package by running the following command:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm i @fluidframework/core-utils
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Importing from this package
|
|
28
|
+
|
|
29
|
+
This package leverages [package.json exports](https://nodejs.org/api/packages.html#exports) to separate its APIs by support level.
|
|
30
|
+
For more information on the related support guarantees, see [API Support Levels](https://fluidframework.com/docs/build/releases-and-apitags/#api-support-levels).
|
|
31
|
+
|
|
32
|
+
To access the `public` ([SemVer](https://semver.org/)) APIs, import via `@fluidframework/core-utils` like normal.
|
|
33
|
+
|
|
34
|
+
To access the `legacy` APIs, import via `@fluidframework/core-utils/legacy`.
|
|
35
|
+
|
|
36
|
+
## API Documentation
|
|
37
|
+
|
|
38
|
+
API documentation for **@fluidframework/core-utils** is available at <https://fluidframework.com/docs/apis/core-utils>.
|
|
39
|
+
|
|
40
|
+
<!-- prettier-ignore-end -->
|
|
10
41
|
|
|
11
42
|
<!-- AUTO-GENERATED-CONTENT:END -->
|
|
12
43
|
|
|
@@ -36,27 +67,80 @@ If you want to add code that does not meet these requirements, these other packa
|
|
|
36
67
|
**core-interfaces** package.
|
|
37
68
|
- **Shared implementation code with dependencies** should be put in the **client-utils** package.
|
|
38
69
|
|
|
39
|
-
<!-- AUTO-GENERATED-CONTENT:START (
|
|
70
|
+
<!-- AUTO-GENERATED-CONTENT:START (LIBRARY_PACKAGE_README_FOOTER) -->
|
|
40
71
|
|
|
41
72
|
<!-- prettier-ignore-start -->
|
|
42
73
|
<!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
|
|
43
74
|
|
|
44
|
-
##
|
|
75
|
+
## Minimum Client Requirements
|
|
45
76
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
77
|
+
These are the platform requirements for the current version of Fluid Framework Client Packages.
|
|
78
|
+
These requirements err on the side of being too strict since within a major version they can be relaxed over time, but not made stricter.
|
|
79
|
+
For Long Term Support (LTS) versions this can require supporting these platforms for several years.
|
|
49
80
|
|
|
50
|
-
|
|
81
|
+
It is likely that other configurations will work, but they are not supported: if they stop working, we do not consider that a bug.
|
|
82
|
+
If you would benefit from support for something not listed here, file an issue and the product team will evaluate your request.
|
|
83
|
+
When making such a request please include if the configuration already works (and thus the request is just that it becomes officially supported), or if changes are required to get it working.
|
|
51
84
|
|
|
52
|
-
|
|
85
|
+
### Supported Runtimes
|
|
53
86
|
|
|
54
|
-
|
|
87
|
+
- NodeJs ^20.10.0 except that we will drop support for it [when NodeJs 20 loses its upstream support on 2026-04-30](https://github.com/nodejs/release#release-schedule), and will support a newer LTS version of NodeJS (22) at least 1 year before 20 is end-of-life. This same policy applies to NodeJS 22 when it is end of life (2027-04-30).
|
|
88
|
+
- Modern browsers supporting the es2022 standard library: in response to asks we can add explicit support for using babel to polyfill to target specific standards or runtimes (meaning we can avoid/remove use of things that don't polyfill robustly, but otherwise target modern standards).
|
|
55
89
|
|
|
56
|
-
|
|
90
|
+
### Supported Tools
|
|
57
91
|
|
|
58
|
-
|
|
59
|
-
|
|
92
|
+
- TypeScript 5.4:
|
|
93
|
+
- All [`strict`](https://www.typescriptlang.org/tsconfig) options are supported.
|
|
94
|
+
- [`strictNullChecks`](https://www.typescriptlang.org/tsconfig) is required.
|
|
95
|
+
- [Configuration options deprecated in 5.0](https://github.com/microsoft/TypeScript/issues/51909) are not supported.
|
|
96
|
+
- `exactOptionalPropertyTypes` is currently not fully supported.
|
|
97
|
+
If used, narrowing members of Fluid Framework types types using `in`, `Reflect.has`, `Object.hasOwn` or `Object.prototype.hasOwnProperty` should be avoided as they may incorrectly exclude `undefined` from the possible values in some cases.
|
|
98
|
+
- [webpack](https://webpack.js.org/) 5
|
|
99
|
+
- We are not intending to be prescriptive about what bundler to use.
|
|
100
|
+
Other bundlers which can handle ES Modules should work, but webpack is the only one we actively test.
|
|
101
|
+
|
|
102
|
+
### Module Resolution
|
|
103
|
+
|
|
104
|
+
[`Node16`, `NodeNext`, or `Bundler`](https://www.typescriptlang.org/tsconfig#moduleResolution) resolution should be used with TypeScript compilerOptions to follow the [Node.js v12+ ESM Resolution and Loading algorithm](https://nodejs.github.io/nodejs.dev/en/api/v20/esm/#resolution-and-loading-algorithm).
|
|
105
|
+
Node10 resolution is not supported as it does not support Fluid Framework's API structuring pattern that is used to distinguish stable APIs from those that are in development.
|
|
106
|
+
|
|
107
|
+
### Module Formats
|
|
108
|
+
|
|
109
|
+
- ES Modules:
|
|
110
|
+
ES Modules are the preferred way to consume our client packages (including in NodeJs) and consuming our client packages from ES Modules is fully supported.
|
|
111
|
+
- CommonJs:
|
|
112
|
+
Consuming our client packages as CommonJs is supported only in NodeJS and only for the cases listed below.
|
|
113
|
+
This is done to accommodate some workflows without good ES Module support.
|
|
114
|
+
If you have a workflow you would like included in this list, file an issue.
|
|
115
|
+
Once this list of workflows motivating CommonJS support is empty, we may drop support for CommonJS one year after notice of the change is posted here.
|
|
116
|
+
|
|
117
|
+
- Testing with Jest (which lacks [stable ESM support](https://jestjs.io/docs/ecmascript-modules) due to [unstable APIs in NodeJs](https://github.com/nodejs/node/issues/37648))
|
|
118
|
+
|
|
119
|
+
## Contribution Guidelines
|
|
120
|
+
|
|
121
|
+
There are many ways to [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid.
|
|
122
|
+
|
|
123
|
+
- Participate in Q&A in our [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions).
|
|
124
|
+
- [Submit bugs](https://github.com/microsoft/FluidFramework/issues) and help us verify fixes as they are checked in.
|
|
125
|
+
- Review the [source code changes](https://github.com/microsoft/FluidFramework/pulls).
|
|
126
|
+
- [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md).
|
|
127
|
+
|
|
128
|
+
Detailed instructions for working in the repo can be found in the [Wiki](https://github.com/microsoft/FluidFramework/wiki).
|
|
129
|
+
|
|
130
|
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
131
|
+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
|
132
|
+
|
|
133
|
+
This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
|
|
134
|
+
Use of these trademarks or logos must follow Microsoft’s [Trademark & Brand Guidelines](https://www.microsoft.com/trademarks).
|
|
135
|
+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
|
|
136
|
+
|
|
137
|
+
## Help
|
|
138
|
+
|
|
139
|
+
Not finding what you're looking for in this README? Check out [fluidframework.com](https://fluidframework.com/docs/).
|
|
140
|
+
|
|
141
|
+
Still not finding what you're looking for? Please [file an issue](https://github.com/microsoft/FluidFramework/wiki/Submitting-Bugs-and-Feature-Requests).
|
|
142
|
+
|
|
143
|
+
Thank you!
|
|
60
144
|
|
|
61
145
|
## Trademark
|
|
62
146
|
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.current.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/public.d.ts"
|
|
5
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.legacy.json"
|
|
4
4
|
}
|
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "../../../common/build/build-common/api-extractor-
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-model.esm.json"
|
|
4
4
|
}
|
package/dist/legacy.d.ts
CHANGED
package/dist/public.d.ts
CHANGED
package/internal.d.ts
CHANGED
package/legacy.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints" in @
|
|
8
|
+
* Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
export * from "./lib/legacy.js";
|
package/lib/legacy.d.ts
CHANGED
package/lib/public.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/core-utils",
|
|
3
|
-
"version": "2.1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Not intended for use outside the Fluid client repo.",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -68,13 +68,13 @@
|
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@arethetypeswrong/cli": "^0.15.2",
|
|
71
|
-
"@biomejs/biome": "
|
|
72
|
-
"@fluid-internal/mocha-test-setup": "2.1.0
|
|
71
|
+
"@biomejs/biome": "~1.8.3",
|
|
72
|
+
"@fluid-internal/mocha-test-setup": "~2.1.0",
|
|
73
73
|
"@fluid-tools/benchmark": "^0.47.0",
|
|
74
|
-
"@fluid-tools/build-cli": "^0.
|
|
74
|
+
"@fluid-tools/build-cli": "^0.41.0",
|
|
75
75
|
"@fluidframework/build-common": "^2.0.3",
|
|
76
|
-
"@fluidframework/build-tools": "^0.
|
|
77
|
-
"@fluidframework/core-utils-previous": "npm:@fluidframework/core-utils@2.0.0
|
|
76
|
+
"@fluidframework/build-tools": "^0.41.0",
|
|
77
|
+
"@fluidframework/core-utils-previous": "npm:@fluidframework/core-utils@2.0.0",
|
|
78
78
|
"@fluidframework/eslint-config-fluid": "^5.3.0",
|
|
79
79
|
"@microsoft/api-extractor": "^7.45.1",
|
|
80
80
|
"@types/mocha": "^9.1.1",
|
|
@@ -105,17 +105,18 @@
|
|
|
105
105
|
"bench": "mocha --recursive \"lib/test/**/*.spec.*js\" --timeout 999999 --perfMode --parentProcess --fgrep @Benchmark --reporter @fluid-tools/benchmark/dist/MochaReporter.js",
|
|
106
106
|
"bench:profile": "mocha --recursive \"lib/test/**/*.spec.*js\" --v8-prof --v8-logfile=profile.log --v8-no-logfile-per-isolate --timeout 999999 --perfMode --fgrep @Benchmark --reporter @fluid-tools/benchmark/dist/MochaReporter.js && node --prof-process profile.log > profile.txt && rimraf profile.log && echo See results in profile.txt",
|
|
107
107
|
"build": "fluid-build . --task build",
|
|
108
|
+
"build:api-reports": "concurrently \"npm:build:api-reports:*\"",
|
|
109
|
+
"build:api-reports:current": "api-extractor run --local --config api-extractor/api-extractor.current.json",
|
|
110
|
+
"build:api-reports:legacy": "api-extractor run --local --config api-extractor/api-extractor.legacy.json",
|
|
108
111
|
"build:commonjs": "fluid-build . --task commonjs",
|
|
109
112
|
"build:compile": "fluid-build . --task compile",
|
|
110
|
-
"build:docs": "
|
|
111
|
-
"build:docs:current": "api-extractor run --local",
|
|
112
|
-
"build:docs:legacy": "api-extractor run --local --config api-extractor/api-extractor.legacy.json",
|
|
113
|
+
"build:docs": "api-extractor run --local",
|
|
113
114
|
"build:esnext": "tsc --project ./tsconfig.json",
|
|
114
115
|
"build:test": "npm run build:test:esm && npm run build:test:cjs",
|
|
115
116
|
"build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
|
|
116
117
|
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
|
|
117
118
|
"check:are-the-types-wrong": "attw --pack .",
|
|
118
|
-
"check:biome": "biome check .
|
|
119
|
+
"check:biome": "biome check .",
|
|
119
120
|
"check:exports": "concurrently \"npm:check:exports:*\"",
|
|
120
121
|
"check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json",
|
|
121
122
|
"check:exports:cjs:legacy": "api-extractor run --config api-extractor/api-extractor-lint-legacy.cjs.json",
|
|
@@ -124,14 +125,15 @@
|
|
|
124
125
|
"check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
|
|
125
126
|
"check:format": "npm run check:biome",
|
|
126
127
|
"check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
127
|
-
"ci:build:
|
|
128
|
-
"ci:build:
|
|
129
|
-
"ci:build:
|
|
128
|
+
"ci:build:api-reports": "concurrently \"npm:ci:build:api-reports:*\"",
|
|
129
|
+
"ci:build:api-reports:current": "api-extractor run --config api-extractor/api-extractor.current.json",
|
|
130
|
+
"ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
|
|
131
|
+
"ci:build:docs": "api-extractor run",
|
|
130
132
|
"clean": "rimraf --glob dist lib \"*.d.ts\" \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
131
133
|
"eslint": "eslint --format stylish src",
|
|
132
134
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
133
135
|
"format": "npm run format:biome",
|
|
134
|
-
"format:biome": "biome check . --
|
|
136
|
+
"format:biome": "biome check . --write",
|
|
135
137
|
"format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
136
138
|
"lint": "fluid-build . --task lint",
|
|
137
139
|
"lint:fix": "fluid-build . --task eslint:fix --task format",
|