From cf9d54cb30b7cf0d5e8bdb9af12f60bfec46e4fd Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 15 Jul 2020 15:32:58 -0700 Subject: [PATCH 01/17] init firebase-changelog --- .changeset/config.json | 2 +- package.json | 3 +- repo-scripts/changelog-generator/.eslintrc.js | 26 ++++++ repo-scripts/changelog-generator/README.md | 13 +++ repo-scripts/changelog-generator/index.ts | 82 +++++++++++++++++ .../changelog-generator/karma.conf.js | 35 ++++++++ repo-scripts/changelog-generator/package.json | 47 ++++++++++ .../changelog-generator/rollup.config.js | 89 +++++++++++++++++++ .../changelog-generator/tsconfig.json | 9 ++ scripts/exp/docgen.js | 2 +- yarn.lock | 6 +- 11 files changed, 307 insertions(+), 7 deletions(-) create mode 100644 repo-scripts/changelog-generator/.eslintrc.js create mode 100644 repo-scripts/changelog-generator/README.md create mode 100644 repo-scripts/changelog-generator/index.ts create mode 100644 repo-scripts/changelog-generator/karma.conf.js create mode 100644 repo-scripts/changelog-generator/package.json create mode 100644 repo-scripts/changelog-generator/rollup.config.js create mode 100644 repo-scripts/changelog-generator/tsconfig.json diff --git a/.changeset/config.json b/.changeset/config.json index 2d5ade70dcb..b557986f182 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/@changesets/config@1.1.0/schema.json", - "changelog": ["@changesets/changelog-github", { "repo": "firebase/firebase-js-sdk"}], + "changelog": ["@firebase/changelog-generator", { "repo": "firebase/firebase-js-sdk"}], "commit": false, "linked": [], "access": "public", diff --git a/package.json b/package.json index 8c8b9402310..8f11b303bbe 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,8 @@ "workspaces": [ "packages/*", "packages-exp/*", - "integration/*" + "integration/*", + "repo-scripts/*" ], "devDependencies": { "@changesets/changelog-github": "0.2.6", diff --git a/repo-scripts/changelog-generator/.eslintrc.js b/repo-scripts/changelog-generator/.eslintrc.js new file mode 100644 index 00000000000..ca80aa0f69a --- /dev/null +++ b/repo-scripts/changelog-generator/.eslintrc.js @@ -0,0 +1,26 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module.exports = { + extends: '../../config/.eslintrc.js', + parserOptions: { + project: 'tsconfig.json', + // to make vscode-eslint work with monorepo + // https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-463943250 + tsconfigRootDir: __dirname + } +}; diff --git a/repo-scripts/changelog-generator/README.md b/repo-scripts/changelog-generator/README.md new file mode 100644 index 00000000000..ee3853f11b5 --- /dev/null +++ b/repo-scripts/changelog-generator/README.md @@ -0,0 +1,13 @@ +# @firebase/template + +This package can be used as a template for anyone creating new packages in the +Firebase JS SDK. It will give you a couple things OOTB: + +- **Typescript Support:** Your code should be written in TS to be consistent + with the rest of the SDK. +- **Isomorphic Testing/Coverage:** Your tests will be run in both Node.js and + Browser environments and coverage from both, collected. +- **Links to all of the other packages:** Should your new package need to take + a dependency on any of the other packages in this monorepo (e.g. + `@firebase/app`, `@firebase/util`, etc), all those dependencies are already + set up, you can just remove the ones you don't need. diff --git a/repo-scripts/changelog-generator/index.ts b/repo-scripts/changelog-generator/index.ts new file mode 100644 index 00000000000..01e256f21b0 --- /dev/null +++ b/repo-scripts/changelog-generator/index.ts @@ -0,0 +1,82 @@ +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ChangelogFunctions } from '@changesets/types'; +import { getInfo } from '@changesets/get-github-info'; + +const changelogFunctions: ChangelogFunctions = { + getDependencyReleaseLine: async ( + changesets, + dependenciesUpdated, + options + ) => { + if (!options.repo) { + throw new Error( + 'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]' + ); + } + if (dependenciesUpdated.length === 0) return ''; + + const changesetLink = `- Updated dependencies [${( + await Promise.all( + changesets.map(async cs => { + if (cs.commit) { + let { links } = await getInfo({ + repo: options.repo, + commit: cs.commit + }); + return links.commit; + } + }) + ) + ) + .filter(_ => _) + .join(', ')}]:`; + + const updatedDepenenciesList = dependenciesUpdated.map( + dependency => ` - ${dependency.name}@${dependency.newVersion}` + ); + + return [changesetLink, ...updatedDepenenciesList].join('\n'); + }, + getReleaseLine: async (changeset, type, options) => { + if (!options || !options.repo) { + throw new Error( + 'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]' + ); + } + const [firstLine, ...futureLines] = changeset.summary + .split('\n') + .map(l => l.trimRight()); + + if (changeset.commit) { + let { links } = await getInfo({ + repo: options.repo, + commit: changeset.commit + }); + return `\n\n- ${links.commit}${ + links.pull === null ? '' : ` ${links.pull}` + }${ + links.user === null ? '' : ` Thanks ${links.user}!` + } - ${firstLine}\n${futureLines.map(l => ` ${l}`).join('\n')}`; + } else { + return `\n\n- ${firstLine}\n${futureLines.map(l => ` ${l}`).join('\n')}`; + } + } +}; + +export default changelogFunctions; diff --git a/repo-scripts/changelog-generator/karma.conf.js b/repo-scripts/changelog-generator/karma.conf.js new file mode 100644 index 00000000000..1699a0681ec --- /dev/null +++ b/repo-scripts/changelog-generator/karma.conf.js @@ -0,0 +1,35 @@ +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const karmaBase = require('../../config/karma.base'); + +const files = [`src/**/*.test.ts`]; + +module.exports = function (config) { + const karmaConfig = { + ...karmaBase, + // files to load into karma + files, + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha'] + }; + + config.set(karmaConfig); +}; + +module.exports.files = files; diff --git a/repo-scripts/changelog-generator/package.json b/repo-scripts/changelog-generator/package.json new file mode 100644 index 00000000000..15634b1bc26 --- /dev/null +++ b/repo-scripts/changelog-generator/package.json @@ -0,0 +1,47 @@ +{ + "name": "@firebase/changelog-generator", + "version": "0.1.0", + "private": true, + "description": "To generate changelog for Firebase SDKs", + "author": "Firebase (https://firebase.google.com/)", + "main": "dist/index.node.cjs.js", + "files": [ + "dist" + ], + "scripts": { + "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", + "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", + "build": "tsc", + "test": "yarn type-check && run-p lint test:browser test:node", + "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test:browser": "karma start --single-run", + "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.* --config ../../config/mocharc.node.js", + "type-check": "tsc -p . --noEmit", + "prepare": "yarn build" + }, + "dependencies": { + "@changesets/types": "3.0.0", + "@changesets/get-github-info": "0.4.3" + }, + "license": "Apache-2.0", + "devDependencies": { + "rollup": "2.21.0", + "rollup-plugin-typescript2": "0.27.1", + "typescript": "3.9.6" + }, + "repository": { + "directory": "packages/template", + "type": "git", + "url": "https://github.com/firebase/firebase-js-sdk.git" + }, + "bugs": { + "url": "https://github.com/firebase/firebase-js-sdk/issues" + }, + "typings": "dist/index.d.ts", + "nyc": { + "extension": [ + ".ts" + ], + "reportDir": "./coverage/node" + } +} diff --git a/repo-scripts/changelog-generator/rollup.config.js b/repo-scripts/changelog-generator/rollup.config.js new file mode 100644 index 00000000000..1f5620f5330 --- /dev/null +++ b/repo-scripts/changelog-generator/rollup.config.js @@ -0,0 +1,89 @@ +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import typescriptPlugin from 'rollup-plugin-typescript2'; +import typescript from 'typescript'; +import pkg from './package.json'; + +const deps = Object.keys( + Object.assign({}, pkg.peerDependencies, pkg.dependencies) +); + +/** + * ES5 Builds + */ +const es5BuildPlugins = [ + typescriptPlugin({ + typescript + }) +]; + +const es5Builds = [ + /** + * Browser Builds + */ + { + input: 'index.ts', + output: [ + { file: pkg.browser, format: 'cjs', sourcemap: true }, + { file: pkg.module, format: 'es', sourcemap: true } + ], + plugins: es5BuildPlugins, + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) + }, + /** + * Node.js Build + */ + { + input: 'index.node.ts', + output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], + plugins: es5BuildPlugins, + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) + } +]; + +/** + * ES2017 Builds + */ +const es2017BuildPlugins = [ + typescriptPlugin({ + typescript, + tsconfigOverride: { + compilerOptions: { + target: 'es2017' + } + } + }) +]; + +const es2017Builds = [ + /** + * Browser Builds + */ + { + input: 'index.ts', + output: { + file: pkg.esm2017, + format: 'es', + sourcemap: true + }, + plugins: es2017BuildPlugins, + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) + } +]; + +export default [...es5Builds, ...es2017Builds]; diff --git a/repo-scripts/changelog-generator/tsconfig.json b/repo-scripts/changelog-generator/tsconfig.json new file mode 100644 index 00000000000..a06ed9a374c --- /dev/null +++ b/repo-scripts/changelog-generator/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../config/tsconfig.base.json", + "compilerOptions": { + "outDir": "dist" + }, + "exclude": [ + "dist/**/*" + ] +} \ No newline at end of file diff --git a/scripts/exp/docgen.js b/scripts/exp/docgen.js index af6cb23b1fc..96d4f63696b 100644 --- a/scripts/exp/docgen.js +++ b/scripts/exp/docgen.js @@ -38,7 +38,7 @@ async function generateDocs() { fs.mkdirSync(tmpDir); } - // TODO: Throw error if path doesn't exist, once all packages add markdown support. + // TODO: Throw error if path doesn't exist once all packages add markdown support. const apiJsonDirectories = ( await mapWorkspaceToPackages([ `${projectRoot}/packages/*`, diff --git a/yarn.lock b/yarn.lock index a8923b24a96..2b502de579f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1141,7 +1141,7 @@ fs-extra "^7.0.1" semver "^5.4.1" -"@changesets/get-github-info@^0.4.3": +"@changesets/get-github-info@0.4.3", "@changesets/get-github-info@^0.4.3": version "0.4.3" resolved "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.4.3.tgz#ed3c3ca76dcbaf4c98aa950a20fc5438da1a2f2c" integrity sha512-hMtNDn4Kp2wDUohYipBIH3qGMxONZ3wEoaGtrflXHCSu57iulBcOSQ1oHRYSCJ9pO87dYQHA2XRUfrZUnqRfKA== @@ -1219,7 +1219,7 @@ fs-extra "^7.0.1" p-filter "^2.1.0" -"@changesets/types@^3.0.0": +"@changesets/types@3.0.0", "@changesets/types@^3.0.0": version "3.0.0" resolved "https://registry.npmjs.org/@changesets/types/-/types-3.0.0.tgz#3804662aa455c1622282ec3253cf6ddd309eee65" integrity sha512-9Mh/JqkX3nkjfu53ESM3UjFmR2meOo4Zw+Tp4vnon0XYtMurk7KjZG5L+J0fD3+Qx0A2FFTZrgydPwiHR4GrXQ== @@ -14195,7 +14195,6 @@ symbol-observable@^1.1.0: "sync-promise@git+https://github.com/brettz9/sync-promise.git#full-sync-missing-promise-features": version "1.0.1" - uid "25845a49a00aa2d2c985a5149b97c86a1fcdc75a" resolved "git+https://github.com/brettz9/sync-promise.git#25845a49a00aa2d2c985a5149b97c86a1fcdc75a" syntax-error@^1.1.1: @@ -15509,7 +15508,6 @@ websocket-extensions@>=0.1.1: "websql@git+https://github.com/brettz9/node-websql.git#configurable-secure2": version "1.0.0" - uid "5149bc0763376ca757fc32dc74345ada0467bfbb" resolved "git+https://github.com/brettz9/node-websql.git#5149bc0763376ca757fc32dc74345ada0467bfbb" dependencies: argsarray "^0.0.1" From b97e5d6ec15270baa44b7a89dfd114d9373856b0 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 15 Jul 2020 15:59:14 -0700 Subject: [PATCH 02/17] use local script for changelog generation --- .changeset/config.json | 2 +- scripts/changelog-generator.js | 86 ++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 scripts/changelog-generator.js diff --git a/.changeset/config.json b/.changeset/config.json index b557986f182..44edcf9507d 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/@changesets/config@1.1.0/schema.json", - "changelog": ["@firebase/changelog-generator", { "repo": "firebase/firebase-js-sdk"}], + "changelog": ["../scripts/changelog-generator", { "repo": "firebase/firebase-js-sdk"}], "commit": false, "linked": [], "access": "public", diff --git a/scripts/changelog-generator.js b/scripts/changelog-generator.js new file mode 100644 index 00000000000..d690d4dbc0b --- /dev/null +++ b/scripts/changelog-generator.js @@ -0,0 +1,86 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// import { ChangelogFunctions } from "@changesets/types"; +// @ts-ignore +// import { config } from "dotenv"; +const { getInfo } = require('@changesets/get-github-info'); + +// config(); + +const changelogFunctions = { + getDependencyReleaseLine: async ( + changesets, + dependenciesUpdated, + options + ) => { + if (!options.repo) { + throw new Error( + 'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]' + ); + } + if (dependenciesUpdated.length === 0) return ''; + + const changesetLink = `- Updated dependencies [${( + await Promise.all( + changesets.map(async cs => { + if (cs.commit) { + let { links } = await getInfo({ + repo: options.repo, + commit: cs.commit + }); + return links.commit; + } + }) + ) + ) + .filter(_ => _) + .join(', ')}]:`; + + const updatedDepenenciesList = dependenciesUpdated.map( + dependency => ` - ${dependency.name}@${dependency.newVersion}` + ); + + return [changesetLink, ...updatedDepenenciesList].join('\n'); + }, + getReleaseLine: async (changeset, type, options) => { + if (!options || !options.repo) { + throw new Error( + 'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]' + ); + } + const [firstLine, ...futureLines] = changeset.summary + .split('\n') + .map(l => l.trimRight()); + + if (changeset.commit) { + let { links } = await getInfo({ + repo: options.repo, + commit: changeset.commit + }); + return `\n\n- ${links.commit}${ + links.pull === null ? '' : ` ${links.pull}` + }${ + links.user === null ? '' : ` Thanks ${links.user}!` + } - ${firstLine}\n${futureLines.map(l => ` ${l}`).join('\n')}`; + } else { + return `\n\n- ${firstLine}\n${futureLines.map(l => ` ${l}`).join('\n')}`; + } + } +}; + +exports.default = changelogFunctions; From 1742763b9daf65d58bd86d9819f943efd356a211 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 15 Jul 2020 16:04:36 -0700 Subject: [PATCH 03/17] change to typescript --- scripts/{changelog-generator.js => changelog-generator.ts} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename scripts/{changelog-generator.js => changelog-generator.ts} (96%) diff --git a/scripts/changelog-generator.js b/scripts/changelog-generator.ts similarity index 96% rename from scripts/changelog-generator.js rename to scripts/changelog-generator.ts index d690d4dbc0b..57732aa3afa 100644 --- a/scripts/changelog-generator.js +++ b/scripts/changelog-generator.ts @@ -15,14 +15,14 @@ * limitations under the License. */ -// import { ChangelogFunctions } from "@changesets/types"; +import { ChangelogFunctions } from '@changesets/types'; // @ts-ignore // import { config } from "dotenv"; const { getInfo } = require('@changesets/get-github-info'); // config(); -const changelogFunctions = { +const changelogFunctions: ChangelogFunctions = { getDependencyReleaseLine: async ( changesets, dependenciesUpdated, From f567ede38ab5200ffcfefb7eb2efdf27b190215d Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 15 Jul 2020 16:37:37 -0700 Subject: [PATCH 04/17] do not render user in changelog --- scripts/changelog-generator.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/changelog-generator.ts b/scripts/changelog-generator.ts index 57732aa3afa..b1e8a18f63e 100644 --- a/scripts/changelog-generator.ts +++ b/scripts/changelog-generator.ts @@ -16,11 +16,7 @@ */ import { ChangelogFunctions } from '@changesets/types'; -// @ts-ignore -// import { config } from "dotenv"; -const { getInfo } = require('@changesets/get-github-info'); - -// config(); +import { getInfo } from '@changesets/get-github-info'; const changelogFunctions: ChangelogFunctions = { getDependencyReleaseLine: async ( @@ -74,8 +70,6 @@ const changelogFunctions: ChangelogFunctions = { }); return `\n\n- ${links.commit}${ links.pull === null ? '' : ` ${links.pull}` - }${ - links.user === null ? '' : ` Thanks ${links.user}!` } - ${firstLine}\n${futureLines.map(l => ` ${l}`).join('\n')}`; } else { return `\n\n- ${firstLine}\n${futureLines.map(l => ` ${l}`).join('\n')}`; From 82c398c6f96efa6a955b2143aad6f9e60978f98c Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 15 Jul 2020 17:46:59 -0700 Subject: [PATCH 05/17] generate issue link automatically if not already present --- repo-scripts/changelog-generator/index.ts | 37 +++++++- .../changelog-generator/karma.conf.js | 35 -------- repo-scripts/changelog-generator/package.json | 8 +- .../changelog-generator/rollup.config.js | 89 ------------------- scripts/changelog-generator.ts | 80 ----------------- yarn.lock | 31 +++++-- 6 files changed, 62 insertions(+), 218 deletions(-) delete mode 100644 repo-scripts/changelog-generator/karma.conf.js delete mode 100644 repo-scripts/changelog-generator/rollup.config.js delete mode 100644 scripts/changelog-generator.ts diff --git a/repo-scripts/changelog-generator/index.ts b/repo-scripts/changelog-generator/index.ts index 01e256f21b0..6f74d4c3e09 100644 --- a/repo-scripts/changelog-generator/index.ts +++ b/repo-scripts/changelog-generator/index.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright 2017 Google LLC + * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ import { ChangelogFunctions } from '@changesets/types'; import { getInfo } from '@changesets/get-github-info'; +import fetch from 'node-fetch'; const changelogFunctions: ChangelogFunctions = { getDependencyReleaseLine: async ( @@ -64,14 +65,21 @@ const changelogFunctions: ChangelogFunctions = { .map(l => l.trimRight()); if (changeset.commit) { - let { links } = await getInfo({ + let { pull: pullNumber, links } = await getInfo({ repo: options.repo, commit: changeset.commit }); + + let fixedIssueLink = null; + // If the summary didn't mention any issue, we will look at the PR body to try to generate one automatically + if (!/issues\/[\d+]/i.test(changeset.summary) && pullNumber) { + fixedIssueLink = await getFixedIssueLink(pullNumber, options.repo); + } + return `\n\n- ${links.commit}${ links.pull === null ? '' : ` ${links.pull}` }${ - links.user === null ? '' : ` Thanks ${links.user}!` + fixedIssueLink === null ? '' : ` ${fixedIssueLink}` } - ${firstLine}\n${futureLines.map(l => ` ${l}`).join('\n')}`; } else { return `\n\n- ${firstLine}\n${futureLines.map(l => ` ${l}`).join('\n')}`; @@ -79,4 +87,25 @@ const changelogFunctions: ChangelogFunctions = { } }; -export default changelogFunctions; +const fixedIssueRegex = /(close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved) [^\s]*(#|issues\/)([\d]+)/i; +async function getFixedIssueLink( + prNumber: number, + repo: string +): Promise { + const { body }: { body: string } = await fetch( + `https://api.github.com/repos/${repo}/pulls/${prNumber}`, + { + method: 'GET' + } + ).then(data => data.json()); + + const match = fixedIssueRegex.exec(body); + if (!match) { + return ''; + } + + const issueNumber = match.groups![3]; + return `Fixed [#${issueNumber}](https://github.com/firebase/firebase-js-sdk/issues/${issueNumber})`; +} + +exports.default = changelogFunctions; diff --git a/repo-scripts/changelog-generator/karma.conf.js b/repo-scripts/changelog-generator/karma.conf.js deleted file mode 100644 index 1699a0681ec..00000000000 --- a/repo-scripts/changelog-generator/karma.conf.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -const karmaBase = require('../../config/karma.base'); - -const files = [`src/**/*.test.ts`]; - -module.exports = function (config) { - const karmaConfig = { - ...karmaBase, - // files to load into karma - files, - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['mocha'] - }; - - config.set(karmaConfig); -}; - -module.exports.files = files; diff --git a/repo-scripts/changelog-generator/package.json b/repo-scripts/changelog-generator/package.json index 15634b1bc26..acb225a1b5c 100644 --- a/repo-scripts/changelog-generator/package.json +++ b/repo-scripts/changelog-generator/package.json @@ -2,7 +2,7 @@ "name": "@firebase/changelog-generator", "version": "0.1.0", "private": true, - "description": "To generate changelog for Firebase SDKs", + "description": "A template package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", "files": [ @@ -20,8 +20,10 @@ "prepare": "yarn build" }, "dependencies": { - "@changesets/types": "3.0.0", - "@changesets/get-github-info": "0.4.3" + "@changesets/types": "3.1.0", + "@changesets/get-github-info": "0.4.3", + "node-fetch": "2.6.0", + "@types/node-fetch": "2.5.7" }, "license": "Apache-2.0", "devDependencies": { diff --git a/repo-scripts/changelog-generator/rollup.config.js b/repo-scripts/changelog-generator/rollup.config.js deleted file mode 100644 index 1f5620f5330..00000000000 --- a/repo-scripts/changelog-generator/rollup.config.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import typescriptPlugin from 'rollup-plugin-typescript2'; -import typescript from 'typescript'; -import pkg from './package.json'; - -const deps = Object.keys( - Object.assign({}, pkg.peerDependencies, pkg.dependencies) -); - -/** - * ES5 Builds - */ -const es5BuildPlugins = [ - typescriptPlugin({ - typescript - }) -]; - -const es5Builds = [ - /** - * Browser Builds - */ - { - input: 'index.ts', - output: [ - { file: pkg.browser, format: 'cjs', sourcemap: true }, - { file: pkg.module, format: 'es', sourcemap: true } - ], - plugins: es5BuildPlugins, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - }, - /** - * Node.js Build - */ - { - input: 'index.node.ts', - output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], - plugins: es5BuildPlugins, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - } -]; - -/** - * ES2017 Builds - */ -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }) -]; - -const es2017Builds = [ - /** - * Browser Builds - */ - { - input: 'index.ts', - output: { - file: pkg.esm2017, - format: 'es', - sourcemap: true - }, - plugins: es2017BuildPlugins, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - } -]; - -export default [...es5Builds, ...es2017Builds]; diff --git a/scripts/changelog-generator.ts b/scripts/changelog-generator.ts deleted file mode 100644 index b1e8a18f63e..00000000000 --- a/scripts/changelog-generator.ts +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { ChangelogFunctions } from '@changesets/types'; -import { getInfo } from '@changesets/get-github-info'; - -const changelogFunctions: ChangelogFunctions = { - getDependencyReleaseLine: async ( - changesets, - dependenciesUpdated, - options - ) => { - if (!options.repo) { - throw new Error( - 'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]' - ); - } - if (dependenciesUpdated.length === 0) return ''; - - const changesetLink = `- Updated dependencies [${( - await Promise.all( - changesets.map(async cs => { - if (cs.commit) { - let { links } = await getInfo({ - repo: options.repo, - commit: cs.commit - }); - return links.commit; - } - }) - ) - ) - .filter(_ => _) - .join(', ')}]:`; - - const updatedDepenenciesList = dependenciesUpdated.map( - dependency => ` - ${dependency.name}@${dependency.newVersion}` - ); - - return [changesetLink, ...updatedDepenenciesList].join('\n'); - }, - getReleaseLine: async (changeset, type, options) => { - if (!options || !options.repo) { - throw new Error( - 'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]' - ); - } - const [firstLine, ...futureLines] = changeset.summary - .split('\n') - .map(l => l.trimRight()); - - if (changeset.commit) { - let { links } = await getInfo({ - repo: options.repo, - commit: changeset.commit - }); - return `\n\n- ${links.commit}${ - links.pull === null ? '' : ` ${links.pull}` - } - ${firstLine}\n${futureLines.map(l => ` ${l}`).join('\n')}`; - } else { - return `\n\n- ${firstLine}\n${futureLines.map(l => ` ${l}`).join('\n')}`; - } - } -}; - -exports.default = changelogFunctions; diff --git a/yarn.lock b/yarn.lock index 2b502de579f..d76b22c3bd6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1219,16 +1219,16 @@ fs-extra "^7.0.1" p-filter "^2.1.0" -"@changesets/types@3.0.0", "@changesets/types@^3.0.0": - version "3.0.0" - resolved "https://registry.npmjs.org/@changesets/types/-/types-3.0.0.tgz#3804662aa455c1622282ec3253cf6ddd309eee65" - integrity sha512-9Mh/JqkX3nkjfu53ESM3UjFmR2meOo4Zw+Tp4vnon0XYtMurk7KjZG5L+J0fD3+Qx0A2FFTZrgydPwiHR4GrXQ== - -"@changesets/types@^3.1.0": +"@changesets/types@3.1.0", "@changesets/types@^3.1.0": version "3.1.0" resolved "https://registry.npmjs.org/@changesets/types/-/types-3.1.0.tgz#68957af45a0be29f0908e20a990ecf382282e1f1" integrity sha512-czOfaaxr5aGnNwVRgWr3n2CKoc3iRTfrHM4wUHQ+rBlLKKk9NzGwZ2EPsXkp4CUw4hWHGEOi8hdeIfDTWKrWgg== +"@changesets/types@^3.0.0": + version "3.0.0" + resolved "https://registry.npmjs.org/@changesets/types/-/types-3.0.0.tgz#3804662aa455c1622282ec3253cf6ddd309eee65" + integrity sha512-9Mh/JqkX3nkjfu53ESM3UjFmR2meOo4Zw+Tp4vnon0XYtMurk7KjZG5L+J0fD3+Qx0A2FFTZrgydPwiHR4GrXQ== + "@changesets/write@^0.1.3": version "0.1.3" resolved "https://registry.npmjs.org/@changesets/write/-/write-0.1.3.tgz#00ae575af50274773d7493e77fb96838a08ad8ad" @@ -2620,6 +2620,14 @@ resolved "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz#b17f16cf933597e10d6d78eae3251e692ce8b0ce" integrity sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w== +"@types/node-fetch@2.5.7": + version "2.5.7" + resolved "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.7.tgz#20a2afffa882ab04d44ca786449a276f9f6bbf3c" + integrity sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw== + dependencies: + "@types/node" "*" + form-data "^3.0.0" + "@types/node@*", "@types/node@>= 8": version "13.11.0" resolved "https://registry.npmjs.org/@types/node/-/node-13.11.0.tgz#390ea202539c61c8fa6ba4428b57e05bc36dc47b" @@ -4858,7 +4866,7 @@ combine-source-map@^0.8.0, combine-source-map@~0.8.0: lodash.memoize "~3.0.3" source-map "~0.5.3" -combined-stream@^1.0.6, combined-stream@~1.0.6: +combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -7090,6 +7098,15 @@ form-data@^2.5.0: combined-stream "^1.0.6" mime-types "^2.1.12" +form-data@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" + integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + form-data@~2.3.2: version "2.3.3" resolved "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" From 6e4b002f9c9516a4b1363d01b80c450d2441fb95 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 15 Jul 2020 17:49:22 -0700 Subject: [PATCH 06/17] use package --- .changeset/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/config.json b/.changeset/config.json index 44edcf9507d..b557986f182 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/@changesets/config@1.1.0/schema.json", - "changelog": ["../scripts/changelog-generator", { "repo": "firebase/firebase-js-sdk"}], + "changelog": ["@firebase/changelog-generator", { "repo": "firebase/firebase-js-sdk"}], "commit": false, "linked": [], "access": "public", From 10b3f2b77ae22a6c0d9769266709ddcccc8f0a2b Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 15 Jul 2020 17:50:28 -0700 Subject: [PATCH 07/17] update path --- .changeset/config.json | 2 +- repo-scripts/changelog-generator/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/config.json b/.changeset/config.json index b557986f182..1646a33836b 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/@changesets/config@1.1.0/schema.json", - "changelog": ["@firebase/changelog-generator", { "repo": "firebase/firebase-js-sdk"}], + "changelog": ["../repo-scripts/changelog-generator", { "repo": "firebase/firebase-js-sdk"}], "commit": false, "linked": [], "access": "public", diff --git a/repo-scripts/changelog-generator/package.json b/repo-scripts/changelog-generator/package.json index acb225a1b5c..1d4690900d8 100644 --- a/repo-scripts/changelog-generator/package.json +++ b/repo-scripts/changelog-generator/package.json @@ -4,7 +4,7 @@ "private": true, "description": "A template package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", - "main": "dist/index.node.cjs.js", + "main": "dist/index.js", "files": [ "dist" ], From 650090320b3880162748b6774148ebc5dbce5cdc Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 15 Jul 2020 17:52:19 -0700 Subject: [PATCH 08/17] output to dist --- .../changelog-generator/tsconfig.json | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/repo-scripts/changelog-generator/tsconfig.json b/repo-scripts/changelog-generator/tsconfig.json index a06ed9a374c..35a1f5fcced 100644 --- a/repo-scripts/changelog-generator/tsconfig.json +++ b/repo-scripts/changelog-generator/tsconfig.json @@ -1,9 +1,17 @@ { - "extends": "../../config/tsconfig.base.json", "compilerOptions": { - "outDir": "dist" - }, - "exclude": [ - "dist/**/*" - ] + "strict": true, + "outDir": "dist", + "lib": [ + "ESNext" + ], + "module": "CommonJS", + "moduleResolution": "node", + "esModuleInterop": true, + "resolveJsonModule": true, + "target": "es5", + "typeRoots": [ + "../../node_modules/@types" + ] + } } \ No newline at end of file From c5f0ef84ec441f039bfc0dc77c7e0515834abc00 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 15 Jul 2020 18:02:18 -0700 Subject: [PATCH 09/17] find the matching group the right way --- repo-scripts/changelog-generator/index.ts | 3 ++- repo-scripts/changelog-generator/package.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/repo-scripts/changelog-generator/index.ts b/repo-scripts/changelog-generator/index.ts index 6f74d4c3e09..fd24a8114bc 100644 --- a/repo-scripts/changelog-generator/index.ts +++ b/repo-scripts/changelog-generator/index.ts @@ -104,7 +104,8 @@ async function getFixedIssueLink( return ''; } - const issueNumber = match.groups![3]; + console.log(match); + const issueNumber = match[3]; return `Fixed [#${issueNumber}](https://github.com/firebase/firebase-js-sdk/issues/${issueNumber})`; } diff --git a/repo-scripts/changelog-generator/package.json b/repo-scripts/changelog-generator/package.json index 1d4690900d8..4a992272666 100644 --- a/repo-scripts/changelog-generator/package.json +++ b/repo-scripts/changelog-generator/package.json @@ -12,6 +12,7 @@ "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "build": "tsc", + "build:dev": "tsc -w", "test": "yarn type-check && run-p lint test:browser test:node", "test:ci": "node ../../scripts/run_tests_in_ci.js", "test:browser": "karma start --single-run", From 2d34c10dbb9076aa8aec1eeb05e4745434dbaac9 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 15 Jul 2020 18:16:18 -0700 Subject: [PATCH 10/17] script update --- package.json | 3 ++- repo-scripts/changelog-generator/package.json | 12 +++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 8f11b303bbe..7470b849037 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,8 @@ "lint": "lerna run --scope @firebase/* --scope rxfire lint", "size-report": "node scripts/report_binary_size.js", "api-report": "lerna run --scope @firebase/*-exp api-report", - "docgen:exp": "node scripts/exp/docgen.js" + "docgen:exp": "node scripts/exp/docgen.js", + "postinstall": "yarn --cwd repo-scripts/changelog-generator build" }, "repository": { "type": "git", diff --git a/repo-scripts/changelog-generator/package.json b/repo-scripts/changelog-generator/package.json index 4a992272666..21a81f0c311 100644 --- a/repo-scripts/changelog-generator/package.json +++ b/repo-scripts/changelog-generator/package.json @@ -2,7 +2,7 @@ "name": "@firebase/changelog-generator", "version": "0.1.0", "private": true, - "description": "A template package for new firebase packages", + "description": "A package for generating changelog", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", "files": [ @@ -13,11 +13,7 @@ "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "build": "tsc", "build:dev": "tsc -w", - "test": "yarn type-check && run-p lint test:browser test:node", - "test:ci": "node ../../scripts/run_tests_in_ci.js", - "test:browser": "karma start --single-run", - "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.* --config ../../config/mocharc.node.js", - "type-check": "tsc -p . --noEmit", + "test": "yarn type-check", "prepare": "yarn build" }, "dependencies": { @@ -28,12 +24,10 @@ }, "license": "Apache-2.0", "devDependencies": { - "rollup": "2.21.0", - "rollup-plugin-typescript2": "0.27.1", "typescript": "3.9.6" }, "repository": { - "directory": "packages/template", + "directory": "repo-scripts/changelog-generator", "type": "git", "url": "https://github.com/firebase/firebase-js-sdk.git" }, From a1b6c0fda061458a9bfc65bd78b9e32b30446878 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 15 Jul 2020 18:17:06 -0700 Subject: [PATCH 11/17] remove console log --- repo-scripts/changelog-generator/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/repo-scripts/changelog-generator/index.ts b/repo-scripts/changelog-generator/index.ts index fd24a8114bc..199351070b4 100644 --- a/repo-scripts/changelog-generator/index.ts +++ b/repo-scripts/changelog-generator/index.ts @@ -104,7 +104,6 @@ async function getFixedIssueLink( return ''; } - console.log(match); const issueNumber = match[3]; return `Fixed [#${issueNumber}](https://github.com/firebase/firebase-js-sdk/issues/${issueNumber})`; } From b3849a94f9bb03adf29d1a5357c03664c1c26289 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 15 Jul 2020 18:25:37 -0700 Subject: [PATCH 12/17] upate text --- repo-scripts/changelog-generator/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo-scripts/changelog-generator/index.ts b/repo-scripts/changelog-generator/index.ts index 199351070b4..e18d6307a69 100644 --- a/repo-scripts/changelog-generator/index.ts +++ b/repo-scripts/changelog-generator/index.ts @@ -105,7 +105,7 @@ async function getFixedIssueLink( } const issueNumber = match[3]; - return `Fixed [#${issueNumber}](https://github.com/firebase/firebase-js-sdk/issues/${issueNumber})`; + return `Fixed [issue #${issueNumber}](https://github.com/firebase/firebase-js-sdk/issues/${issueNumber})`; } exports.default = changelogFunctions; From 6d397dd2123ff2b2d2262f5aea74559c9e6b426b Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 15 Jul 2020 18:56:14 -0700 Subject: [PATCH 13/17] Make authenticated requests --- repo-scripts/changelog-generator/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repo-scripts/changelog-generator/index.ts b/repo-scripts/changelog-generator/index.ts index e18d6307a69..5e92935dad9 100644 --- a/repo-scripts/changelog-generator/index.ts +++ b/repo-scripts/changelog-generator/index.ts @@ -93,17 +93,17 @@ async function getFixedIssueLink( repo: string ): Promise { const { body }: { body: string } = await fetch( - `https://api.github.com/repos/${repo}/pulls/${prNumber}`, + `https://api.github.com/repos/${repo}/pulls/${prNumber}?access_token=${process.env.GITHUB_TOKEN}`, { method: 'GET' } ).then(data => data.json()); + console.log(body, repo, prNumber); const match = fixedIssueRegex.exec(body); if (!match) { return ''; } - const issueNumber = match[3]; return `Fixed [issue #${issueNumber}](https://github.com/firebase/firebase-js-sdk/issues/${issueNumber})`; } From 5a0df88ec08e100d4f29dad7a203de0a3f3d3a02 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 15 Jul 2020 19:07:37 -0700 Subject: [PATCH 14/17] remove debug code --- repo-scripts/changelog-generator/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/repo-scripts/changelog-generator/index.ts b/repo-scripts/changelog-generator/index.ts index 5e92935dad9..65538d38eb3 100644 --- a/repo-scripts/changelog-generator/index.ts +++ b/repo-scripts/changelog-generator/index.ts @@ -98,7 +98,6 @@ async function getFixedIssueLink( method: 'GET' } ).then(data => data.json()); - console.log(body, repo, prNumber); const match = fixedIssueRegex.exec(body); if (!match) { From d20d9e4f9961b33cffbe31d66e03b78595cc29ab Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 15 Jul 2020 19:14:27 -0700 Subject: [PATCH 15/17] clean up --- repo-scripts/changelog-generator/README.md | 14 ++------------ repo-scripts/changelog-generator/package.json | 1 - 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/repo-scripts/changelog-generator/README.md b/repo-scripts/changelog-generator/README.md index ee3853f11b5..4733885dccd 100644 --- a/repo-scripts/changelog-generator/README.md +++ b/repo-scripts/changelog-generator/README.md @@ -1,13 +1,3 @@ -# @firebase/template +# @firebase/changelog-generator -This package can be used as a template for anyone creating new packages in the -Firebase JS SDK. It will give you a couple things OOTB: - -- **Typescript Support:** Your code should be written in TS to be consistent - with the rest of the SDK. -- **Isomorphic Testing/Coverage:** Your tests will be run in both Node.js and - Browser environments and coverage from both, collected. -- **Links to all of the other packages:** Should your new package need to take - a dependency on any of the other packages in this monorepo (e.g. - `@firebase/app`, `@firebase/util`, etc), all those dependencies are already - set up, you can just remove the ones you don't need. +It's works as plugin for @changesets/cli to generate changelog entries(via running `changeset version`). diff --git a/repo-scripts/changelog-generator/package.json b/repo-scripts/changelog-generator/package.json index 21a81f0c311..7a5331741f4 100644 --- a/repo-scripts/changelog-generator/package.json +++ b/repo-scripts/changelog-generator/package.json @@ -34,7 +34,6 @@ "bugs": { "url": "https://github.com/firebase/firebase-js-sdk/issues" }, - "typings": "dist/index.d.ts", "nyc": { "extension": [ ".ts" From 31785f46c4ca436fdd505783153a65a7ef761d46 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Thu, 16 Jul 2020 09:58:23 -0700 Subject: [PATCH 16/17] correct verbiage --- repo-scripts/changelog-generator/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo-scripts/changelog-generator/README.md b/repo-scripts/changelog-generator/README.md index 4733885dccd..a5d605b7973 100644 --- a/repo-scripts/changelog-generator/README.md +++ b/repo-scripts/changelog-generator/README.md @@ -1,3 +1,3 @@ # @firebase/changelog-generator -It's works as plugin for @changesets/cli to generate changelog entries(via running `changeset version`). +It works as a plugin for @changesets/cli to generate changelog entries(via running `changeset version`). From d305d52adde53a7c7ebaa89a70ba0b9f33444594 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Thu, 16 Jul 2020 10:06:52 -0700 Subject: [PATCH 17/17] update text --- repo-scripts/changelog-generator/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo-scripts/changelog-generator/index.ts b/repo-scripts/changelog-generator/index.ts index 65538d38eb3..d23b90c3aec 100644 --- a/repo-scripts/changelog-generator/index.ts +++ b/repo-scripts/changelog-generator/index.ts @@ -104,7 +104,7 @@ async function getFixedIssueLink( return ''; } const issueNumber = match[3]; - return `Fixed [issue #${issueNumber}](https://github.com/firebase/firebase-js-sdk/issues/${issueNumber})`; + return `(fixes [#${issueNumber}](https://github.com/firebase/firebase-js-sdk/issues/${issueNumber}))`; } exports.default = changelogFunctions;