As part of prepping for the next release of OpenTelemetry we found some code patterns that were going to become a large maintenance burden for us, primarily around the parenting of spans. To make this easier I've removed as many duplicate implementation of createSpan and tried to centralize everything into core-tracing instead.
This won't completely remove changes needed for a newer version of OpenTelemetry but it'll eliminate one of the bigger bottlenecks.
This PR removes our dependency on the unmaintained package "karma-remap-istanbul" and replaces it with a smaller karma plugin ("karma-sourcemap-loader") that allows karma-coverage to load source maps from the disk correctly.
I tested and confirmed that the generated coverage data has the correct source TS files.
* [Docs] Upgrade typedoc to v0.15.2 to match that used by docs team
* standardize the docs script for cosmos, kv-admin, comm-common, and storage-internal-avro
This newly added command `docs` can help increase the quality of our documentation comments. It enables us to have a tight feedback loop on what is being generated as a documentation of our packages. I am pinning `typedoc` to v0.15.0 for now because this is the version being used for generating docs at `docs.microsoft.com`. This version should be updated when that team updates theirs.
Fixes https://github.com/Azure/azure-sdk-for-js/issues/12928
# Status quo
Some of our documentation comments are [TypeDoc](http://typedoc.org/guides/doccomments/) and some of them are JSDoc with type description in the comments even though it is for typed TS code.
# Standardization
I decided the best way to go about this is to migrate to [TSDoc](https://github.com/Microsoft/tsdoc) and enforcing it using the [tsdoc eslint plugin](https://www.npmjs.com/package/eslint-plugin-tsdoc).
Pros:
- TSDoc is a proposal to standardize the doc comments used in TypeScript code, so that different tools can extract content without getting confused by each other’s markup.
- It is being developed at Microsoft, with the TypeScript team.
- It has an ESLint plugin that enforces it and will error when it sees unsupported tags (e.g. `@memberof`, `@class`, `@constructor`, `@type`, etc).
Cons:
- It is still in early stages (adoption is ongoing though, e.g. it is being used by the API extractor tool).
- TSDoc != TypeDoc (the tool we currently use for generating our documentation). However, TypeDoc plans to officially support TSDoc in v1.1 (see https://github.com/TypeStrong/typedoc/issues/1266).
# Notable tag changes
- `@ignore` is a JSDoc tag and was used in conjunction with `@internal`. These tags were needed because [TypeDoc does not yet support documenting only definitions exported by the entry point](https://github.com/TypeStrong/typedoc/pull/1184#issuecomment-650809143) and still documents everything exported from all files. I removed `@ignore` because [`@internal`](https://tsdoc.org/pages/tags/internal) only should suffice
- `@ignore` when used alone is replaced with TypeDoc's [`hidden`](http://typedoc.org/guides/doccomments/#hidden-and-ignore). EDIT: I replaced `@ignore` with [`@hidden`](https://github.com/TypeStrong/typedoc/releases/tag/v0.12.0) because the TypeDoc version used for `docs.microsoft.com` is v0.15.0 which does not support `--stripInternal`. After, they upgrade, I will remove all `@hidden` tags.
- `@summary` is gone because it is not part of TSDoc or TypeDoc
This PR applies the changes to packages that respect our linting rules. Ones that do not yet will be migrated later when we start fixing their linting issues.
Here are vanilla examples of TypeDoc 0.18.0 (version used by our EngSys) after the changes here as a sanity check:
- random method:
![typedoc](https://user-images.githubusercontent.com/6074665/102302881-f6186380-3f27-11eb-8cc6-93e4c8f7d42d.PNG)
- a class constructor that used to have type information in the documentation comments:
![constructor](https://user-images.githubusercontent.com/6074665/102357078-f8a4a880-3f7b-11eb-92d1-c086ecc39c0b.PNG)
# `@hidden` works the same way as `@ignore`
Here are the list of documented functions generated by `TypeDoc v0.15.0` for the text analytics package and there is no function that was marked `@hidden`, e.g. `combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion`
![image](https://user-images.githubusercontent.com/6074665/102426196-e018aa80-3fdc-11eb-8b69-1ac265391fad.png)
# Things to consider
- Our documentation must be generated using the TypeDoc flag [`--stripInternal`](http://typedoc.org/guides/options/#stripinternal)
- Should we add a `docs` npm script to our `package.json`s (similar to [Cosmos's](2424b74f02/sdk/cosmosdb/cosmos/package.json (L60))) so that we can see how our docs are generated as we write our comments?
Fixes https://github.com/Azure/azure-sdk-for-js/issues/3027.
* upgrade TS version and fix compilation issues
* upgrade the linting parser version and fix new linting issues
* fix cosmos sample
* address feedback
* fix linting issues in formrecognizer tests
* use unknown instead of any across our code
* address more issues
* cleanup package.json in core-http
* revert noisy linting changes caused by vanilla eslint rules not TS aware
* allow the poller to have results of type void
* fixing samples
* fix keyvault-certificates' sample
Fixes#12646
Tables service supports ns precision DateTime however JavaScript doesn't. As part of entity deserialization, whenever we get a property with type Edm.DateTime we parse it into a JavaScript Date object, which can lead to losing precision.
To fix this we need to disable the default deserialization for Edm.DateTime and give the user an "edm" object, similar to what we do for Guid and Int64
```typescript
{
partitionKey: "p1",
rowKey: "r1",
blahblah: {type: "DateTime", value:"the date"}
}
```
Closes https://github.com/Azure/azure-sdk-for-js/issues/11489
- As the issue states, there are some unneeded exports in the Javascript samples for Azure Tables that have been removed.
- As reported by @joheredi , the following replacements in the `README.md` have been done (identified as a bug): `entity.PartitionKey` to `entity.partitionKey` and `entity.RowKey` to `entity.rowKey`.
- Also a little typo in the `README.md` in the same section has been fixed.
* Update changlog date and port TS sample to JS
* Update stale package versions
* Return type
* Update sdk/tables/data-tables/samples/javascript/src/batchOperations.js
Co-authored-by: Matt Ellis <matt.ellis@microsoft.com>
* Update sdk/tables/data-tables/samples/typescript/src/batchOperations.ts
Co-authored-by: Matt Ellis <matt.ellis@microsoft.com>
Co-authored-by: Matt Ellis <matt.ellis@microsoft.com>
* Fill out README
* Note about AAD
* Add table and entity to Key Concepts
* Remove extra sample
* Address feedback
* update logger import
* Fix typo and add browser support info
* Add integration tests for Create Table and Table Entity
* Format
* rename azure-tables to azure-data-tables
* int and float test
* Address PR comments
* Fix folder name
* azure-data-tables
* Remove stale api surface
* rename to data-tables
* update sample ur;
* Rename in ci
* Accept arrays for select in query options
* Add odata helper function for escaping filter expressions
* Add odata tests
Co-authored-by: Jose Manuel Heredia Hidalgo <joheredi@microsoft.com>
* Add an EdmGUID class
* Add an EdmInt64 class
* Add serialization.ts file
* Make client methods public
* Serialize entities in TableServiceClient
* Deserialize entities in TableServiceClient
* Add support for Binary data serialization
* Fix deserialization for getEntity
* Fix deserialize return type
* Fix getEntity return type
* Include other EDM types for serialization
* Remove isUint8Array method
* Rename econde and decode functions to include base64
* use isValidUuid from core-http
* Add isSafeInteger to Int64 class
* Convert scientific notation to standard notation
* Regenerate using the new swagger
* Add generic types to entity operations
* Use types instead of interfaces
* Update serializer
* Add unit tests for serialization/deserialization
* Fix PR comments
* Add unit tests for bufferSerializer utility function
* Fix PR comments
* update the CONTRIBUTING.md guide to point to the automatic debug configuration feature in vscode
* delete all custome vscode configs
* factoring out coverage scripts so that mocha with ts-node can work with vscode debugger
* lower case Azure in package.json across packages
* remove redundancies
* camel case to lower case
* remove more redundancies
* Fix broken link schema registry samples
Co-authored-by: Ramya Achutha Rao <ramyar@microsoft.com>
* Standardize prettier configurations across the repo
* update relative paths
* rushx format text analytics
* ignore api.md files
* adding ignore-path parameter to the check-format and format scripts in keyvault-admin
* Add Autorest generated files
* Implement TableServiceClient methods
* Remove the customizations from the swagger readme file
* Update Autorest generated files to fix function docs and header names
* Add models.ts file for all named exports
* Export the missing models
* Remove the unused test files
* Fix the comments for the constructor
* [keyvault-common,table] bump core-http dep version to 1.1.4
These two libraries were not updated in #9539, possibly due to the exception and
tables change comes after the the exception was made.
* Disable PR validation for Tables for now