Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
44 changes: 13 additions & 31 deletions common/config/rush/pnpm-lock.yaml

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

3 changes: 1 addition & 2 deletions packages/autorest.typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"fs-extra": "^11.1.0",
"handlebars": "^4.7.7",
"lodash": "^4.17.21",
"prettier": "^1.19.1",
"prettier": "^3.1.0",
"source-map-support": "^0.5.16",
"ts-morph": "^15.1.0",
"@azure/core-auth": "^1.3.2",
Expand All @@ -88,7 +88,6 @@
"@types/js-yaml": "3.12.1",
"@types/mocha": "^5.2.7",
"@types/node": "^18.0.0",
"@types/prettier": "^1.18.4",
"@types/sinon": "^10.0.0",
"@types/xmlbuilder": "0.0.34",
"@types/yargs": "^17.0.10",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export async function generateRestLevelClient() {

// Format the contents if necessary
if (isJson || isSourceCode) {
fileContents = format(
fileContents = await format(
fileContents,
isJson ? prettierJSONOptions : prettierTypeScriptOptions
);
Expand Down
2 changes: 1 addition & 1 deletion packages/autorest.typescript/src/typescriptGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export async function generateTypeScriptLibrary(

// Format the contents if necessary
if (isJson || isSourceCode) {
fileContents = prettier.format(
fileContents = await prettier.format(
Copy link
Copy Markdown
Member

@MaryGao MaryGao Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this introduced by upgrade?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, v3 makes the method async.

fileContents,
isJson ? prettierJSONOptions : prettierTypeScriptOptions
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ function ignoreNiseSinonEval(warning) {
return (
warning.code === "EVAL" &&
warning.id &&
(warning.id.includes("node_modules/nise") ||
warning.id.includes("node_modules/sinon")) === true
(warning.id.includes("node_modules/nise") ||
warning.id.includes("node_modules/sinon")) === true
);
}

function ignoreChaiCircularDependency(warning) {
return (
warning.code === "CIRCULAR_DEPENDENCY" &&
warning.importer && warning.importer.includes("node_modules/chai") === true
warning.importer &&
warning.importer.includes("node_modules/chai") === true
);
}

Expand All @@ -58,43 +59,43 @@ function makeBrowserTestConfig() {
const config = {
input: {
include: ["dist-esm/test/**/*.spec.js"],
exclude: ["dist-esm/test/**/node/**"]
exclude: ["dist-esm/test/**/node/**"],
},
output: {
file: `dist-test/index.browser.js`,
format: "umd",
sourcemap: true
sourcemap: true,
},
preserveSymlinks: false,
plugins: [
multiEntry({ exports: false }),
nodeResolve({
mainFields: ["module", "browser"]
mainFields: ["module", "browser"],
}),
cjs(),
json(),
sourcemaps()
sourcemaps(),
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
],
onwarn: makeOnWarnForTesting(),
// Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
// rollup started respecting the "sideEffects" field in package.json. Since
// our package.json sets "sideEffects=false", this also applies to test
// code, which causes all tests to be removed by tree-shaking.
treeshake: false
treeshake: false,
};

return config;
}

const defaultConfigurationOptions = {
disableBrowserBundle: false
disableBrowserBundle: false,
};

export function makeConfig(pkg, options) {
options = {
...defaultConfigurationOptions,
...(options || {})
...(options || {}),
};

const baseConfig = {
Expand All @@ -103,11 +104,11 @@ export function makeConfig(pkg, options) {
external: [
...nodeBuiltins,
...Object.keys(pkg.dependencies),
...Object.keys(pkg.devDependencies)
...Object.keys(pkg.devDependencies),
],
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
preserveSymlinks: false,
plugins: [sourcemaps(), nodeResolve()]
plugins: [sourcemaps(), nodeResolve()],
};

const config = [baseConfig];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class AdditionalPropertiesClient extends coreClient.ServiceClient {
options = {};
}
const defaults: AdditionalPropertiesClientOptionalParams = {
requestContentType: "application/json; charset=utf-8"
requestContentType: "application/json; charset=utf-8",
};

const packageDetails = `azsdk-js-additional-properties/1.0.0-preview1`;
Expand All @@ -37,9 +37,9 @@ export class AdditionalPropertiesClient extends coreClient.ServiceClient {
...defaults,
...options,
userAgentOptions: {
userAgentPrefix
userAgentPrefix,
},
endpoint: options.endpoint ?? options.baseUri ?? "http://localhost:3000"
endpoint: options.endpoint ?? options.baseUri ?? "http://localhost:3000",
};
super(optionsWithDefaults);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export interface PetsCreateAPInPropertiesWithAPStringOptionalParams
extends coreClient.OperationOptions {}

/** Contains response data for the createAPInPropertiesWithAPString operation. */
export type PetsCreateAPInPropertiesWithAPStringResponse = PetAPInPropertiesWithAPString;
export type PetsCreateAPInPropertiesWithAPStringResponse =
PetAPInPropertiesWithAPString;

/** Optional parameters. */
export interface AdditionalPropertiesClientOptionalParams
Expand Down
Loading