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

chore, update core-aspect-env to upgrade @types/node to 20.12.10 #9222

Merged
merged 7 commits into from
Oct 1, 2024
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
802 changes: 701 additions & 101 deletions .bitmap

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ jobs:
- restore_cache:
key: bitsrc-registry10
- restore_cache:
key: core-aspect-env-v0.0.59-v1
key: core-aspect-env-v0.0.60-v1
- run: echo $BIT_FEATURES
- run: node -v
- run: npm -v
Expand Down Expand Up @@ -491,7 +491,7 @@ jobs:
name: bbit install
command: cd bit && bbit install
- save_cache:
key: core-aspect-env-v0.0.59-v1
key: core-aspect-env-v0.0.60-v1
paths:
- /home/circleci/Library/Caches/Bit/capsules/caec9a107
- run: cd bit && npm run link-bit-legacy
Expand Down Expand Up @@ -537,7 +537,7 @@ jobs:
- restore_cache:
key: v3-linux-bvm-folder-{{ checksum "version.txt" }}
- restore_cache:
key: core-aspect-env-v0.0.59-v1
key: core-aspect-env-v0.0.60-v1
# - update_ssh_agent
# temporary, check if we can remove it
- run: cd bit && bit cc
Expand Down Expand Up @@ -574,7 +574,7 @@ jobs:
- restore_cache:
key: v3-linux-bvm-folder-{{ checksum "version.txt" }}
- restore_cache:
key: core-aspect-env-v0.0.59-v1
key: core-aspect-env-v0.0.60-v1
- bit_config:
env: "hub"
- restore_cache:
Expand Down Expand Up @@ -887,7 +887,7 @@ jobs:
- restore_cache:
key: bitsrc-registry10
- restore_cache:
key: core-aspect-env-v0.0.59-v1
key: core-aspect-env-v0.0.60-v1
- run: npm view @teambit/bit version > ./version.txt
- restore_cache:
key: v3-linux-bvm-folder-{{ checksum "version.txt" }}
Expand Down
1 change: 1 addition & 0 deletions components/crypto/sha1/sha1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ import * as crypto from 'crypto';
*/
// @ts-ignore todo: fix after deleting teambit.legacy
export function sha1(data: string | Buffer, encoding: crypto.BinaryToTextEncoding = 'hex'): string {
// @ts-ignore should be fixed after upgrading @types/node from '12.20.4' to > 20.
return crypto.createHash('sha1').update(data).digest(encoding);
}
3 changes: 1 addition & 2 deletions components/renderers/api-node-details/api-node-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ export function APINodeDetails({

const example = (doc?.tags || []).find((tag) => tag.tagName === 'example');
const comment =
doc?.comment ??
doc?.tags?.filter((tag) => tag.comment).reduce((acc, tag) => acc.concat(`${tag.comment}\n` ?? ''), '');
doc?.comment ?? doc?.tags?.filter((tag) => tag.comment).reduce((acc, tag) => acc.concat(`${tag.comment}\n`), '');
const linkComment = doc?.tags?.find((tag) => tag.tagName === 'link')?.comment;

let linkPlaceholder: string | undefined;
Expand Down
3 changes: 1 addition & 2 deletions components/renderers/class/class.renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ function ClassOverviewComponent(props: APINodeRenderProps) {

const icon = renderer.icon;
const description =
doc?.comment ??
doc?.tags?.filter((tag) => tag.comment).reduce((acc, tag) => acc.concat(`${tag.comment}\n` ?? ''), '');
doc?.comment ?? doc?.tags?.filter((tag) => tag.comment).reduce((acc, tag) => acc.concat(`${tag.comment}\n`), '');
return (
<SchemaNodesSummary
name={classNode.name}
Expand Down
3 changes: 1 addition & 2 deletions components/renderers/enum/enum.renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ function EnumOverviewComponent(props: APINodeRenderProps) {

const icon = renderer.icon;
const description =
doc?.comment ??
doc?.tags?.filter((tag) => tag.comment).reduce((acc, tag) => acc.concat(`${tag.comment}\n` ?? ''), '');
doc?.comment ?? doc?.tags?.filter((tag) => tag.comment).reduce((acc, tag) => acc.concat(`${tag.comment}\n`), '');
return (
<SchemaNodesSummary
name={enumNode.name}
Expand Down
3 changes: 1 addition & 2 deletions components/renderers/interface/interface.renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ function InterfaceOverviewComponent(props: APINodeRenderProps) {

const icon = renderer.icon;
const description =
doc?.comment ??
doc?.tags?.filter((tag) => tag.comment).reduce((acc, tag) => acc.concat(`${tag.comment}\n` ?? ''), '');
doc?.comment ?? doc?.tags?.filter((tag) => tag.comment).reduce((acc, tag) => acc.concat(`${tag.comment}\n`), '');

return (
<SchemaNodesSummary
Expand Down
2 changes: 1 addition & 1 deletion components/renderers/react/react.renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function ReactOverviewComponent(props: APINodeRenderProps) {
const icon = reactRenderer.icon;
const description =
api.doc?.comment ??
api?.doc?.tags?.filter((tag) => tag.comment).reduce((acc, tag) => acc.concat(`${tag.comment}\n` ?? ''), '');
api?.doc?.tags?.filter((tag) => tag.comment).reduce((acc, tag) => acc.concat(`${tag.comment}\n`), '');

return (
<div className={styles.reactOverview}>
Expand Down
3 changes: 1 addition & 2 deletions components/renderers/type-literal/type-literal.renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ function TypeLiteralOverviewComponent(props: APINodeRenderProps) {

const icon = renderer.icon;
const description =
doc?.comment ??
doc?.tags?.filter((tag) => tag.comment).reduce((acc, tag) => acc.concat(`${tag.comment}\n` ?? ''), '');
doc?.comment ?? doc?.tags?.filter((tag) => tag.comment).reduce((acc, tag) => acc.concat(`${tag.comment}\n`), '');
return (
<SchemaNodesSummary
name={typeLiteralNode.name ?? typeLiteralNode.toString()}
Expand Down
4 changes: 3 additions & 1 deletion e2e/harmony/root-components.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,9 @@ module.exports.default = {
}`
);
helper.extensions.addExtensionToVariant('custom-react', 'teambit.envs/env', {});
helper.command.install();
// for unclear reason, since upgrading core-envs to use @types/[email protected], the following line throws an error "Unexpected token 'export'"
// helper.command.install();
helper.command.install('--add-missing-deps');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions scopes/component/checkout/checkout-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export async function applyVersion(
export function updateFileStatus(files: SourceFile[], filesStatus: FilesStatus, componentFromFS?: ConsumerComponent) {
files.forEach((file) => {
const fileFromFs = componentFromFS?.files.find((f) => f.relative === file.relative);
// @ts-ignore should be fixed after upgrading @types/node from '12.20.4' to > 20
const areFilesEqual = fileFromFs && Buffer.compare(fileFromFs.contents, file.contents) === 0;
// @ts-ignore
filesStatus[pathNormalizeToLinux(file.relative)] = areFilesEqual ? FileStatus.unchanged : FileStatus.updated;
Expand Down
2 changes: 1 addition & 1 deletion scopes/defender/tester/test.cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ otherwise, only new and modified components will be tested`);
updateSnapshot,
});
if (tests.hasErrors()) code = 1;
if (process.exitCode && process.exitCode !== 0) {
if (process.exitCode && process.exitCode !== 0 && typeof process.exitCode === 'number') {
// this is needed for testers such as "vitest", where it sets the exitCode to non zero when the coverage is not met.
code = process.exitCode;
}
Expand Down
2 changes: 2 additions & 0 deletions scopes/toolbox/performance/v8-cache/file-system-blob-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export class FileSystemBlobStore {

save(): boolean {
const dump = this._getDump();
// @ts-ignore should be fixed after upgrading @types/node from '12.20.4' to > 20
const blobToStore = Buffer.concat(dump[0]);
const mapToStore = JSON.stringify(dump[1]);

Expand All @@ -137,6 +138,7 @@ export class FileSystemBlobStore {
}

try {
// @ts-ignore should be fixed after upgrading @types/node from '12.20.4' to > 20
writeFileSync(this._blobFilename, blobToStore);
writeFileSync(this._mapFilename, mapToStore);
} finally {
Expand Down
4 changes: 2 additions & 2 deletions scopes/workspace/config-merger/component-config-merger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ export class ComponentConfigMerger {
// exist in other but not in current and base, so it got created on other.
return { id, mergedConfig: this.getConfig(otherExt) };
});
const envResult = [this.envStrategy()] || [];
const envResult = this.envStrategy();
this.logger.debug(`*** end config-merger for ${this.compIdStr} ***\n`);
return new ConfigMergeResult(
this.compIdStr,
this.currentLabel,
this.otherLabel,
compact([...results, ...otherAspectsNotHandledResults, ...envResult])
compact([...results, ...otherAspectsNotHandledResults, envResult])
);
}

Expand Down