Skip to content

Commit c9e72ce

Browse files
asynclizcopybara-github
authored andcommitted
chore: fix size update github action date format
PiperOrigin-RevId: 601557983
1 parent e056d1d commit c9e72ce

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

scripts/size/update-size.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
import * as fs from 'fs/promises';
88

9-
import { MarkdownTable } from '../analyzer/markdown-tree-builder.js';
10-
import { COMPONENT_CUSTOM_ELEMENTS } from '../component-custom-elements.js';
11-
import { Bundle, Size, getBundleSize } from './bundle-size.js';
9+
import {MarkdownTable} from '../analyzer/markdown-tree-builder.js';
10+
import {COMPONENT_CUSTOM_ELEMENTS} from '../component-custom-elements.js';
11+
import {Bundle, Size, getBundleSize} from './bundle-size.js';
1212

1313
// The bundles to track sizes for.
1414

@@ -28,7 +28,7 @@ const bundles: Bundle[] = [
2828
).map((component) => {
2929
const tsCustomElementPaths = COMPONENT_CUSTOM_ELEMENTS[component];
3030
const jsCustomElementPaths = tsCustomElementPaths.map((tsPath) =>
31-
tsPath.replace(/\.ts$/, '.js')
31+
tsPath.replace(/\.ts$/, '.js'),
3232
);
3333

3434
return {
@@ -41,14 +41,14 @@ const bundles: Bundle[] = [
4141
// Compute bundle sizes.
4242

4343
const bundleSizes = await Promise.all(
44-
bundles.map((bundle) => getBundleSize(bundle))
44+
bundles.map((bundle) => getBundleSize(bundle)),
4545
);
4646

4747
// Create a markdown table with size data.
4848

4949
const columns = ['Component', 'gzip', 'minified', '*% CSS*', 'Import'];
5050
const rows: string[][] = [];
51-
for (const { name, size, inputs } of bundleSizes) {
51+
for (const {name, size, inputs} of bundleSizes) {
5252
rows.push([
5353
`**${camelToSentenceCase(name)}**`,
5454
`**${bytesToString(size.gzip)}**`,
@@ -67,7 +67,7 @@ for (const { name, size, inputs } of bundleSizes) {
6767
getCssPercent(input.size),
6868
getImport(input.input),
6969
];
70-
})
70+
}),
7171
);
7272
}
7373
}
@@ -79,12 +79,12 @@ for (const row of rows) {
7979

8080
// Update markdown file.
8181

82-
const markdownContent = await fs.readFile('docs/size.md', { encoding: 'utf8' });
82+
const markdownContent = await fs.readFile('docs/size.md', {encoding: 'utf8'});
8383
const updateTrackingStart = '<!-- MWC_UPDATE_TRACKING_START -->';
8484
const updateTrackingEnd = '<!-- MWC_UPDATE_TRACKING_END -->';
8585

8686
const now = new Date();
87-
const nowString = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`;
87+
const nowString = now.toISOString().split('T')[0];
8888

8989
const newMarkdownContent = [
9090
markdownContent.substring(0, markdownContent.indexOf(updateTrackingStart)),

0 commit comments

Comments
 (0)