-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core-amqp] move to shared rollup config (#19588)
* [core-amqp] Move to shared rollup config - Use the shared rollup config from dev-tool for product. while working on this, move `StandardAbortMessage` from error.ts to util/constants.ts to break the circular dependency of errors -> utils -> errors. * Remove rollup.base.config.js while keeping rollup.test.config.js. Core-amqp has some dependencies that we don't want to add into the shared rollup config so we take an approach similar to what has been done to Event Hubs and Service Bus tests. * Remove unused `dotenv` code
- Loading branch information
1 parent
298b38a
commit 2736006
Showing
12 changed files
with
72 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,5 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
import { makeConfig } from "@azure/dev-tool/shared-config/rollup"; | ||
|
||
import * as base from "./rollup.base.config"; | ||
|
||
const inputs = []; | ||
|
||
if (!process.env.ONLY_BROWSER) { | ||
inputs.push(base.nodeConfig()); | ||
} | ||
|
||
if (!process.env.ONLY_NODE) { | ||
inputs.push(base.browserConfig()); | ||
} | ||
|
||
export default inputs; | ||
export default makeConfig(require("./package.json")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,58 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
import cjs from "@rollup/plugin-commonjs"; | ||
import inject from "@rollup/plugin-inject"; | ||
import json from "@rollup/plugin-json"; | ||
import multiEntry from "@rollup/plugin-multi-entry"; | ||
import nodeResolve from "@rollup/plugin-node-resolve"; | ||
import replace from "@rollup/plugin-replace"; | ||
import shim from "rollup-plugin-shim"; | ||
import sourcemaps from "rollup-plugin-sourcemaps"; | ||
import { makeConfig, makeBrowserTestConfig } from "@azure/dev-tool/shared-config/rollup"; | ||
|
||
import * as base from "./rollup.base.config"; | ||
const inputs = makeConfig(require("./package.json")); | ||
|
||
// Node tests are run via ts-node | ||
export default [base.browserConfig(true)]; | ||
if (!process.env.ONLY_NODE) { | ||
// service-bus has many dependencies that we do not | ||
// want to bring into the shared rollup config, so | ||
// replace the original test config with a patched one | ||
inputs[1] = makeBrowserTestConfigPatch(); | ||
} | ||
|
||
function makeBrowserTestConfigPatch() { | ||
const config = { ...makeBrowserTestConfig(require("./package.json")) }; | ||
config.plugins = [ | ||
multiEntry({ exports: false }), | ||
sourcemaps(), | ||
replace({ | ||
delimiters: ["", ""], | ||
}), | ||
// fs, net, and tls are used by rhea and need to be shimmed | ||
shim({ | ||
os: `export default { }`, | ||
path: `export default { }`, | ||
}), | ||
nodeResolve({ | ||
mainFields: ["module", "browser"], | ||
preferBuiltins: false, | ||
}), | ||
cjs({ | ||
namedExports: { | ||
chai: ["should", "assert"], | ||
assert: ["equal", "deepEqual", "notEqual"], | ||
}, | ||
}), | ||
// rhea and rhea-promise use the Buffer global which requires | ||
// injection to shim properly | ||
inject({ | ||
modules: { | ||
Buffer: ["buffer", "Buffer"], | ||
process: "process", | ||
}, | ||
exclude: ["./**/package.json"], | ||
}), | ||
json(), | ||
]; | ||
|
||
return config; | ||
} | ||
|
||
export default inputs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters