Skip to content
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

[experiment] Test out package-size-report #53123

Closed
wants to merge 2 commits into from
Closed
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
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,19 @@ jobs:

- name: Self build
run: npx hereby build-src --built

pkg-size-report:
name: Package Size Report
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3

- name: Package size report
uses: pkg-size/action@7cbd5229062f24aec6543e0b8fd5eb09233bf355
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
build-command: npx hereby lkg
hide-files: 'lib*.d.ts'
7 changes: 1 addition & 6 deletions Herebyfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { localizationDirectories } from "./scripts/build/localization.mjs";
import cmdLineOptions from "./scripts/build/options.mjs";
import { buildProject, cleanProject, watchProject } from "./scripts/build/projects.mjs";
import { localBaseline, localRwcBaseline, refBaseline, refRwcBaseline, runConsoleTests } from "./scripts/build/tests.mjs";
import { Debouncer, Deferred, exec, getDiffTool, getDirSize, memoize, needsUpdate, readJson } from "./scripts/build/utils.mjs";
import { Debouncer, Deferred, exec, getDiffTool, memoize, needsUpdate, readJson } from "./scripts/build/utils.mjs";

const glob = util.promisify(_glob);

Expand Down Expand Up @@ -833,12 +833,7 @@ export const produceLKG = task({
if (missingFiles.length > 0) {
throw new Error("Cannot replace the LKG unless all built targets are present in directory 'built/local/'. The following files are missing:\n" + missingFiles.join("\n"));
}
const sizeBefore = getDirSize("lib");
await exec(process.execPath, ["scripts/produceLKG.mjs"]);
const sizeAfter = getDirSize("lib");
if (sizeAfter > (sizeBefore * 1.10)) {
throw new Error("The lib folder increased by 10% or more. This likely indicates a bug.");
}
}
});

Expand Down
2 changes: 2 additions & 0 deletions src/compiler/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@ export namespace Debug {
export function enableDebugInfo() {
if (isDebugInfoEnabled) return;

console.log(ts);

// avoid recomputing
const weakTypeTextMap = new WeakMap<Type, string>();
const weakNodeTextMap = new WeakMap<Node, string>();
Expand Down