Skip to content
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"resolutions": {
"@types/react": "16.9.17",
"@types/estree": "0.0.46",
"@types/eslint": "7.29.0",
"node-gyp": "5.1.0",
"typescript": "4.5.0-beta",
"tslib": "2.1.0",
Expand Down
42 changes: 24 additions & 18 deletions packages/documentation/scripts/generateAttribution.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const fs = require("fs");
const crypto = require("crypto");
const { format } = require("prettier");

console.log("Grabbing attribution");

// We need to work across two repos
const oldJSON = JSON.parse(
fs.readFileSync(path.join(__dirname, "handbookAttribution.json"), "utf8")
Expand Down Expand Up @@ -82,29 +84,33 @@ const getAuthorsForFile = (filepath) => {
const allFiles = recursiveReadDirSync("copy/");
const json = {};

allFiles.forEach((f) => {
const oldName = f.split("/").splice(2).join("/");
const originalRef = oldJSON[oldName] || { top: [], total: 0 };
if (!process.env.CI) {
console.log("Skipping because not CI");
} else {
allFiles.forEach((f) => {
const oldName = f.split("/").splice(2).join("/");
const originalRef = oldJSON[oldName] || { top: [], total: 0 };

const first = getOriginalAuthor(f);
const rest = getAuthorsForFile(f);
const first = getOriginalAuthor(f);
const rest = getAuthorsForFile(f);

const firstInRest = rest.find((a) => a.name === first.name);
// it's 50 from the original docs in the handbook, which should
// offset orta "creating" all these files
if (firstInRest) firstInRest.count += 5;
const firstInRest = rest.find((a) => a.name === first.name);
// it's 50 from the original docs in the handbook, which should
// offset orta "creating" all these files
if (firstInRest) firstInRest.count += 5;

originalRef.top.forEach((r) => {
const inRest = rest.find((a) => a.name === r.name);
if (inRest) inRest.count += r.count;
else rest.push(r);
});
originalRef.top.forEach((r) => {
const inRest = rest.find((a) => a.name === r.name);
if (inRest) inRest.count += r.count;
else rest.push(r);
});

rest.sort((l, r) => r.count - l.count);
// console.log(" - " + f + " (" + rest.length + ")");
rest.sort((l, r) => r.count - l.count);
// console.log(" - " + f + " (" + rest.length + ")");

json[f] = { top: rest.slice(0, 5), total: rest.length + originalRef.total };
});
json[f] = { top: rest.slice(0, 5), total: rest.length + originalRef.total };
});
}

const output = path.join(__dirname, "..", "output");
if (!fs.existsSync(output)) fs.mkdirSync(output);
Expand Down
2 changes: 1 addition & 1 deletion packages/handbook-epub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"fs-jetpack": "^2.4.0",
"gatsby-remark-shiki-twoslash": "3.0.17",
"playwright": "^1.9.1",
"sass": "*",
"sass": "^1.48.0",
"ts-node": "*"
}
}
42 changes: 21 additions & 21 deletions packages/typescriptlang-org/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,35 @@
"@typescript/sandbox": "0.1.0",
"@typescript/twoslash": "3.1.0",
"canvas": "^2.6.1",
"gatsby": "^3.8.1",
"gatsby-link": "3.10.0",
"gatsby-plugin-catch-links": "^3.10.0",
"gatsby": "^4.5.3",
"gatsby-link": "4.5.0",
"gatsby-plugin-catch-links": "^4.5.0",
"gatsby-plugin-client-side-redirect": "orta/gatsby-plugin-client-side-redirect#index",
"gatsby-plugin-i18n": "^1.0.1",
"gatsby-plugin-manifest": "^3.10.0",
"gatsby-plugin-offline": "^4.10.0",
"gatsby-plugin-react-helmet": "^4.10.0",
"gatsby-plugin-sass": "^4.10.0",
"gatsby-plugin-sharp": "^3.10.2",
"gatsby-plugin-sitemap": "^4.6.0",
"gatsby-plugin-manifest": "^4.5.2",
"gatsby-plugin-offline": "^5.5.2",
"gatsby-plugin-react-helmet": "^5.5.0",
"gatsby-plugin-sass": "^5.5.0",
"gatsby-plugin-sharp": "^4.5.2",
"gatsby-plugin-sitemap": "^5.5.0",
"gatsby-plugin-typegen": "^2.2.4",
"gatsby-react-router-scroll": "4.10.0",
"gatsby-remark-autolink-headers": "^4.7.0",
"gatsby-remark-copy-linked-files": "^4.7.0",
"gatsby-react-router-scroll": "5.5.0",
"gatsby-remark-autolink-headers": "^5.5.0",
"gatsby-remark-copy-linked-files": "^5.5.0",
"gatsby-remark-emojis": "^0.4.3",
"gatsby-remark-images": "^5.7.0",
"gatsby-remark-responsive-iframe": "^4.7.0",
"gatsby-remark-images": "^6.5.2",
"gatsby-remark-responsive-iframe": "^5.5.0",
"gatsby-remark-shiki-twoslash": "^3.0.17",
"gatsby-remark-smartypants": "^4.7.0",
"gatsby-source-filesystem": "^3.8.0",
"gatsby-transformer-remark": "^4.7.0",
"gatsby-remark-smartypants": "^5.5.0",
"gatsby-source-filesystem": "^4.5.2",
"gatsby-transformer-remark": "^5.5.2",
"jsdom": "^16.2.0",
"preact": "^10.5.13",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-dom": "^17.0.2",
"react-helmet": "^6.1.0",
"react-intl": "^3.12.1",
"sass": "^1.26.10",
"react-intl": "^5.24.3",
"sass": "^1.48.0",
"ts-debounce": "^2.2.0",
"ts-node": "^8.6.2",
"twoslash-cli": "^1.3.10",
Expand All @@ -67,7 +67,7 @@
"@types/react": "^16.9.20",
"@types/react-dom": "^16.9.5",
"concurrently": "^5.1.0",
"gatsby-plugin-typescript": "^3.10.0",
"gatsby-plugin-typescript": "^4.5.2",
"jest": "*",
"ts-jest": "^26.4.4"
},
Expand Down
Loading