Skip to content

chore(deps-dev): bump verdaccio to 5.13.0 #3731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 27, 2022
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clients/client-s3/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const webpack = require("webpack");
module.exports = function (config) {
config.set({
basePath: "",
frameworks: ["mocha", "chai"],
frameworks: ["mocha", "chai", "webpack"],
files: ["test/e2e/**/*.ispec.ts"],
preprocessors: {
"test/e2e/**/*.ispec.ts": ["webpack", "sourcemap", "credentials", "env"],
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"test:integration:legacy:since:release": "./tests/integ-legacy/index.js",
"test:protocols": "yarn build:protocols && lerna run test --scope '@aws-sdk/aws-protocoltests-*'",
"test:server-protocols": "yarn build:server-protocols && lerna run test --scope '@aws-sdk/*-server'",
"test:size": "cd scripts/benchmark-size/runner && yarn && ./cli.ts",
"test:size": "cd scripts/benchmark-size/runner && yarn && ts-node ./cli.ts",
"test:unit": "jest --config jest.config.js",
"test:versions": "jest --config tests/versions/jest.config.js tests/versions/index.spec.ts",
"update:versions:default": "node --es-module-specifier-resolution=node ./scripts/update-versions/default.mjs",
Expand All @@ -51,7 +51,7 @@
"license": "UNLICENSED",
"dependencies": {
"glob": "^7.1.6",
"yargs": "^15.1.0"
"yargs": "17.5.1"
},
"devDependencies": {
"@commitlint/cli": "17.0.2",
Expand Down Expand Up @@ -106,11 +106,11 @@
"ts-jest": "28.0.5",
"ts-loader": "^7.0.5",
"ts-mocha": "10.0.0",
"ts-node": "^10.4.0",
"ts-node": "10.8.1",
"typedoc": "0.19.2",
"typedoc-plugin-lerna-packages": "0.3.1",
"typescript": "~4.6.2",
"verdaccio": "4.13.2",
"verdaccio": "5.13.0",
"webpack": "5.73.0",
"webpack-cli": "4.10.0",
"yarn": "1.22.10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import commonjsPlugin from "@rollup/plugin-commonjs";
import jsonPlugin from "@rollup/plugin-json";
import resolvePlugin from "@rollup/plugin-node-resolve";
import { build as esbuild } from "esbuild";
import { lstat } from "fs-extra";
import fsExtra from "fs-extra";
import { join } from "path";
import { rollup } from "rollup";
import { terser as terserPlugin } from "rollup-plugin-terser";
Expand All @@ -11,6 +11,8 @@ import webpack from "webpack";

import type { SizeReportContext } from "../index";

const { lstat } = fsExtra;

export interface BundlerSizeReportContext extends SizeReportContext {
projectDir: string;
entryPoint: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import exec from "execa";
import { execa as exec } from "execa";
import { promises as fsPromise } from "fs";
import { join } from "path";
import prettier from "prettier";
Expand Down
83 changes: 41 additions & 42 deletions scripts/benchmark-size/runner/calculate-size/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { promises as fsPromise } from "fs";
import { ListrContext, ListrTaskWrapper } from "listr2";
import { join } from "path";

import { SizeReportContext } from "../index";
import { PackageContext } from "../load-test-scope";
import { getEsbuildSize, getRollupSize, getWebpackSize } from "./bundlers-size";
import { generateProject } from "./generate-project";
import { calculateNpmSize } from "./npm-size";
import { getEsbuildSize, getRollupSize, getWebpackSize } from "./bundlers-size.js";
import { generateProject } from "./generate-project.js";
import { calculateNpmSize } from "./npm-size.js";

export interface PackageSizeReportOptions extends SizeReportContext {
packageName: string;
Expand All @@ -23,48 +22,48 @@ export interface PackageSizeReportOutput {
rollupSize: number | undefined;
}

export const getPackageSizeReportRunner =
(options: PackageSizeReportOptions) => async (context: ListrContext, task: ListrTaskWrapper<ListrContext, any>) => {
try {
task.output = "preparing...";
const projectDir = join(options.tmpDir, options.packageName.replace("/", "_"));
await fsPromise.mkdir(projectDir);
const entryPoint = join(projectDir, "index.js");
const bundlersContext = { ...options, entryPoint, projectDir };
export const generatePackageSizeReport = async (options: PackageSizeReportOptions) => {
const { packageName } = options;
try {
console.info(`[${packageName}] preparing...`);
const projectDir = join(options.tmpDir, options.packageName.replace("/", "_"));
await fsPromise.mkdir(projectDir);
const entryPoint = join(projectDir, "index.js");
const bundlersContext = { ...options, entryPoint, projectDir };

task.output = "generating project and installing dependencies";
await generateProject(projectDir, options);
console.info(`[${packageName}] generating project and installing dependencies`);
await generateProject(projectDir, options);

task.output = "calculating npm size";
const npmSizeResult = calculateNpmSize(projectDir, options.packageName);
console.info(`[${packageName}] calculating npm size`);
const npmSizeResult = calculateNpmSize(projectDir, options.packageName);

const skipBundlerTests = bundlersContext.packageContext.skipBundlerTests;
const skipBundlerTests = bundlersContext.packageContext.skipBundlerTests;

task.output = "calculating webpack 5 full bundle size";
const webpackSize = skipBundlerTests ? undefined : await getWebpackSize(bundlersContext);
console.info(`[${packageName}] calculating webpack 5 full bundle size`);
const webpackSize = skipBundlerTests ? undefined : await getWebpackSize(bundlersContext);

task.output = "calculating rollup full bundle size";
const rollupSize = skipBundlerTests ? undefined : await getRollupSize(bundlersContext);
console.info(`[${packageName}] calculating rollup full bundle size`);
const rollupSize = skipBundlerTests ? undefined : await getRollupSize(bundlersContext);

task.output = "calculating esbuild full bundle size";
const esbuildSize = skipBundlerTests ? undefined : await getEsbuildSize(bundlersContext);
console.info(`[${packageName}] calculating esbuild full bundle size`);
const esbuildSize = skipBundlerTests ? undefined : await getEsbuildSize(bundlersContext);

task.output = "output results";
const packageVersion = JSON.parse(
await fsPromise.readFile(
join(options.workspacePackages.filter((pkg) => pkg.name === options.packageName)[0].location, "package.json"),
"utf8"
)
).version;
options.output.push({
name: options.packageName,
version: packageVersion,
...npmSizeResult,
webpackSize,
esbuildSize,
rollupSize,
});
} catch (e) {
e.message = `[${options.packageName}]` + e.message;
}
};
console.info(`[${packageName}] output results`);
const packageVersion = JSON.parse(
await fsPromise.readFile(
join(options.workspacePackages.filter((pkg) => pkg.name === options.packageName)[0].location, "package.json"),
"utf8"
)
).version;
options.output.push({
name: options.packageName,
version: packageVersion,
...npmSizeResult,
webpackSize,
esbuildSize,
rollupSize,
});
} catch (e) {
e.message = `[${options.packageName}] ` + e.message;
}
};
89 changes: 43 additions & 46 deletions scripts/benchmark-size/runner/cli.ts
Original file line number Diff line number Diff line change
@@ -1,54 +1,51 @@
#!/usr/bin/env ts-node
import yargs from "yargs";

import {
DEFAULT_LIMIT_CONFIG_PATH,
DEFAULT_RAW_OUTPUT_PATH,
DEFAULT_REPORT_PATH,
DEFAULT_TEST_SCOPE,
} from "./constants";
import { sizeReport, SizeReportOptions } from "./index";
} from "./constants.js";
import { sizeReport, SizeReportOptions } from "./index.js";

(async () => {
const args = yargs
.option("since", {
type: "string",
choices: ["all", "last_release", "main"],
default: "all",
description: "Run the size benchmark on changed package since last release or main branch",
})
.option("scopeConfigPath", {
type: "string",
default: DEFAULT_TEST_SCOPE,
})
.option("limitConfigPath", {
type: "string",
default: DEFAULT_LIMIT_CONFIG_PATH,
})
.option("skipLocalPublish", {
type: "boolean",
default: false,
describe:
"Skip publishing the packages locally. You can skip it if you didn't change any packages since last execution",
})
.option("rawOutputPath", {
type: "string",
default: DEFAULT_RAW_OUTPUT_PATH,
})
.option("reportPath", {
type: "string",
default: DEFAULT_REPORT_PATH,
})
.option("skipRawOutput", {
type: "boolean",
default: false,
describe: "Whether to generate the raw benchmark data to configured path",
})
.help().argv;
try {
await sizeReport(args as SizeReportOptions);
} catch (e) {
console.error(e);
process.exit(1);
}
})();
const args = yargs(process.argv.slice(2))
.option("since", {
type: "string",
choices: ["all", "last_release", "main"],
default: "all",
description: "Run the size benchmark on changed package since last release or main branch",
})
.option("scopeConfigPath", {
type: "string",
default: DEFAULT_TEST_SCOPE,
})
.option("limitConfigPath", {
type: "string",
default: DEFAULT_LIMIT_CONFIG_PATH,
})
.option("skipLocalPublish", {
type: "boolean",
default: false,
describe:
"Skip publishing the packages locally. You can skip it if you didn't change any packages since last execution",
})
.option("rawOutputPath", {
type: "string",
default: DEFAULT_RAW_OUTPUT_PATH,
})
.option("reportPath", {
type: "string",
default: DEFAULT_REPORT_PATH,
})
.option("skipRawOutput", {
type: "boolean",
default: false,
describe: "Whether to generate the raw benchmark data to configured path",
})
.help().argv;
try {
await sizeReport(args as SizeReportOptions);
} catch (e) {
console.error(e);
process.exit(1);
}
14 changes: 8 additions & 6 deletions scripts/benchmark-size/runner/constants.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { join } from "path";
import { dirname, join } from "path";
import { fileURLToPath } from "url";

export const DEFAULT_TEST_SCOPE = join(__dirname, "..", "scope.json");
export const DEFAULT_BUNDLERS_CONFIG = join(__dirname, "..", "bundlers.json");
export const PROJECT_TEMPLATES_DIR = join(__dirname, "templates");
export const PROJECT_ROOT = join(__dirname, "..", "..", "..");
const dir = dirname(fileURLToPath(import.meta.url));
export const DEFAULT_TEST_SCOPE = join(dir, "..", "scope.json");
export const DEFAULT_BUNDLERS_CONFIG = join(dir, "..", "bundlers.json");
export const PROJECT_TEMPLATES_DIR = join(dir, "templates");
export const PROJECT_ROOT = join(dir, "..", "..", "..");
export const DEFAULT_RAW_OUTPUT_PATH = join(PROJECT_ROOT, "benchmark", "size", "raw");
export const DEFAULT_REPORT_PATH = join(PROJECT_ROOT, "benchmark", "size", "report.md");
export const DEFAULT_LIMIT_CONFIG_PATH = join(__dirname, "..", "limit.json");
export const DEFAULT_LIMIT_CONFIG_PATH = join(dir, "..", "limit.json");
export const PORT = 4873;
39 changes: 19 additions & 20 deletions scripts/benchmark-size/runner/index.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { appendFileSync, mkdirSync, promises as fsPromise, readFileSync, rmdirSync } from "fs";
import { ensureDirSync, ensureFile } from "fs-extra";
import hbs from "handlebars";
import { Listr } from "listr2";
import { tmpdir } from "os";
import map from "p-map";
import { join } from "path";

import { getPackageSizeReportRunner, PackageSizeReportOutput } from "./calculate-size";
import { generatePackageSizeReport, PackageSizeReportOutput } from "./calculate-size/index.js";
import {
DEFAULT_LIMIT_CONFIG_PATH,
DEFAULT_RAW_OUTPUT_PATH,
DEFAULT_REPORT_PATH,
PORT,
PROJECT_TEMPLATES_DIR,
} from "./constants";
import { loadPackageContext } from "./load-test-scope";
import { localPublishChangedPackages, spawnLocalRegistry } from "./local-registry";
import { updateReport } from "./reporter";
import { sleep, validateRuntime } from "./utils";
import { loadWorkspacePackages, SinceOption, validatePackagesAlreadyBuilt, WorkspacePackage } from "./workspace";
} from "./constants.js";
import { loadPackageContext } from "./load-test-scope.js";
import { localPublishChangedPackages, spawnLocalRegistry } from "./local-registry.js";
import { updateReport } from "./reporter/index.js";
import { sleep, validateRuntime } from "./utils.js";
import { loadWorkspacePackages, SinceOption, validatePackagesAlreadyBuilt, WorkspacePackage } from "./workspace.js";

export interface SizeReportContext {
localRegistry: string;
Expand Down Expand Up @@ -91,19 +91,18 @@ export const sizeReport = async (options: SizeReportOptions) => {
// Wait for the register to spin up.
await sleep(1000);
const sizeReportContext = await getSizeReportContext({ port: PORT });
const tasks = new Listr(
packageContextToTest.map((packageContext) => ({
title: packageContext.package,
task: getPackageSizeReportRunner({
...sizeReportContext,
packageName: packageContext.package,
packageContext,
}),
})),
{ concurrent: 10 }
);
try {
await tasks.run();
await map(
packageContextToTest,
async (packageContext) => {
await generatePackageSizeReport({
...sizeReportContext,
packageName: packageContext.package,
packageContext,
});
},
{ concurrency: 10 }
);
} finally {
localRegistryProcess.kill();
rmdirSync(sizeReportContext.tmpDir, { recursive: true });
Expand Down
4 changes: 2 additions & 2 deletions scripts/benchmark-size/runner/load-test-scope.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { readFileSync } from "fs";

import { DEFAULT_TEST_SCOPE } from "./constants";
import { loadWorkspacePackages } from "./workspace";
import { DEFAULT_TEST_SCOPE } from "./constants.js";
import { loadWorkspacePackages } from "./workspace.js";

export type PackageContext = {
package: string;
Expand Down
5 changes: 3 additions & 2 deletions scripts/benchmark-size/runner/local-registry.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import exec from "execa";
import { execa as exec } from "execa";
import { readdirSync } from "fs";
import { join } from "path";

import { PROJECT_ROOT } from "./constants";
import { PROJECT_ROOT } from "./constants.js";

/**
* Publish the changed packages locally using Verdaccio. Return the path containing
Expand All @@ -25,4 +25,5 @@ export const localPublishChangedPackages = async (): Promise<string> => {
export const spawnLocalRegistry = (port: number) =>
exec("npx", ["verdaccio", "-c", "verdaccio/config.yaml", "-l", "" + port], {
cwd: PROJECT_ROOT,
stdio: "inherit",
});
Loading