Skip to content

Commit

Permalink
storage-internal-avro parser (#8893)
Browse files Browse the repository at this point in the history
* IReadable

* Avro compiles

* use storage-internal-avro as shared source in storage-blob

* local build config

* test and bug fix

* rename IReadable to AvroReadable, separate the stream implementation with the interface declaration we need different implementation in browsers

* add "private": true to pacakge.json

* use Record

* me

* fix

* tentative: use string enum instead of string union to avoid two copies of constant string

Co-authored-by: Lin Jian <[email protected]>
  • Loading branch information
ljian3377 and Lin Jian authored May 21, 2020
1 parent cd327ae commit 3262acb
Show file tree
Hide file tree
Showing 39 changed files with 1,212 additions and 34 deletions.
91 changes: 77 additions & 14 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions rush.json
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@
"projectFolder": "sdk/servicebus/service-bus",
"versionPolicyName": "client"
},
{
"packageName": "@azure/storage-internal-avro",
"projectFolder": "sdk/storage/storage-internal-avro",
"versionPolicyName": "utility"
},
{
"packageName": "@azure/storage-blob",
"projectFolder": "sdk/storage/storage-blob",
Expand Down
4 changes: 2 additions & 2 deletions sdk/storage/storage-blob/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "typings/latest/src/index.d.ts",
"mainEntryPointFilePath": "typings/latest/storage-blob/src/index.d.ts",
"docModel": {
"enabled": false
},
Expand Down Expand Up @@ -28,4 +28,4 @@
}
}
}
}
}
21 changes: 11 additions & 10 deletions sdk/storage/storage-blob/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"version": "12.2.0",
"description": "Microsoft Azure Storage SDK for JavaScript - Blob",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
"module": "./dist-esm/storage-blob/src/index.js",
"browser": {
"./dist-esm/src/index.js": "./dist-esm/src/index.browser.js",
"./dist-esm/src/credentials/StorageSharedKeyCredential.js": "./dist-esm/src/credentials/StorageSharedKeyCredential.browser.js",
"./dist-esm/src/utils/utils.node.js": "./dist-esm/src/utils/utils.browser.js",
"./dist-esm/test/utils/index.js": "./dist-esm/test/utils/index.browser.js",
"./dist-esm/src/BatchUtils.js": "./dist-esm/src/BatchUtils.browser.js",
"./dist-esm/src/BlobDownloadResponse.js": "./dist-esm/src/BlobDownloadResponse.browser.js",
"./dist-esm/storage-blob/src/index.js": "./dist-esm/storage-blob/src/index.browser.js",
"./dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.js": "./dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.browser.js",
"./dist-esm/storage-blob/src/utils/utils.node.js": "./dist-esm/storage-blob/src/utils/utils.browser.js",
"./dist-esm/storage-blob/test/utils/index.js": "./dist-esm/storage-blob/test/utils/index.browser.js",
"./dist-esm/storage-blob/src/BatchUtils.js": "./dist-esm/storage-blob/src/BatchUtils.browser.js",
"./dist-esm/storage-blob/src/BlobDownloadResponse.js": "./dist-esm/storage-blob/src/BlobDownloadResponse.browser.js",
"fs": false,
"os": false,
"process": false
Expand Down Expand Up @@ -46,7 +46,7 @@
"execute:samples": "npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples",
"format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "karma start --single-run",
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000 dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js",
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000 dist-esm/storage-blob/test/*.spec.js dist-esm/storage-blob/test/node/*.spec.js",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "eslint -c ../../.eslintrc.old.json src test samples --ext .ts --fix",
"lint": "eslint -c ../../.eslintrc.old.json src test samples --ext .ts -f html -o storage-blob-lintReport.html || exit 0",
Expand All @@ -63,7 +63,8 @@
"files": [
"BreakingChanges.md",
"dist/",
"dist-esm/src/",
"dist-esm/storage-blob/src/",
"dist-esm/storage-internal-avro/src/",
"typings/latest/storage-blob.d.ts",
"typings/3.1/storage-blob.d.ts",
"README.md",
Expand Down Expand Up @@ -161,4 +162,4 @@
"typescript": "~3.8.3",
"util": "^0.12.1"
}
}
}
12 changes: 6 additions & 6 deletions sdk/storage/storage-blob/rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function nodeConfig(test = false) {
"util"
];
const baseConfig = {
input: "dist-esm/src/index.js",
input: "dist-esm/storage-blob/src/index.js",
external: depNames.concat(externalNodeBuiltins),
output: {
file: "dist/index.js",
Expand Down Expand Up @@ -65,9 +65,9 @@ export function nodeConfig(test = false) {
if (test) {
// entry point is every test file
baseConfig.input = [
"dist-esm/test/*.spec.js",
"dist-esm/test/node/*.spec.js",
"dist-esm/src/index.js"
"dist-esm/storage-blob/test/*.spec.js",
"dist-esm/storage-blob/test/node/*.spec.js",
"dist-esm/storage-blob/src/index.js"
];
baseConfig.plugins.unshift(multiEntry());

Expand All @@ -92,7 +92,7 @@ export function nodeConfig(test = false) {

export function browserConfig(test = false) {
const baseConfig = {
input: "dist-esm/src/index.browser.js",
input: "dist-esm/storage-blob/src/index.browser.js",
output: {
file: "dist-browser/azure-storage-blob.js",
banner: banner,
Expand Down Expand Up @@ -159,7 +159,7 @@ export function browserConfig(test = false) {
};

if (test) {
baseConfig.input = ["dist-esm/test/*.spec.js", "dist-esm/test/browser/*.spec.js"];
baseConfig.input = ["dist-esm/storage-blob/test/*.spec.js", "dist-esm/storage-blob/test/browser/*.spec.js"];
baseConfig.plugins.unshift(multiEntry({ exports: false }));
baseConfig.output.file = "dist-test/index.browser.js";
// mark fs-extra as external
Expand Down
4 changes: 2 additions & 2 deletions sdk/storage/storage-blob/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"esModuleInterop": true
},
"compileOnSave": true,
"exclude": ["node_modules", "./samples/**"],
"include": ["./src/**/*.ts", "./test/**/*.ts"]
"exclude": ["node_modules", "../storage-internal-avro/node_modules", "./samples/**"],
"include": ["./src/**/*.ts", "./test/**/*.ts", "../storage-internal-avro/**/*.ts"]
}
3 changes: 3 additions & 0 deletions sdk/storage/storage-internal-avro/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode"]
}
Loading

0 comments on commit 3262acb

Please sign in to comment.