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

fix: local build error, fix crunchbase api error #891

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
786 changes: 0 additions & 786 deletions .yarn/releases/yarn-3.2.1.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
enableProgressBars: false

yarnPath: .yarn/releases/yarn-3.2.1.cjs
yarnPath: .yarn/releases/yarn-4.0.2.cjs
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"lodash": "^4.17.21",
"node-emoji": "^1.11.0",
"oauth-1.0a": "^2.2.6",
"puppeteer": "^14.2.1",
"puppeteer": "^21.5.2",
"query-string": "^7.1.1",
"relative-date": "1.1.3",
"sanitize-html": "^2.7.0",
Expand All @@ -93,5 +93,5 @@
"type": "git",
"url": "https://github.com/cncf/landscapeapp"
},
"packageManager": "yarn@3.2.1"
"packageManager": "yarn@4.0.2"
}
3 changes: 2 additions & 1 deletion specs/main.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jest.setTimeout(process.env.SHOW_BROWSER ? 30000 : 30000);

async function makePage(initialUrl) {
try {
browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox'], headless: !process.env.SHOW_BROWSER});
const headlessParam = process.env.SHOW_BROWSER ? false: "new";
browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox'], headless: headlessParam});
const page = await browser.newPage();
await page.goto(initialUrl);
await page.setViewport({ width, height });
Expand Down
16 changes: 8 additions & 8 deletions tools/crunchbase.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,22 +153,22 @@ const fetchData = module.exports.fetchData = async function(name) {
}
return result1;
}
let acquisitions = result.cards.acquiree_acquisitions.map(mapAcquisitions).filter( (x) => !!x);
let acquisitions = _.get(result, 'cards.acquiree_acquisitions', []).map(mapAcquisitions).filter( (x) => !!x);
const limit = 100;
let lastPage = result;
while (lastPage.cards.acquiree_acquisitions.length === limit) {
while (_.get(lastPage, 'cards.acquiree_acquisitions', []).length === limit) {
lastPage = await CrunchbaseClient.request({
path: `entities/organizations/${name}/cards/acquiree_acquisitions`,
params: {after_id: lastPage.cards.acquiree_acquisitions[limit - 1].identifier.uuid}
params: {after_id: _.get(lastPage, 'cards.acquiree_acquisitions', [])[limit - 1].identifier.uuid}
});
acquisitions = acquisitions.concat(lastPage.cards.acquiree_acquisitions.map(mapAcquisitions));
acquisitions = acquisitions.concat(_.get(lastPage, 'cards.acquiree_acquisitions', []).map(mapAcquisitions));
}
acquisitions = _.orderBy(acquisitions, ['date', 'acquiree']);

let parents = [];
let lastOrganization = result;
while (lastOrganization.cards.parent_organization[0]) {
const parentOrganization = lastOrganization.cards.parent_organization[0].identifier.permalink
while (_.get(lastOrganization, 'cards.parent_organization', [])[0]) {
const parentOrganization = _.get(lastOrganization, 'cards.parent_organization', [])[0].identifier.permalink
if (parents.map(p => p.identifier.permalink).includes(parentOrganization)) {
const { permalink } = lastOrganization.properties.identifier
throw new Error(`Circular dependency detected: ${permalink} and ${parentOrganization} are parents of each other`)
Expand All @@ -184,10 +184,10 @@ const fetchData = module.exports.fetchData = async function(name) {
const totalFunding = firstWithTotalFunding ? + firstWithTotalFunding.funding_total.value_usd.toFixed() : undefined;

const getAddressPart = function(part) {
if (!result.cards.headquarters_address[0]) {
if (!_.get(result, 'cards.headquarters_address', [])[0]) {
return " N/A";
}
return (result.cards.headquarters_address[0].location_identifiers.filter( (x) => x.location_type === part)[0] || {}).value
return (_.get(result, 'cards.headquarters_address', [])[0].location_identifiers.filter( (x) => x.location_type === part)[0] || {}).value
}


Expand Down
2 changes: 1 addition & 1 deletion tools/renderItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ async function main() {
}

const fonts = await fs.readFile('src/fonts.css', 'utf-8');
const resizerScript = await fs.readFile(require.resolve('iframe-resizer/js/iframeResizer.contentWindow.min.js'), 'utf-8');
const resizerScript = await fs.readFile(require.resolve('iframe-resizer/js/iframeResizer.contentWindow.js'), 'utf-8');
const description = `${settings.global.meta.description}. Updated: ${process.env.lastUpdated}`;
const favicon = '/favicon.png';

Expand Down