From 9fa5ae0ef7fa1c001b2095897df6ace526f24714 Mon Sep 17 00:00:00 2001 From: Jason Hartman Date: Tue, 3 Sep 2024 14:22:07 -0700 Subject: [PATCH] build(client): add experimental presence package (#22359) empty private shell package [AB#7915](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/7915) --- PACKAGES.md | 2 +- packages/framework/presence/.eslintrc.cjs | 20 +++ packages/framework/presence/.npmignore | 10 ++ packages/framework/presence/LICENSE | 21 ++++ packages/framework/presence/README.md | 115 ++++++++++++++++++ .../framework/presence/api-extractor.json | 4 + .../api-extractor-lint-bundle.json | 5 + .../api-extractor-lint-index.cjs.json | 5 + .../api-extractor-lint-index.esm.json | 5 + .../presence/api-report/presence.alpha.api.md | 7 ++ .../presence/api-report/presence.beta.api.md | 7 ++ .../api-report/presence.public.api.md | 7 ++ packages/framework/presence/package.json | 106 ++++++++++++++++ .../framework/presence/prettier.config.cjs | 8 ++ packages/framework/presence/src/index.ts | 14 +++ packages/framework/presence/src/test/empty.ts | 8 ++ .../framework/presence/src/test/tsconfig.json | 18 +++ packages/framework/presence/tsconfig.cjs.json | 7 ++ packages/framework/presence/tsconfig.json | 12 ++ packages/framework/presence/tsdoc.json | 4 + pnpm-lock.yaml | 42 +++++++ 21 files changed, 426 insertions(+), 1 deletion(-) create mode 100644 packages/framework/presence/.eslintrc.cjs create mode 100644 packages/framework/presence/.npmignore create mode 100644 packages/framework/presence/LICENSE create mode 100644 packages/framework/presence/README.md create mode 100644 packages/framework/presence/api-extractor.json create mode 100644 packages/framework/presence/api-extractor/api-extractor-lint-bundle.json create mode 100644 packages/framework/presence/api-extractor/api-extractor-lint-index.cjs.json create mode 100644 packages/framework/presence/api-extractor/api-extractor-lint-index.esm.json create mode 100644 packages/framework/presence/api-report/presence.alpha.api.md create mode 100644 packages/framework/presence/api-report/presence.beta.api.md create mode 100644 packages/framework/presence/api-report/presence.public.api.md create mode 100644 packages/framework/presence/package.json create mode 100644 packages/framework/presence/prettier.config.cjs create mode 100644 packages/framework/presence/src/index.ts create mode 100644 packages/framework/presence/src/test/empty.ts create mode 100644 packages/framework/presence/src/test/tsconfig.json create mode 100644 packages/framework/presence/tsconfig.cjs.json create mode 100644 packages/framework/presence/tsconfig.json create mode 100644 packages/framework/presence/tsdoc.json diff --git a/PACKAGES.md b/PACKAGES.md index aad7d099ab1c..134d8836b6cc 100644 --- a/PACKAGES.md +++ b/PACKAGES.md @@ -105,7 +105,7 @@ The dependencies between layers are enforced by the layer-check command._ | Packages | Layer Dependencies | | --- | --- | -| - [@fluid-experimental/data-objects](/experimental/framework/data-objects)
- [@fluidframework/fluid-static](/packages/framework/fluid-static)
- [@fluid-experimental/property-binder](/experimental/PropertyDDS/packages/property-binder)
- [@fluid-experimental/property-changeset](/experimental/PropertyDDS/packages/property-changeset)
- [@fluid-experimental/property-common](/experimental/PropertyDDS/packages/property-common)
- [@fluid-internal/platform-dependent](/experimental/PropertyDDS/packages/property-common/platform-dependent) (private)
- [@fluid-experimental/property-dds](/experimental/PropertyDDS/packages/property-dds)
- [@fluid-experimental/property-inspector-table](/experimental/PropertyDDS/packages/property-inspector-table)
- [@fluid-experimental/property-properties](/experimental/PropertyDDS/packages/property-properties)
- [@fluid-experimental/property-proxy](/experimental/PropertyDDS/packages/property-proxy)
- [@fluid-experimental/property-query](/experimental/PropertyDDS/packages/property-query)
- [@fluid-experimental/property-shared-tree-interop](/experimental/PropertyDDS/packages/property-shared-tree-interop)
- [@fluid-experimental/last-edited](/experimental/framework/last-edited)
- [@fluid-experimental/tree-react-api](/experimental/framework/tree-react-api)
- [@fluidframework/agent-scheduler](/packages/framework/agent-scheduler)
- [@fluidframework/aqueduct](/packages/framework/aqueduct)
- [@fluid-experimental/attributor](/packages/framework/attributor)
- [@fluidframework/app-insights-logger](/packages/framework/client-logger/app-insights-logger)
- [@fluidframework/fluid-telemetry](/packages/framework/client-logger/fluid-telemetry)
- [@fluid-experimental/data-object-base](/packages/framework/data-object-base)
- [@fluid-experimental/dds-interceptions](/packages/framework/dds-interceptions)
- [@fluid-experimental/oldest-client-observer](/packages/framework/oldest-client-observer)
- [@fluidframework/request-handler](/packages/framework/request-handler)
- [@fluidframework/synthesize](/packages/framework/synthesize)
- [@fluidframework/undo-redo](/packages/framework/undo-redo) | - [Core-Interfaces](#Core-Interfaces)
- [Driver-Definitions](#Driver-Definitions)
- [Container-Definitions](#Container-Definitions)
- [Core-Utils](#Core-Utils)
- [Client-Utils](#Client-Utils)
- [Telemetry-Utils](#Telemetry-Utils)
- [Loader](#Loader)
- [Runtime](#Runtime)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  | +| - [@fluid-experimental/data-objects](/experimental/framework/data-objects)
- [@fluidframework/fluid-static](/packages/framework/fluid-static)
- [@fluid-experimental/property-binder](/experimental/PropertyDDS/packages/property-binder)
- [@fluid-experimental/property-changeset](/experimental/PropertyDDS/packages/property-changeset)
- [@fluid-experimental/property-common](/experimental/PropertyDDS/packages/property-common)
- [@fluid-internal/platform-dependent](/experimental/PropertyDDS/packages/property-common/platform-dependent) (private)
- [@fluid-experimental/property-dds](/experimental/PropertyDDS/packages/property-dds)
- [@fluid-experimental/property-inspector-table](/experimental/PropertyDDS/packages/property-inspector-table)
- [@fluid-experimental/property-properties](/experimental/PropertyDDS/packages/property-properties)
- [@fluid-experimental/property-proxy](/experimental/PropertyDDS/packages/property-proxy)
- [@fluid-experimental/property-query](/experimental/PropertyDDS/packages/property-query)
- [@fluid-experimental/property-shared-tree-interop](/experimental/PropertyDDS/packages/property-shared-tree-interop)
- [@fluid-experimental/last-edited](/experimental/framework/last-edited)
- [@fluid-experimental/tree-react-api](/experimental/framework/tree-react-api)
- [@fluidframework/agent-scheduler](/packages/framework/agent-scheduler)
- [@fluidframework/aqueduct](/packages/framework/aqueduct)
- [@fluid-experimental/attributor](/packages/framework/attributor)
- [@fluidframework/app-insights-logger](/packages/framework/client-logger/app-insights-logger)
- [@fluidframework/fluid-telemetry](/packages/framework/client-logger/fluid-telemetry)
- [@fluid-experimental/data-object-base](/packages/framework/data-object-base)
- [@fluid-experimental/dds-interceptions](/packages/framework/dds-interceptions)
- [@fluid-experimental/oldest-client-observer](/packages/framework/oldest-client-observer)
- [@fluid-experimental/presence](/packages/framework/presence) (private)
- [@fluidframework/request-handler](/packages/framework/request-handler)
- [@fluidframework/synthesize](/packages/framework/synthesize)
- [@fluidframework/undo-redo](/packages/framework/undo-redo) | - [Core-Interfaces](#Core-Interfaces)
- [Driver-Definitions](#Driver-Definitions)
- [Container-Definitions](#Container-Definitions)
- [Core-Utils](#Core-Utils)
- [Client-Utils](#Client-Utils)
- [Telemetry-Utils](#Telemetry-Utils)
- [Loader](#Loader)
- [Runtime](#Runtime)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  | ### Build diff --git a/packages/framework/presence/.eslintrc.cjs b/packages/framework/presence/.eslintrc.cjs new file mode 100644 index 000000000000..a2039bb839bd --- /dev/null +++ b/packages/framework/presence/.eslintrc.cjs @@ -0,0 +1,20 @@ +/*! + * Copyright (c) Microsoft Corporation and contributors. All rights reserved. + * Licensed under the MIT License. + */ + +module.exports = { + extends: [require.resolve("@fluidframework/eslint-config-fluid/strict"), "prettier"], + parserOptions: { + project: ["./tsconfig.json", "./src/test/tsconfig.json"], + }, + overrides: [ + { + // Rules only for test files + files: ["*.spec.ts", "src/test/**"], + rules: { + "@typescript-eslint/no-explicit-any": "error", + }, + }, + ], +}; diff --git a/packages/framework/presence/.npmignore b/packages/framework/presence/.npmignore new file mode 100644 index 000000000000..3f748399c54b --- /dev/null +++ b/packages/framework/presence/.npmignore @@ -0,0 +1,10 @@ +nyc +*.log +**/*.tsbuildinfo +src/test +dist/test +lib/test +api-extractor +**/_api-extractor-temp/** +prettier.config.cjs +tsdoc.json diff --git a/packages/framework/presence/LICENSE b/packages/framework/presence/LICENSE new file mode 100644 index 000000000000..60af0a6a40e9 --- /dev/null +++ b/packages/framework/presence/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) Microsoft Corporation and contributors. All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/framework/presence/README.md b/packages/framework/presence/README.md new file mode 100644 index 000000000000..b93a4e2beb34 --- /dev/null +++ b/packages/framework/presence/README.md @@ -0,0 +1,115 @@ +# @fluid-experimental/presence + +A session only DDS for lightweight data sharing. + + + + + + +**IMPORTANT: This package is experimental.** +**Its APIs may change without notice.** + +**Do not use in production scenarios.** + +## Using Fluid Framework libraries + +When taking a dependency on a Fluid Framework library's public APIs, we recommend using a `^` (caret) version range, such as `^1.3.4`. +While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries, +library consumers should always prefer `^`. + +If using any of Fluid Framework's unstable APIs (for example, its `beta` APIs), we recommend using a more constrained version range, such as `~`. + +## Installation + +To get started, install the package by running the following command: + +```bash +npm i @fluid-experimental/presence +``` + +## API Documentation + +API documentation for **@fluid-experimental/presence** is available at . + +## Minimum Client Requirements + +These are the platform requirements for the current version of Fluid Framework Client Packages. +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. +For Long Term Support (LTS) versions this can require supporting these platforms for several years. + +It is likely that other configurations will work, but they are not supported: if they stop working, we do not consider that a bug. +If you would benefit from support for something not listed here, file an issue and the product team will evaluate your request. +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. + +### Supported Runtimes + +- 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). +- 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). + +### Supported Tools + +- TypeScript 5.4: + - All [`strict`](https://www.typescriptlang.org/tsconfig) options are supported. + - [`strictNullChecks`](https://www.typescriptlang.org/tsconfig) is required. + - [Configuration options deprecated in 5.0](https://github.com/microsoft/TypeScript/issues/51909) are not supported. + - `exactOptionalPropertyTypes` is currently not fully supported. + 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. +- [webpack](https://webpack.js.org/) 5 + - We are not intending to be prescriptive about what bundler to use. + Other bundlers which can handle ES Modules should work, but webpack is the only one we actively test. + +### Module Resolution + +[`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). +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. + +### Module Formats + +- ES Modules: + 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. +- CommonJs: + Consuming our client packages as CommonJs is supported only in NodeJS and only for the cases listed below. + This is done to accommodate some workflows without good ES Module support. + If you have a workflow you would like included in this list, file an issue. + 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. + + - 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)) + +## Contribution Guidelines + +There are many ways to [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid. + +- Participate in Q&A in our [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions). +- [Submit bugs](https://github.com/microsoft/FluidFramework/issues) and help us verify fixes as they are checked in. +- Review the [source code changes](https://github.com/microsoft/FluidFramework/pulls). +- [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md). + +Detailed instructions for working in the repo can be found in the [Wiki](https://github.com/microsoft/FluidFramework/wiki). + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +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. + +This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services. +Use of these trademarks or logos must follow Microsoft’s [Trademark & Brand Guidelines](https://www.microsoft.com/trademarks). +Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. + +## Help + +Not finding what you're looking for in this README? Check out [fluidframework.com](https://fluidframework.com/docs/). + +Still not finding what you're looking for? Please [file an issue](https://github.com/microsoft/FluidFramework/wiki/Submitting-Bugs-and-Feature-Requests). + +Thank you! + +## Trademark + +This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services. + +Use of these trademarks or logos must follow Microsoft's [Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). + +Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. + + + + diff --git a/packages/framework/presence/api-extractor.json b/packages/framework/presence/api-extractor.json new file mode 100644 index 000000000000..0747e2de8edf --- /dev/null +++ b/packages/framework/presence/api-extractor.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "extends": "../../../common/build/build-common/api-extractor-base.esm.no-legacy.json" +} diff --git a/packages/framework/presence/api-extractor/api-extractor-lint-bundle.json b/packages/framework/presence/api-extractor/api-extractor-lint-bundle.json new file mode 100644 index 000000000000..3ae7ad05c80a --- /dev/null +++ b/packages/framework/presence/api-extractor/api-extractor-lint-bundle.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "extends": "/../../../common/build/build-common/api-extractor-lint.json", + "mainEntryPointFilePath": "/lib/index.d.ts" +} diff --git a/packages/framework/presence/api-extractor/api-extractor-lint-index.cjs.json b/packages/framework/presence/api-extractor/api-extractor-lint-index.cjs.json new file mode 100644 index 000000000000..4321254a1b6c --- /dev/null +++ b/packages/framework/presence/api-extractor/api-extractor-lint-index.cjs.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "extends": "/../../../common/build/build-common/api-extractor-lint.entrypoint.json", + "mainEntryPointFilePath": "/dist/index.d.ts" +} diff --git a/packages/framework/presence/api-extractor/api-extractor-lint-index.esm.json b/packages/framework/presence/api-extractor/api-extractor-lint-index.esm.json new file mode 100644 index 000000000000..16c64c9ea622 --- /dev/null +++ b/packages/framework/presence/api-extractor/api-extractor-lint-index.esm.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "extends": "/../../../common/build/build-common/api-extractor-lint.entrypoint.json", + "mainEntryPointFilePath": "/lib/index.d.ts" +} diff --git a/packages/framework/presence/api-report/presence.alpha.api.md b/packages/framework/presence/api-report/presence.alpha.api.md new file mode 100644 index 000000000000..016db5b7c39e --- /dev/null +++ b/packages/framework/presence/api-report/presence.alpha.api.md @@ -0,0 +1,7 @@ +## Alpha API Report File for "@fluid-experimental/presence" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +``` diff --git a/packages/framework/presence/api-report/presence.beta.api.md b/packages/framework/presence/api-report/presence.beta.api.md new file mode 100644 index 000000000000..590cf426be20 --- /dev/null +++ b/packages/framework/presence/api-report/presence.beta.api.md @@ -0,0 +1,7 @@ +## Beta API Report File for "@fluid-experimental/presence" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +``` diff --git a/packages/framework/presence/api-report/presence.public.api.md b/packages/framework/presence/api-report/presence.public.api.md new file mode 100644 index 000000000000..ded8888c95ec --- /dev/null +++ b/packages/framework/presence/api-report/presence.public.api.md @@ -0,0 +1,7 @@ +## Public API Report File for "@fluid-experimental/presence" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +``` diff --git a/packages/framework/presence/package.json b/packages/framework/presence/package.json new file mode 100644 index 000000000000..d206971c1ba4 --- /dev/null +++ b/packages/framework/presence/package.json @@ -0,0 +1,106 @@ +{ + "name": "@fluid-experimental/presence", + "version": "2.3.0", + "private": true, + "description": "A component for lightweight data sharing within a single session", + "homepage": "https://fluidframework.com", + "repository": { + "type": "git", + "url": "https://github.com/microsoft/FluidFramework.git", + "directory": "packages/framework/presence" + }, + "license": "MIT", + "author": "Microsoft and contributors", + "sideEffects": false, + "type": "module", + "exports": { + ".": { + "import": { + "types": "./lib/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + }, + "./internal": { + "import": { + "types": "./lib/index.d.ts", + "default": "./lib/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist/**/*", + "lib/**/*", + "*.d.ts", + "!**/test/**" + ], + "scripts": { + "build": "fluid-build . --task build", + "build:commonjs": "fluid-build . --task commonjs", + "build:compile": "fluid-build . --task compile", + "build:docs": "api-extractor run --local", + "build:esnext": "tsc --project ./tsconfig.json", + "build:test": "tsc --project ./src/test/tsconfig.json", + "check:are-the-types-wrong": "echo skip per issue #112 - node10 requirement: attw --pack .", + "check:biome": "biome check .", + "check:exports": "concurrently \"npm:check:exports:*\"", + "check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json", + "check:exports:cjs:index": "api-extractor run --config api-extractor/api-extractor-lint-index.cjs.json", + "check:exports:esm:index": "api-extractor run --config api-extractor/api-extractor-lint-index.esm.json", + "check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore", + "ci:build:docs": "api-extractor run", + "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp", + "eslint": "eslint --format stylish src", + "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout", + "format": "npm run format:biome", + "format:biome": "biome check . --write", + "format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore", + "lint": "fluid-build . --task lint", + "lint:fix": "fluid-build . --task eslint:fix --task format", + "test": "echo \"No tests yet\"", + "tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist" + }, + "dependencies": {}, + "devDependencies": { + "@arethetypeswrong/cli": "^0.15.2", + "@biomejs/biome": "~1.8.3", + "@fluid-tools/build-cli": "^0.44.0", + "@fluidframework/build-common": "^2.0.3", + "@fluidframework/build-tools": "^0.44.0", + "@fluidframework/eslint-config-fluid": "^5.4.0", + "@microsoft/api-extractor": "^7.45.1", + "concurrently": "^8.2.1", + "copyfiles": "^2.4.1", + "eslint": "~8.55.0", + "prettier": "~3.0.3", + "rimraf": "^4.4.0", + "typescript": "~5.4.5" + }, + "fluidBuild": { + "tasks": { + "build:test": [ + "build:esnext" + ], + "check:exports:bundle-release-tags": [ + "build:esnext" + ], + "check:exports:cjs:index": [ + "tsc" + ], + "check:exports:esm:index": [ + "build:esnext" + ] + } + }, + "typeValidation": { + "disabled": true, + "broken": {} + } +} diff --git a/packages/framework/presence/prettier.config.cjs b/packages/framework/presence/prettier.config.cjs new file mode 100644 index 000000000000..d4870022599f --- /dev/null +++ b/packages/framework/presence/prettier.config.cjs @@ -0,0 +1,8 @@ +/*! + * Copyright (c) Microsoft Corporation and contributors. All rights reserved. + * Licensed under the MIT License. + */ + +module.exports = { + ...require("@fluidframework/build-common/prettier.config.cjs"), +}; diff --git a/packages/framework/presence/src/index.ts b/packages/framework/presence/src/index.ts new file mode 100644 index 000000000000..a99080220971 --- /dev/null +++ b/packages/framework/presence/src/index.ts @@ -0,0 +1,14 @@ +/*! + * Copyright (c) Microsoft Corporation and contributors. All rights reserved. + * Licensed under the MIT License. + */ + +/** + * Experimental package for client presence within a connected session. + * @packageDocumentation + */ + +/** + * @internal + */ +export const empty = "nothing to see here"; diff --git a/packages/framework/presence/src/test/empty.ts b/packages/framework/presence/src/test/empty.ts new file mode 100644 index 000000000000..fe4ac0ceb8ad --- /dev/null +++ b/packages/framework/presence/src/test/empty.ts @@ -0,0 +1,8 @@ +/*! + * Copyright (c) Microsoft Corporation and contributors. All rights reserved. + * Licensed under the MIT License. + */ + +// A test file must exist in order for eslint config that references test tsconfig +// file to be incremental. +console.log("This file intentionally left blank"); diff --git a/packages/framework/presence/src/test/tsconfig.json b/packages/framework/presence/src/test/tsconfig.json new file mode 100644 index 000000000000..5207d3401275 --- /dev/null +++ b/packages/framework/presence/src/test/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../../common/build/build-common/tsconfig.test.node16.json", + "include": ["./**/*"], + "compilerOptions": { + "rootDir": "./", + "outDir": "../../lib/test", + "types": [], + "noImplicitAny": true, + "noUnusedLocals": false, + "noImplicitOverride": true, + "exactOptionalPropertyTypes": true, + }, + "references": [ + { + "path": "../..", + }, + ], +} diff --git a/packages/framework/presence/tsconfig.cjs.json b/packages/framework/presence/tsconfig.cjs.json new file mode 100644 index 000000000000..773d0806da58 --- /dev/null +++ b/packages/framework/presence/tsconfig.cjs.json @@ -0,0 +1,7 @@ +{ + // This config must be used in a "type": "commonjs" environment. (Use fluid-tsc commonjs.) + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + }, +} diff --git a/packages/framework/presence/tsconfig.json b/packages/framework/presence/tsconfig.json new file mode 100644 index 000000000000..bff8efc73210 --- /dev/null +++ b/packages/framework/presence/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../../common/build/build-common/tsconfig.node16.json", + "include": ["src/**/*"], + "exclude": ["src/test/**/*"], + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "noImplicitAny": true, + "noImplicitOverride": true, + "exactOptionalPropertyTypes": true, + }, +} diff --git a/packages/framework/presence/tsdoc.json b/packages/framework/presence/tsdoc.json new file mode 100644 index 000000000000..ecb918da5cb8 --- /dev/null +++ b/packages/framework/presence/tsdoc.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", + "extends": ["../../../common/build/build-common/tsdoc-base.json"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d7bb0dc7fb8a..8a378be3de1d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12093,6 +12093,48 @@ importers: specifier: ~5.4.5 version: 5.4.5 + packages/framework/presence: + devDependencies: + '@arethetypeswrong/cli': + specifier: ^0.15.2 + version: 0.15.2 + '@biomejs/biome': + specifier: ~1.8.3 + version: 1.8.3 + '@fluid-tools/build-cli': + specifier: ^0.44.0 + version: 0.44.0(webpack-cli@4.10.0) + '@fluidframework/build-common': + specifier: ^2.0.3 + version: 2.0.3 + '@fluidframework/build-tools': + specifier: ^0.44.0 + version: 0.44.0 + '@fluidframework/eslint-config-fluid': + specifier: ^5.4.0 + version: 5.4.0(eslint@8.55.0)(typescript@5.4.5) + '@microsoft/api-extractor': + specifier: ^7.45.1 + version: 7.45.1(patch_hash=tos6v6doskwck2kr7bbxweswri)(@types/node@18.19.1) + concurrently: + specifier: ^8.2.1 + version: 8.2.2 + copyfiles: + specifier: ^2.4.1 + version: 2.4.1 + eslint: + specifier: ~8.55.0 + version: 8.55.0 + prettier: + specifier: ~3.0.3 + version: 3.0.3 + rimraf: + specifier: ^4.4.0 + version: 4.4.1 + typescript: + specifier: ~5.4.5 + version: 5.4.5 + packages/framework/request-handler: dependencies: '@fluidframework/container-runtime-definitions':