From 2e8d2cb9dac8392be8b41ac5526fb74663d0caf1 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Tue, 23 Feb 2021 19:37:52 -0500 Subject: [PATCH] refactor: spelling fixes (#108) --- README.md | 14 ++++----- .../commands/get-current-commit-version.ts | 2 +- src/cli/commands/preview.ts | 2 +- src/cli/commands/stable.ts | 2 +- .../__snapshots__/index.spec.ts.snap | 2 +- src/lib/changelog/data.ts | 2 +- src/lib/changelog/index.spec.ts | 2 +- src/lib/conventional-commit.ts | 2 +- src/lib/git.ts | 30 +++++++++---------- src/lib/github-ci-environment.ts | 20 ++++++------- src/lib/npm-auth.ts | 4 +-- src/lib/package-json.ts | 6 ++-- src/lib/pacman.ts | 6 ++-- src/lib/proc.ts | 4 +-- src/lib/publish-changelog.ts | 2 +- src/lib/publish-package.ts | 8 ++--- src/lib/semver.ts | 2 +- src/lib/utils.ts | 2 +- src/sdk/pr.spec.ts | 4 +-- src/sdk/pr.ts | 4 +-- src/sdk/preview.spec.ts | 12 ++++---- src/sdk/preview.ts | 4 +-- src/sdk/stable.spec.ts | 2 +- src/sdk/stable.ts | 2 +- src/utils/context-checkers.ts | 4 +-- .../{contrext-guard.ts => context-guard.ts} | 0 src/utils/context.ts | 6 ++-- src/utils/output.ts | 8 ++--- src/utils/pr-release.ts | 2 +- src/utils/release.spec.ts | 2 +- tests/__lib/helpers.ts | 4 +-- 31 files changed, 83 insertions(+), 83 deletions(-) rename src/utils/{contrext-guard.ts => context-guard.ts} (100%) diff --git a/README.md b/README.md index b2f441f8..45b5c00a 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,9 @@ npm install --save-dev dripip ![diagram](https://dsc.cloud/661643/dripip.png) -Dripip is a command line interface (CLI) for continuously releasing npm packages. It has support for three kinds of releases: pull-request releases, canary releases, stable releases. It builds on top of Git, Semver, Conventional Commit, and GitHub. Support for alterntive version control systems (e.g. Darcs) and platforms (e.g. GitLab) are not currently supported but they probably could be. The concepts of dripip are relatively general. +Dripip is a command line interface (CLI) for continuously releasing npm packages. It has support for three kinds of releases: pull-request releases, canary releases, stable releases. It builds on top of Git, Semver, Conventional Commit, and GitHub. Support for alternative version control systems (e.g. Darcs) and platforms (e.g. GitLab) are not currently supported but they probably could be. The concepts of dripip are relatively general. -Continuous delivery means that every single meaningful commit to your library will be released. The benefit of this approach is that when you ship value your users get access to it immeditely, and as an author you don't need to manage incoming queries like "when will this be released?". You get to to auto-reply: "It already it! :)". +Continuous delivery means that every single meaningful commit to your library will be released. The benefit of this approach is that when you ship value your users get access to it immediately, and as an author you don't need to manage incoming queries like "when will this be released?". You get to to auto-reply: "It already it! :)". ### Pull-Request Releases @@ -63,7 +63,7 @@ The `pr_num` part is the pull-request number. The same one that you see on the G The `pr_release_num` is a monotonically increasing 1-based (starts from 1, not 0) integer. It serves a few purposes. It provides orientation for humans at a glance, like how many releases has a PR had or where does a given release fall within the PR release set. Its functional purpose is to support correct lexical sorting. Without this little number it would be impossible to sort PR releases without some kind of additional metadata e.g. publish time. Thanks to this, when you run e.g. `npm versions`, you get an accurate ordering. -The `short_sha` is what you see next to commits in much of the GitHub UI, including PR pages. Its primary purpose is to make it easy for you to tie a release back to something in your Git history. For example when looking at a PR page you can copy-paste the sha into search to find the exact commit for that release. Whatever the particular, this is just a convenient piece of information for you. Ultimately we develoeprs pratice many a crude workflow, habbits (console.log vs debugger anyone?). +The `short_sha` is what you see next to commits in much of the GitHub UI, including PR pages. Its primary purpose is to make it easy for you to tie a release back to something in your Git history. For example when looking at a PR page you can copy-paste the sha into search to find the exact commit for that release. Whatever the particular, this is just a convenient piece of information for you. Ultimately we developers practice many a crude workflow, habits (console.log vs debugger anyone?). When Dripip makes a pr release, it includes an upsert of a dist-tag of pattern `pr.${pr_num}`. This makes it very easy to install the latest published version for a given pull-request. @@ -110,7 +110,7 @@ When Dripip makes a canary release, it includes an upsert of a dist-tag called ` ### Package.json Version Field -Typically when an npm package is released its package.json `version` field will be updated and committed into version control. This is a bad match for continuous delivery however, because it meanss that, more or less, half of the git history will become meta commits. To solve this, `dripip` takes a novel approach of keeping the version out of version control. It uses Git tags to store that state, and when publishing your package, will set the package.json `version` field right before publishing, and then unset it right after publishing completes. You notice nothing, your users notice nothing, and your git history looks ideal. This is unorthadox, but it works well. +Typically when an npm package is released its package.json `version` field will be updated and committed into version control. This is a bad match for continuous delivery however, because it means that, more or less, half of the git history will become meta commits. To solve this, `dripip` takes a novel approach of keeping the version out of version control. It uses Git tags to store that state, and when publishing your package, will set the package.json `version` field right before publishing, and then unset it right after publishing completes. You notice nothing, your users notice nothing, and your git history looks ideal. This is unorthodox, but it works well. Having a valid semver value in the `version` field is required by npm. Dripip puts the following value into your project's package.json to satisfy that constraint. This is what you should check into version control. @@ -134,7 +134,7 @@ For example checkout what's coming up in dripip right now by visiting https://gi ### Usage inside GitHub Actions -We are interseted in building a `dripip` GitHub Action. Until it ships, here are the things you need to do. +We are interested in building a `dripip` GitHub Action. Until it ships, here are the things you need to do. 1. Have `dripip` installed as a dev dependency 1. Upload an `NPM_TOKEN` to your repo ([gh docs](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets)) @@ -254,7 +254,7 @@ OPTIONS -n, --build-num=build-num Force a build number. Should not be needed generally. For exceptional cases. --skip-npm skip the step of publishing the package to npm - --trunk=trunk State which branch is trunk. Defaults to honuring the "base" branch setting in the GitHub + --trunk=trunk State which branch is trunk. Defaults to honoring the "base" branch setting in the GitHub repo settings. ``` @@ -278,7 +278,7 @@ OPTIONS -j, --json format output as JSON --skip-npm skip the step of publishing the package to npm - --trunk=trunk State which branch is trunk. Defaults to honuring the "base" branch setting in the GitHub repo + --trunk=trunk State which branch is trunk. Defaults to honoring the "base" branch setting in the GitHub repo settings. ``` diff --git a/src/cli/commands/get-current-commit-version.ts b/src/cli/commands/get-current-commit-version.ts index 618c508e..b167e6cb 100644 --- a/src/cli/commands/get-current-commit-version.ts +++ b/src/cli/commands/get-current-commit-version.ts @@ -25,7 +25,7 @@ export class GetCurrentCommitVersion extends Command { // Note: // // - PR release should not be possible on same commit as stable/preview - // anyways + // anyway // // - PR release is much more costly to calculate than others // diff --git a/src/cli/commands/preview.ts b/src/cli/commands/preview.ts index 7986439e..5d883093 100644 --- a/src/cli/commands/preview.ts +++ b/src/cli/commands/preview.ts @@ -7,7 +7,7 @@ export class Preview extends Command { trunk: flags.string({ default: '', description: - 'State which branch is trunk. Defaults to honuring the "base" branch setting in the GitHub repo settings.', + 'State which branch is trunk. Defaults to honoring the "base" branch setting in the GitHub repo settings.', }), ['build-num']: flags.integer({ description: 'Force a build number. Should not be needed generally. For exceptional cases.', diff --git a/src/cli/commands/stable.ts b/src/cli/commands/stable.ts index c835be0a..d80bf487 100644 --- a/src/cli/commands/stable.ts +++ b/src/cli/commands/stable.ts @@ -7,7 +7,7 @@ export class Stable extends Command { trunk: flags.string({ default: '', description: - 'State which branch is trunk. Defaults to honuring the "base" branch setting in the GitHub repo settings.', + 'State which branch is trunk. Defaults to honoring the "base" branch setting in the GitHub repo settings.', }), 'dry-run': flags.boolean({ default: false, diff --git a/src/lib/changelog/__snapshots__/index.spec.ts.snap b/src/lib/changelog/__snapshots__/index.spec.ts.snap index baec638d..08c49087 100644 --- a/src/lib/changelog/__snapshots__/index.spec.ts.snap +++ b/src/lib/changelog/__snapshots__/index.spec.ts.snap @@ -32,7 +32,7 @@ exports[`.render() with markdown renders release changelog for the current relea " `; -exports[`.render() with termimal renders changelog for the current release series 1`] = ` +exports[`.render() with terminal renders changelog for the current release series 1`] = ` "BREAKING CHANGES shasha# a diff --git a/src/lib/changelog/data.ts b/src/lib/changelog/data.ts index f8026791..589d34ff 100644 --- a/src/lib/changelog/data.ts +++ b/src/lib/changelog/data.ts @@ -1,5 +1,5 @@ /** - * This module deals with building changelogs from serieses. + * This module deals with building changelogs from multiple series. */ import { Commit } from '../../utils/release' diff --git a/src/lib/changelog/index.spec.ts b/src/lib/changelog/index.spec.ts index 7379cfec..c86a0ff4 100644 --- a/src/lib/changelog/index.spec.ts +++ b/src/lib/changelog/index.spec.ts @@ -44,7 +44,7 @@ describe('.render() with markdown', () => { }) }) -describe('.render() with termimal', () => { +describe('.render() with terminal', () => { const render = (...commits: Release.MockCommit[]) => { return Changelog.render(Changelog.fromSeries(Release.fromMockCommits(commits)), { as: 'plain' }) } diff --git a/src/lib/conventional-commit.ts b/src/lib/conventional-commit.ts index 7f2fff54..b9621fe8 100644 --- a/src/lib/conventional-commit.ts +++ b/src/lib/conventional-commit.ts @@ -41,7 +41,7 @@ export function calcBumpType( if (isMinorChange(cc)) { semverPart = 'minor' // during initial development breaking changes are permitted without - // having to bump the major. Therefore, we know we won't get a bunmpType + // having to bump the major. Therefore, we know we won't get a bumpType // higher than this, can short-circuit. if (isInitialDevelopment) break else continue diff --git a/src/lib/git.ts b/src/lib/git.ts index bdb844d8..b5514163 100644 --- a/src/lib/git.ts +++ b/src/lib/git.ts @@ -97,8 +97,8 @@ export async function gitInitRepo(git: Simple): Promise { /** * Create an empty commit in the repo. */ -export async function gitCreateEmptyCommit(git: Simple, messge?: string): Promise { - await git.raw(['commit', '--allow-empty', '--message', messge ?? 'Nothing to see here, move along']) +export async function gitCreateEmptyCommit(git: Simple, message?: string): Promise { + await git.raw(['commit', '--allow-empty', '--message', message ?? 'Nothing to see here, move along']) } export async function createFixCommit(git: Simple, msg?: string) { @@ -160,7 +160,7 @@ export async function gitDeleteAllTagsInRepo(git: Simple): Promise { // } // } // -// const githubRepo = await parseGithubRepoInfoFromGitConfig() +// const githubRepo = await parseGitHubRepoInfoFromGitConfig() // // TODO Refactor this to have instance passed as arg. // const octoOps = {} as Octokit.Options @@ -174,7 +174,7 @@ export async function gitDeleteAllTagsInRepo(git: Simple): Promise { // // to trunk branch?", etc. // // // // To attain this level of feedback users would need to accept potentially -// // higher levels of latentcy to pagination through all pull-requests. +// // higher levels of latency to pagination through all pull-requests. // // TODO pagination https://octokit.github.io/rest.js/#pagination // const pullsRes = await octokit.pulls.list({ // owner: githubRepo.owner, @@ -203,8 +203,8 @@ type SyncStatus = 'needs_pull' | 'needs_push' | 'synced' | 'diverged' | 'remote_ export async function checkSyncStatus(git: Simple): Promise { await git.remote(['update']) const remoteHeads = await git.raw(['ls-remote', '--heads']) - const branchSumamry = await git.branch({}) - const branchOnRemoteRE = new RegExp(`.*refs/heads/${branchSumamry.current}$`, 'm') + const branchSummary = await git.branch({}) + const branchOnRemoteRE = new RegExp(`.*refs/heads/${branchSummary.current}$`, 'm') if (remoteHeads.match(branchOnRemoteRE) === null) { return 'remote_needs_branch' @@ -225,7 +225,7 @@ export async function checkSyncStatus(git: Simple): Promise { : 'diverged' } -export interface BasicGithubRepoInfo { +export interface BasicGitHubRepoInfo { name: string owner: string } @@ -234,7 +234,7 @@ export interface BasicGithubRepoInfo { * Extract the github repo name and owner from the git config. If anything goes * wrong during extraction a specific error about it will be thrown. */ -export async function parseGithubRepoInfoFromGitConfig(): Promise { +export async function parseGitHubRepoInfoFromGitConfig(): Promise { // Inspiration from how `$ hub pr show` works // https://github.com/github/hub/blob/a5fbf29be61a36b86c7f0ff9e9fd21090304c01f/commands/pr.go#L327 @@ -275,14 +275,14 @@ export async function parseGithubRepoInfoFromGitConfig(): Promise { - const branchSumamry = await git.branch({}) - return branchSumamry.current === 'master' + const branchSummary = await git.branch({}) + return branchSummary.current === 'master' } /** @@ -353,7 +353,7 @@ export async function log(git: Simple, ops?: { since?: null | string }): Promise } const logEntrySeparator = '$@@$' -const logEntryValueSepartaor = '$@@$' +const logEntryValueSeparator = '$@@$' type CommitDatum = { name: string; code: 'H' | 'D' | 's' | 'b' | 'B' } @@ -367,7 +367,7 @@ export const commitDatums: CommitDatum[] = [ const commitDatumNames = commitDatums.map((datum) => datum.name) export function gitLogFormat(commitDatums: CommitDatum[]): string { - return commitDatums.map((part) => '%' + part.code).join(logEntryValueSepartaor) + logEntrySeparator + return commitDatums.map((part) => '%' + part.code).join(logEntryValueSeparator) + logEntrySeparator } export function parseRawLog(rawLog: string): LogEntryWithRefs[] { @@ -385,7 +385,7 @@ export function parseRawLogEntry(rawLogEntry: string): LogEntryWithRefs { // propsRemaining and logParts are guaranteed to be the same length // TODO should be a zip... const propsRemaining = [...commitDatumNames] - const logParts = rawLogEntry.split(logEntryValueSepartaor) + const logParts = rawLogEntry.split(logEntryValueSeparator) while (propsRemaining.length > 0) { // @ts-ignore log[propsRemaining.shift()!] = logParts.shift()!.trim() @@ -422,7 +422,7 @@ export function parseLogRefs({ refs, ...rest }: LogEntryWithRefs): LogEntry { */ export function serializeLog(values: [string, string, string][]): string { if (values.length === 0) return '' - return values.map((v) => v.join(logEntryValueSepartaor)).join(logEntrySeparator) + logEntrySeparator + return values.map((v) => v.join(logEntryValueSeparator)).join(logEntrySeparator) + logEntrySeparator } export async function* streamLog(opts?: { cwd?: string }): AsyncGenerator { diff --git a/src/lib/github-ci-environment.ts b/src/lib/github-ci-environment.ts index 8426518b..d9022c41 100644 --- a/src/lib/github-ci-environment.ts +++ b/src/lib/github-ci-environment.ts @@ -2,7 +2,7 @@ import { rootDebug } from './debug' const debug = rootDebug(__filename) -export interface GithubCIEnvironment { +export interface GitHubCIEnvironment { runId: number eventName: 'pull_request' ref: null | string @@ -19,17 +19,17 @@ export interface GithubCIEnvironment { } /** - * Parse the Github CI Environment. Returns null if parsing fails which should - * mean it is not a Github CI Environment. + * Parse the GitHub CI Environment. Returns null if parsing fails which should + * mean it is not a GitHub CI Environment. * * @remarks * - * Github docs: https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables + * GitHub docs: https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables */ -export function parseGithubCIEnvironment(): null | GithubCIEnvironment { - if (!isGithubCIEnvironment()) return null +export function parseGitHubCIEnvironment(): null | GitHubCIEnvironment { + if (!isGitHubCIEnvironment()) return null - let prNum: GithubCIEnvironment['parsed']['prNum'] + let prNum: GitHubCIEnvironment['parsed']['prNum'] if (process.env.GITHUB_REF) { const match = process.env.GITHUB_REF.match(/refs\/pull\/(\d+)\/merge/) @@ -56,7 +56,7 @@ export function parseGithubCIEnvironment(): null | GithubCIEnvironment { return { runId: parseInt(process.env.GITHUB_RUN_ID!, 10), - eventName: process.env.GITHUB_EVENT_NAME! as GithubCIEnvironment['eventName'], + eventName: process.env.GITHUB_EVENT_NAME! as GitHubCIEnvironment['eventName'], ref: process.env.GITHUB_REF ?? null, headRef: process.env.GITHUB_HEAD_REF ?? null, repository: process.env.GITHUB_REPOSITORY!, @@ -69,8 +69,8 @@ export function parseGithubCIEnvironment(): null | GithubCIEnvironment { } /** - * Check if the current process appers to be running in a Github CI environment. + * Check if the current process appears to be running in a GitHub CI environment. */ -export function isGithubCIEnvironment() { +export function isGitHubCIEnvironment() { return process.env.GITHUB_RUN_ID !== undefined } diff --git a/src/lib/npm-auth.ts b/src/lib/npm-auth.ts index 1e437ab9..76612fb5 100644 --- a/src/lib/npm-auth.ts +++ b/src/lib/npm-auth.ts @@ -2,7 +2,7 @@ import * as fs from 'fs-jetpack' import * as os from 'os' import * as path from 'path' import { rootDebug } from './debug' -import { isGithubCIEnvironment } from './github-ci-environment' +import { isGitHubCIEnvironment } from './github-ci-environment' const debug = rootDebug(__filename) @@ -15,7 +15,7 @@ const npmrcFilePath = path.join(os.homedir(), '.npmrc') * publishing commands. */ export function setupNPMAuthfileOnCI(): void { - if (isGithubCIEnvironment() && process.env.NPM_TOKEN) { + if (isGitHubCIEnvironment() && process.env.NPM_TOKEN) { const authContent = `//registry.npmjs.org/:_authToken=${process.env[TOKEN_ENV_VAR_NAME]}` debug('writing or appending npm auth token to %s', npmrcFilePath) fs.append(npmrcFilePath, authContent) diff --git a/src/lib/package-json.ts b/src/lib/package-json.ts index de69f107..60374ea0 100644 --- a/src/lib/package-json.ts +++ b/src/lib/package-json.ts @@ -26,15 +26,15 @@ type ValidatedPackageJson = PackageJson & { name: string } */ function validate(pj: PackageJson | undefined): ValidatedPackageJson { if (!pj) { - throw new Error('Could not find pacakge.json') + throw new Error('Could not find package.json') } if (pj.name === undefined) { - throw new Error('pacakge.json is missing name field') + throw new Error('package.json is missing name field') } if (pj.name === '') { - throw new Error('pacakge.json name field is empty') + throw new Error('package.json name field is empty') } return pj as ValidatedPackageJson diff --git a/src/lib/pacman.ts b/src/lib/pacman.ts index d8324a66..326d107e 100644 --- a/src/lib/pacman.ts +++ b/src/lib/pacman.ts @@ -31,7 +31,7 @@ function detectScriptRunner(): null | 'npm' | 'yarn' { * * In the case of yarn, package.json is not touched at all. * - * Either way, it should not be noticable to the user of this function. + * Either way, it should not be noticeable to the user of this function. */ async function publish(manType: PackageManagerType, input: { version: string; tag: string }): Promise { if (manType === 'yarn') { @@ -91,8 +91,8 @@ async function tag( } } -export async function create(input: { defualt: PackageManagerType }) { - const packageManagerType = detectScriptRunner() ?? input.defualt +export async function create(input: { default: PackageManagerType }) { + const packageManagerType = detectScriptRunner() ?? input.default const packageJson = PJ.getPackageJsonSync() return { publish: publish.bind(null, packageManagerType), diff --git a/src/lib/proc.ts b/src/lib/proc.ts index 110bdc4f..b4918b77 100644 --- a/src/lib/proc.ts +++ b/src/lib/proc.ts @@ -8,7 +8,7 @@ export type SuccessfulRunResult = { stdout: null | string // present if stdio using pipe mode signal: null | string exitCode: null | number // present if optional (non-throw) mode - error: null | Error // present if optonal (non-throw) mode + error: null | Error // present if optional (non-throw) mode } export type RunOptions = SpawnOptions & { @@ -157,7 +157,7 @@ function createCommandError({ ${exitCode} - This underlying error occured (null = none occured): + This underlying error occurred (null = none occurred): ${underlyingError} diff --git a/src/lib/publish-changelog.ts b/src/lib/publish-changelog.ts index 877dd8af..01788d91 100644 --- a/src/lib/publish-changelog.ts +++ b/src/lib/publish-changelog.ts @@ -12,7 +12,7 @@ interface Input { octokit: Octokit repo: Repo /** - * Uses the release to manage the changelog changes. A preview relese will result + * Uses the release to manage the changelog changes. A preview release will result * in a pre-release github release. A stable release will result in the * preview github release being cleared of notes and pointed toward the latest * stable commit sha. diff --git a/src/lib/publish-package.ts b/src/lib/publish-package.ts index 09692d52..538707ce 100644 --- a/src/lib/publish-package.ts +++ b/src/lib/publish-package.ts @@ -5,7 +5,7 @@ import createGit from 'simple-git/promise' import * as Git from './git' -import { isGithubCIEnvironment } from './github-ci-environment' +import { isGitHubCIEnvironment } from './github-ci-environment' import * as Pacman from './pacman' type Options = { @@ -101,7 +101,7 @@ export async function* publishPackage(input: PublishPlan): AsyncGenerator 0 diff --git a/src/sdk/pr.spec.ts b/src/sdk/pr.spec.ts index a88c104a..2917ba17 100644 --- a/src/sdk/pr.spec.ts +++ b/src/sdk/pr.spec.ts @@ -40,7 +40,7 @@ it('preflight check that user is on branch with open pr', async () => { Object { "code": "npm_auth_not_setup", "details": Object {}, - "summary": "You must have npm auth setup to publish to the registrty", + "summary": "You must have npm auth setup to publish to the registry", }, ], "stops": Array [], @@ -71,7 +71,7 @@ it('makes a release for the current commit, updating pr dist tag, and version fo Object { "code": "npm_auth_not_setup", "details": Object {}, - "summary": "You must have npm auth setup to publish to the registrty", + "summary": "You must have npm auth setup to publish to the registry", }, ], "stops": Array [], diff --git a/src/sdk/pr.ts b/src/sdk/pr.ts index 4c79ad36..29c4206a 100644 --- a/src/sdk/pr.ts +++ b/src/sdk/pr.ts @@ -3,7 +3,7 @@ import { publishPackage, PublishPlan } from '../lib/publish-package' import { PullRequestVer } from '../lib/semver' import { getContext } from '../utils/context' import { npmAuthSetup } from '../utils/context-checkers' -import { check, guard, Validator } from '../utils/contrext-guard' +import { check, guard, Validator } from '../utils/context-guard' import { createDidNotPublish, createDidPublish, createDryRun } from '../utils/output' import { getNextPreReleaseBuildNum } from '../utils/pr-release' @@ -23,7 +23,7 @@ export async function runPullRequestRelease(options: Options) { const report = check({ context }) .errorUnless(npmAuthSetup()) .errorUnless(branchHasOpenPR()) - // todo only we if can figoure the commits since last pr release + // todo only we if can figure the commits since last pr release // .must(haveMeaningfulCommitsInTheSeries()) .run() diff --git a/src/sdk/preview.spec.ts b/src/sdk/preview.spec.ts index cd915793..49c410a1 100644 --- a/src/sdk/preview.spec.ts +++ b/src/sdk/preview.spec.ts @@ -71,7 +71,7 @@ it('if build-num flag passed, the build number is forced to be it', async () => Object { "code": "npm_auth_not_setup", "details": Object {}, - "summary": "You must have npm auth setup to publish to the registrty", + "summary": "You must have npm auth setup to publish to the registry", }, Object { "code": "must_be_on_trunk", @@ -123,7 +123,7 @@ describe('preflight checks', () => { Object { "code": "npm_auth_not_setup", "details": Object {}, - "summary": "You must have npm auth setup to publish to the registrty", + "summary": "You must have npm auth setup to publish to the registry", }, Object { "code": "must_be_on_trunk", @@ -166,7 +166,7 @@ describe('preflight checks', () => { Object { "code": "npm_auth_not_setup", "details": Object {}, - "summary": "You must have npm auth setup to publish to the registrty", + "summary": "You must have npm auth setup to publish to the registry", }, Object { "code": "must_be_on_trunk", @@ -209,7 +209,7 @@ describe('preflight checks', () => { Object { "code": "npm_auth_not_setup", "details": Object {}, - "summary": "You must have npm auth setup to publish to the registrty", + "summary": "You must have npm auth setup to publish to the registry", }, Object { "code": "must_be_on_trunk", @@ -235,6 +235,6 @@ describe('preflight checks', () => { // TODO maybe... this is quite the edge-case and would charge all users a // latency fee wherein every stable preview release requires a pr check - // anyways just to see if this super weird case is ocurring... - it.todo('fails semantically if trunk and pr detected becuase that demands conflicting reactions') + // anyway just to see if this super weird case is occurring... + it.todo('fails semantically if trunk and pr detected because that demands conflicting reactions') }) diff --git a/src/sdk/preview.ts b/src/sdk/preview.ts index d07ad13c..89e7611a 100644 --- a/src/sdk/preview.ts +++ b/src/sdk/preview.ts @@ -5,7 +5,7 @@ import { publishPackage, PublishPlan } from '../lib/publish-package' import { PreviewVer, setBuildNum } from '../lib/semver' import { getContext } from '../utils/context' import { isTrunk, npmAuthSetup } from '../utils/context-checkers' -import { check, guard, Validator } from '../utils/contrext-guard' +import { check, guard, Validator } from '../utils/context-guard' import { octokit } from '../utils/octokit' import { createDidNotPublish, createDidPublish, createDryRun } from '../utils/output' import { getNextPreview, isNoReleaseReason, Release } from '../utils/release' @@ -44,7 +44,7 @@ export async function runPreviewRelease(options: Options) { // TODO handle edge case: not a git repo // TODO handle edge case: a git repo with no commits // TODO nicer tag rendering: - // 1. for annotated tags should the messge + // 1. for annotated tags should the message // 2. show the tag author name // 3. show the the date the tag was made diff --git a/src/sdk/stable.spec.ts b/src/sdk/stable.spec.ts index df1b3d2e..1f76a1b0 100644 --- a/src/sdk/stable.spec.ts +++ b/src/sdk/stable.spec.ts @@ -1,4 +1,4 @@ -// TODO test that context honours the base branch setting of the repo +// TODO test that context honors the base branch setting of the repo // async function setupPackageJson() { // await ctx.fs.writeAsync('package.json', { diff --git a/src/sdk/stable.ts b/src/sdk/stable.ts index c666e2c1..8ecca321 100644 --- a/src/sdk/stable.ts +++ b/src/sdk/stable.ts @@ -4,7 +4,7 @@ import { publishChangelog } from '../lib/publish-changelog' import { publishPackage, PublishPlan } from '../lib/publish-package' import { getContext } from '../utils/context' import { branchSynced, isTrunk, npmAuthSetup } from '../utils/context-checkers' -import { check, guard, Validator } from '../utils/contrext-guard' +import { check, guard, Validator } from '../utils/context-guard' import { octokit } from '../utils/octokit' import { createDidNotPublish, createDidPublish, createDryRun } from '../utils/output' import { getNextStable, Release } from '../utils/release' diff --git a/src/utils/context-checkers.ts b/src/utils/context-checkers.ts index 0add51d5..6dc95b00 100644 --- a/src/utils/context-checkers.ts +++ b/src/utils/context-checkers.ts @@ -1,5 +1,5 @@ import { validateNPMAuthSetup } from '../lib/npm-auth' -import { Validator } from './contrext-guard' +import { Validator } from './context-guard' export function isTrunk(): Validator { return { @@ -33,7 +33,7 @@ export function branchSynced(): Validator { export function npmAuthSetup(): Validator { return { code: 'npm_auth_not_setup', - summary: 'You must have npm auth setup to publish to the registrty', + summary: 'You must have npm auth setup to publish to the registry', run() { const result = validateNPMAuthSetup() diff --git a/src/utils/contrext-guard.ts b/src/utils/context-guard.ts similarity index 100% rename from src/utils/contrext-guard.ts rename to src/utils/context-guard.ts diff --git a/src/utils/context.ts b/src/utils/context.ts index 77a57bdf..fcca528c 100644 --- a/src/utils/context.ts +++ b/src/utils/context.ts @@ -1,6 +1,6 @@ import * as Git from '../lib/git' import { createGit, GitSyncStatus } from '../lib/git2' -import { parseGithubCIEnvironment } from '../lib/github-ci-environment' +import { parseGitHubCIEnvironment } from '../lib/github-ci-environment' import * as PackageJson from '../lib/package-json' import { octokit } from './octokit' import * as Rel from './release' @@ -70,7 +70,7 @@ export async function getLocationContext({ let githubCIEnvironment = null if (readFromCIEnvironment) { - githubCIEnvironment = parseGithubCIEnvironment() + githubCIEnvironment = parseGitHubCIEnvironment() } // Get repo info @@ -80,7 +80,7 @@ export async function getLocationContext({ repoInfo = githubCIEnvironment?.parsed.repo if (!repoInfo) { - repoInfo = await Git.parseGithubRepoInfoFromGitConfig() + repoInfo = await Git.parseGitHubRepoInfoFromGitConfig() } // Get which branch is trunk, overridable diff --git a/src/utils/output.ts b/src/utils/output.ts index c58f0107..dace820e 100644 --- a/src/utils/output.ts +++ b/src/utils/output.ts @@ -1,7 +1,7 @@ import { format, inspect } from 'util' import { Release } from '../lib/publish-package' import { casesHandled } from '../lib/utils' -import { ValidationResult } from './contrext-guard' +import { ValidationResult } from './context-guard' type Ok> = { kind: 'ok' @@ -45,11 +45,11 @@ export function outputOk(type: string, data: Record): void { } /** - * Outout Exception data to stdout. Unlike an error, exceptions are failure + * Output Exception data to stdout. Unlike an error, exceptions are failure * scenarios that are known to be possible, and thus handled gracefully. * * @param identifier This is a meaningful exception slug like `no_permissions`. - * Use this for to organize exeptions into a catalogue. + * Use this for to organize exceptions into a catalogue. * * @param summary Free form text that briefly explains what the exception * is, why it is happening, etc. Do not rely on rich context rendering here. @@ -73,7 +73,7 @@ export function output(message: Message, opts: OutputOptions): void { } else { if (message.kind === 'exception') { let s = '' - s += `An exception occured: ${message.type}\n` + s += `An exception occurred: ${message.type}\n` s += `\n` s += message.data.summary if (message.data.context && Object.keys(message.data.context).length > 0) { diff --git a/src/utils/pr-release.ts b/src/utils/pr-release.ts index 0ead7986..78b9a229 100644 --- a/src/utils/pr-release.ts +++ b/src/utils/pr-release.ts @@ -27,7 +27,7 @@ export function getPullRequestReleaseVersionForLocation(input: { * * The pre-release series is the group versions published matching the given prefix. * - * The buld num is assumed to be digits immediately following the prefix up to + * The build num is assumed to be digits immediately following the prefix up to * the end of the version or up to the next `.`. * * If a version matches prefix but then not the pattern described above then it diff --git a/src/utils/release.spec.ts b/src/utils/release.spec.ts index 82d25a4c..ab61b8a2 100644 --- a/src/utils/release.spec.ts +++ b/src/utils/release.spec.ts @@ -83,7 +83,7 @@ function s(): RawLogEntryValues { } /** - * unreleaesd commit + * unreleased commit */ function n(): RawLogEntryValues { return ['sha', '', `fix: thing ${noneCounter++}`] diff --git a/tests/__lib/helpers.ts b/tests/__lib/helpers.ts index 5b1acf26..9a7911c3 100644 --- a/tests/__lib/helpers.ts +++ b/tests/__lib/helpers.ts @@ -18,7 +18,7 @@ export function resetEnvironmentBeforeEachTest() { * Helper for creating a specialized workspace */ export function createContext(name: string) { - const ws = addOctokitToworkspace( + const ws = addOctokitToWorkspace( addDripipToWorkspace( WS.createWorkspace({ name: name, @@ -47,7 +47,7 @@ export function createContext(name: string) { } // any https://github.com/octokit/rest.js/issues/1624 -export function addOctokitToworkspace(ws: T): T & { octokit: any } { +export function addOctokitToWorkspace(ws: T): T & { octokit: any } { beforeAll(() => { // @ts-ignore ws.octokit = new Octokit({