Skip to content

Commit

Permalink
Merge pull request #978 from msanguineti/release/v3.0.0
Browse files Browse the repository at this point in the history
chore(release): 🔖 v3.0.0
msanguineti authored Jan 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 1ca79ce + 6af949a commit b77dd82
Showing 24 changed files with 5,860 additions and 6,145 deletions.
4 changes: 1 addition & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -4,12 +4,10 @@
"node": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {}
7 changes: 7 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: 'CodeQL config file'

paths:
- src
paths-ignore:
- node_modules
- test
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ updates:
- package-ecosystem: npm
directory: '/'
schedule:
interval: daily
interval: weekly
open-pull-requests-limit: 10
versioning-strategy: increase
labels:
@@ -12,7 +12,7 @@ updates:
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: daily
interval: weekly
open-pull-requests-limit: 10
labels:
- 'dependencies'
34 changes: 16 additions & 18 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,13 @@
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
# ******** NOTE ********

name: 'CodeQL'

on:
@@ -12,7 +19,7 @@ on:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: '0 14 * * 4'
- cron: '30 8 * * 1'

jobs:
analyze:
@@ -22,30 +29,21 @@ jobs:
strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['typescript']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
language: ['javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v3
# with:
# # We must fetch at least the immediate parents so that if this is
# # a pull request then we can checkout the head.
# fetch-depth: 2

# # If this run was triggered by a pull request event, then checkout
# # the head of the pull request instead of the merge commit.
# - run: git checkout HEAD^2
# if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
@@ -54,7 +52,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -68,4 +66,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
21 changes: 10 additions & 11 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
# push:
# branches: [main]
# branches:
# - main
pull_request:
branches: [main]

branches:
- main
jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]

node-version:
- 18.x
- 20.x
# - 22.x
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.5.1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm run build
- run: GOF_DRY_RUN=true npm test
32 changes: 32 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm ci
- run: npm run build
- run: GOF_DRY_RUN=true npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
5 changes: 2 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
#!/bin/sh

npx --no -- commitlint --edit ${1}
npx commitlint --edit $1
3 changes: 1 addition & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
#!/bin/sh

npx lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/hydrogen
458 changes: 0 additions & 458 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -298,7 +298,7 @@ set GOF_DRY_RUN=1 & gof start release

## Changelog

See [CHANGELOG](./CHANGELOG.md) for latest changes.
The changelog can be found on the [Releases page](https://github.com/msanguineti/git-oneflow/releases).

## Contributing

Binary file modified g1-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11,123 changes: 5,703 additions & 5,420 deletions package-lock.json

Large diffs are not rendered by default.

114 changes: 27 additions & 87 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "git-oneflow",
"version": "2.0.0",
"version": "3.0.0",
"description": "CLI tooling implementing GIT OneFlow branching model",
"bin": {
"gof": "bin/cli.js",
@@ -11,20 +11,14 @@
],
"type": "module",
"scripts": {
"pretest": "npm run lint",
"test": "tsc && jest",
"posttest": "npm run format",
"clean": "rimraf bin",
"prebuild": "npm run clean",
"build": "rollup -c --bundleConfigAsCjs",
"build": "rollup -c --bundleConfigAsCjs && terser bin/cli.js --mangle toplevel -c toplevel,passes=2,ecma=2022,unsafe -o bin/cli.js",
"watch": "rollup -c --bundleConfigAsCjs --watch",
"typecheck": "tsc",
"prerelease": "GOF_DRY_RUN=true npm t",
"release": "standard-version",
"prepublishOnly": "npm run build && npm t",
"lint": "eslint . --cache --fix --ext .ts",
"format": "prettier --loglevel warn --write .",
"prepare": "husky install"
"prepare": "husky"
},
"repository": {
"type": "git",
@@ -45,32 +39,32 @@
},
"homepage": "https://github.com/msanguineti/git-oneflow#readme",
"devDependencies": {
"@commitlint/cli": "^17.3.0",
"@commitlint/config-conventional": "^17.3.0",
"@rollup/plugin-commonjs": "^23.0.2",
"@rollup/plugin-json": "^5.0.1",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-typescript": "^9.0.2",
"@types/inquirer": "^9.0.3",
"@types/jest": "^29.2.3",
"@types/shelljs": "^0.8.11",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
"eslint": "^8.28.0",
"husky": "^8.0.2",
"jest": "^29.3.1",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"rollup": "^3.3.0",
"standard-version": "^9.5.0",
"ts-jest": "^29.0.3",
"typescript": "^4.9.3"
"@commitlint/cli": "^18.6.0",
"@commitlint/config-conventional": "^18.6.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@types/inquirer": "^9.0.7",
"@types/jest": "^29.5.11",
"@types/shelljs": "^0.8.15",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"eslint": "^8.56.0",
"husky": "^9.0.6",
"jest": "^29.7.0",
"lint-staged": "^15.2.0",
"prettier": "^3.2.4",
"rollup": "^4.9.6",
"terser": "^5.27.0",
"ts-jest": "^29.1.2",
"typescript": "^5.3.3"
},
"dependencies": {
"commander": "^9.4.1",
"cosmiconfig": "^7.1.0",
"fude": "^3.0.1",
"inquirer": "^9.1.4",
"commander": "^11.1.0",
"cosmiconfig": "^9.0.0",
"fude": "^4.0.0",
"inquirer": "^9.2.12",
"shelljs": "^0.8.5"
},
"commitlint": {
@@ -86,60 +80,6 @@
"semi": false,
"singleQuote": true
},
"standard-version": {
"types": [
{
"type": "feat",
"section": "Features",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "chore",
"section": "Chores & Miscellanea",
"hidden": true
},
{
"type": "build",
"section": "Chores & Miscellanea",
"hidden": true
},
{
"type": "docs",
"section": "Documentation",
"hidden": false
},
{
"type": "style",
"section": "Style & Format",
"hidden": false
},
{
"type": "refactor",
"section": "Refactoring",
"hidden": false
},
{
"type": "perf",
"section": "Improvements",
"hidden": false
},
{
"type": "test",
"section": "Tests",
"hidden": false
},
{
"type": "ci",
"section": "CI/CD",
"hidden": false
}
]
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
26 changes: 13 additions & 13 deletions src/cmds/finish.ts
Original file line number Diff line number Diff line change
@@ -114,7 +114,7 @@ const maybeUseCurrentBranch = async (): Promise<string | undefined> => {

const askBranchNameToUser = async (
base: GofOptionsType,
cmdName: string
cmdName: string,
): Promise<string> => {
const userInput =
(base ? `${base}/` : '') +
@@ -137,7 +137,7 @@ const askBranchNameToUser = async (
const maybeCheckoutAndGetBranchName = async (
name: string,
base: string,
arg?: string
arg?: string,
): Promise<string> => {
const baseBranch = base ?? getBaseBranch(name)

@@ -155,7 +155,7 @@ const maybeCheckoutAndGetBranchName = async (

const maybeDeleteBranch = async (
_delete: boolean | undefined,
branchName: string
branchName: string,
): Promise<void> => {
const doDelete = _delete ?? getConfigValue('deleteAfterMerge') === 'true'
if (doDelete) {
@@ -173,7 +173,7 @@ const maybeDeleteBranch = async (
const maybePush = (
push: boolean | undefined,
onto: string,
tag: GofOptionsType
tag: GofOptionsType,
): void => {
const doPush = push ?? getConfigValue('pushAfterMerge') === 'true'
if (doPush) pushToOrigin(onto, tag)
@@ -182,12 +182,12 @@ const maybePush = (
const releaseHotfixAction = async (
arg: string,
opts: Record<string, GofOptionsType>,
cmd: Command
cmd: Command,
): Promise<void> => {
const branchName = await maybeCheckoutAndGetBranchName(
cmd.name(),
opts.base as string,
arg
arg,
)

const tag = opts.tag ?? (await askTagNameToUser())
@@ -213,7 +213,7 @@ const releaseHotfixAction = async (
await promptUser([
askConfirmation({
message: `Merge '${tag || branchName}' into '${getConfigValue(
'main'
'main',
)}'?`,
name: 'confirmation',
}),
@@ -262,8 +262,8 @@ const getStrategy = (strategyOpt: StrategyOptions): string => {
if (!strategyOptionValues.includes(strategy))
throw new Error(
`unknown strategy option: '${strategy}'. Valid options are '${strategyOptionValues.join(
', '
)}'`
', ',
)}'`,
)
return strategy
}
@@ -282,14 +282,14 @@ const feature: GofCommand = {
action: async (
arg: string,
opts: Record<string, GofOptionsType>,
cmd: Command
cmd: Command,
) => {
const strategy = getStrategy(opts.strategy as StrategyOptions)

const branchName = await maybeCheckoutAndGetBranchName(
cmd.name(),
opts.base as string,
arg
arg,
)

const onto =
@@ -298,11 +298,11 @@ const feature: GofCommand = {
? await letUserSelectBranch()
: getConfigValue('development') ?? getConfigValue('main'))

if (/^rebase/.test(strategy))
if (strategy.startsWith('rebase'))
rebase(
onto as string,
(opts.interactive as boolean) ??
getConfigValue('interactive') === 'true'
getConfigValue('interactive') === 'true',
)

checkoutBranch(onto as string)
6 changes: 3 additions & 3 deletions src/cmds/gofCommand.ts
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ export type GofCommand = {
action?: (
arg: string,
opts: Record<string, GofOptionsType>,
cmd: Command
cmd: Command,
) => void | Promise<void>
examples?: string[]
}
@@ -50,12 +50,12 @@ export const makeGofCmd = ({
})
.option(
'-b, --base <name>',
`override the current base branch name: '${getBaseBranch(cmd.name())}'`
`override the current base branch name: '${getBaseBranch(cmd.name())}'`,
)
.option('--no-base', 'do not use a base branch name')
.option('--debug')
.on('option:debug', () =>
info('debug', JSON.stringify(cmd.opts(), null, 2))
info('debug', JSON.stringify(cmd.opts(), null, 2)),
)

cmd.alias(name.charAt(0))
2 changes: 1 addition & 1 deletion src/cmds/init.ts
Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@ const maybeUseTheForce = (force?: boolean): void => {

if (!force) {
warning(
`a configuration exists at '${oldConfFile}'. Cowardly refusing to proceed!`
`a configuration exists at '${oldConfFile}'. Cowardly refusing to proceed!`,
)
process.exit(0)
}
4 changes: 2 additions & 2 deletions src/cmds/start.ts
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import {
import { promptUser, presentChoices, askInput } from '../lib/inquisitor'

const getDefaultReference = async (
cmdName: string
cmdName: string,
): Promise<string | undefined> => {
switch (cmdName) {
case 'feature':
@@ -40,7 +40,7 @@ const letUserSelectBranch = async (): Promise<string> => {
const cmdAction = async (
arg: string,
opts: Record<string, GofOptionsType>,
cmd: Command
cmd: Command,
): Promise<void> => {
const name =
arg ??
14 changes: 5 additions & 9 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -44,9 +44,7 @@ export const defaultConfiguration: Configuration = {
}

export const optionNames = Object.keys(defaultConfiguration)
.filter((key) =>
Object.prototype.hasOwnProperty.call(defaultConfiguration, key)
)
.filter((key) => Object.hasOwn(defaultConfiguration, key))
.reduce((a: { [key: string]: string }, v: string) => {
a[v] = v
return a
@@ -60,27 +58,25 @@ export const load = (file?: string): void => {
const gofConfig = { ...defaultConfiguration, ...result?.config }

for (const key in gofConfig) {
if (Object.prototype.hasOwnProperty.call(defaultConfiguration, key)) {
if (Object.hasOwn(defaultConfiguration, key)) {
const value = gofConfig[key]

if (value) process.env[`gof_${key}`.toUpperCase()] = value
} else {
throw new Error(
`unknown configuration option ${key} in ${result?.filepath}`
`unknown configuration option ${key} in ${result?.filepath}`,
)
}
}
}

export const getConfigFile = (): string | undefined => configFile

export const getConfigValue = (
key: keyof Configuration
): string | StrategyOptions | undefined =>
export const getConfigValue = (key: keyof Configuration): string | undefined =>
process.env[`gof_${key}`.toUpperCase()]

export const getDefaultValue = (
key: keyof Configuration
key: keyof Configuration,
): string | boolean | undefined => defaultConfiguration[key]

export const getBaseBranch = (cmd: string): string | undefined => {
4 changes: 2 additions & 2 deletions src/lib/inquisitor.ts
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ export const askInput = ({
when?: (answer: Answers) => boolean
validate?: (
input: string,
answer: Answers
answer: Answers,
) => string | boolean | Promise<string | boolean>
}): InputQuestion => {
return {
@@ -78,7 +78,7 @@ export const askConfirmation = ({
}

export const promptUser = async (
questions: GofQuestion[]
questions: GofQuestion[],
): Promise<Answers> => {
return inquirer.prompt(questions)
}
4 changes: 2 additions & 2 deletions src/lib/log.ts
Original file line number Diff line number Diff line change
@@ -6,14 +6,14 @@ export const info = (key: string, msg: string): void => {

export const error = (msg: string | Error): void => {
console.error(
`${red('error')}: ${white(msg instanceof Error ? msg.message : msg)}`
`${red('error')}: ${white(msg instanceof Error ? msg.message : msg)}`,
)
if (process.env.DEBUG && msg instanceof Error) console.error(msg)
}

export const warning = (msg: string | Error): void => {
console.warn(
`${yellow('warning')}: ${white(msg instanceof Error ? msg.message : msg)}`
`${yellow('warning')}: ${white(msg instanceof Error ? msg.message : msg)}`,
)
if (process.env.DEBUG && msg instanceof Error) console.error(msg)
}
32 changes: 16 additions & 16 deletions tests/gof.spec.ts
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ describe('Prepare test environemnt', () => {
})

expect(shellString.stdout).toContain(
'config: new configuration file created'
'config: new configuration file created',
)
expect(test('-e', '.git-oneflowrc')).toBe(true)
})
@@ -112,12 +112,12 @@ describe('Prepare test environemnt', () => {
`node bin/cli.js s f -r ${testBranch} ${featureName}`,
{
silent: SILENT,
}
},
)

if (process.env.GOF_DRY_RUN)
expect(shellString.stdout).toMatch(
'dry-run: git checkout -b feature/my-feature testBranch'
'dry-run: git checkout -b feature/my-feature testBranch',
)
else {
expect(getCurrentBranch()).toMatch(`feature/${featureName}`)
@@ -129,7 +129,7 @@ describe('Prepare test environemnt', () => {
`node bin/cli.js f f -o ${testBranch} ${featureName} --no-delete --no-interactive --no-push`,
{
silent: SILENT,
}
},
)

if (process.env.GOF_DRY_RUN)
@@ -140,7 +140,7 @@ describe('Prepare test environemnt', () => {
'\n' +
'dry-run: git checkout testBranch' +
'\n' +
'dry-run: git merge --ff-only feature/my-feature'
'dry-run: git merge --ff-only feature/my-feature',
)
else {
expect(branchExists(`feature/${featureName}`)).toBe(true)
@@ -152,16 +152,16 @@ describe('Prepare test environemnt', () => {
it('fails to start a feature', () => {
const noBranch = 'no-branch'
const shellString = exec(
`node bin/cli.js s f ${featureName} -r ${noBranch}`
`node bin/cli.js s f ${featureName} -r ${noBranch}`,
)

if (process.env.GOF_DRY_RUN)
expect(shellString.stdout).toMatch(
`dry-run: git checkout -b feature/${featureName} ${noBranch}`
`dry-run: git checkout -b feature/${featureName} ${noBranch}`,
)
else
expect(shellString.stderr).toMatch(
`error: fatal: '${noBranch}' is not a commit and a branch 'feature/${featureName}' cannot be created from it`
`error: fatal: '${noBranch}' is not a commit and a branch 'feature/${featureName}' cannot be created from it`,
)
})

@@ -170,12 +170,12 @@ describe('Prepare test environemnt', () => {
`node bin/cli.js s r -r ${testBranch} ${releaseName}`,
{
silent: SILENT,
}
},
)

if (process.env.GOF_DRY_RUN)
expect(shellString.stdout).toMatch(
'dry-run: git checkout -b release/my-release testBranch'
'dry-run: git checkout -b release/my-release testBranch',
)
else {
expect(getCurrentBranch()).toMatch(`release/${releaseName}`)
@@ -188,7 +188,7 @@ describe('Prepare test environemnt', () => {
`node bin/cli.js f r -o ${testBranch} ${releaseName} --no-delete --no-push -t ${tag} -m 'chore(release) ${tag}'`,
{
silent: SILENT,
}
},
)

if (process.env.GOF_DRY_RUN)
@@ -199,7 +199,7 @@ describe('Prepare test environemnt', () => {
'\n' +
'dry-run: git checkout testBranch' +
'\n' +
'dry-run: git merge release/my-release'
'dry-run: git merge release/my-release',
)
else {
expect(branchExists(`release/${releaseName}`)).toBe(true)
@@ -215,12 +215,12 @@ describe('Prepare test environemnt', () => {
`node bin/cli.js s h -r ${testBranch} ${hotfixName}`,
{
silent: SILENT,
}
},
)

if (process.env.GOF_DRY_RUN)
expect(shellString.stdout).toMatch(
'dry-run: git checkout -b hotfix/my-hotfix testBranch'
'dry-run: git checkout -b hotfix/my-hotfix testBranch',
)
else {
expect(getCurrentBranch()).toMatch(`hotfix/${hotfixName}`)
@@ -233,7 +233,7 @@ describe('Prepare test environemnt', () => {
`node bin/cli.js f h -o ${testBranch} ${hotfixName} --no-delete --no-push -t ${tag} -m 'chore(release) ${tag}'`,
{
silent: SILENT,
}
},
)

if (process.env.GOF_DRY_RUN)
@@ -244,7 +244,7 @@ describe('Prepare test environemnt', () => {
'\n' +
'dry-run: git checkout testBranch' +
'\n' +
'dry-run: git merge hotfix/my-hotfix'
'dry-run: git merge hotfix/my-hotfix',
)
else {
expect(branchExists(`hotfix/${hotfixName}`)).toBe(true)
11 changes: 10 additions & 1 deletion tests/setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import shelljs from 'shelljs'
const { exec, test } = shelljs

declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace NodeJS {
interface Global {
__STASHED__: boolean
}
}
}

export default async (): Promise<void> => {
if (exec('git diff HEAD --name-only', { silent: true }).stdout !== '') {
exec('git stash push -u', { silent: true })
@@ -11,5 +20,5 @@ export default async (): Promise<void> => {
glbl.__STASHED__ = true
}

if (!test('-e', 'bin/cli')) exec('npm run build', { silent: true })
if (!test('-e', 'bin/cli.js')) exec('npm run build', { silent: true })
}
94 changes: 3 additions & 91 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,105 +1,17 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */

/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */

/* Language and Environment */
"target": "ES2019" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */

/* Modules */
"target": "ES2022" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"module": "ESNext" /* Specify what module code is generated. */,
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
"resolveJsonModule": true /* Enable importing .json files. */,
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */

/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */

/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "outFile": "./bin/cli", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./bin", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
"noEmit": true /* Disable emitting files from a compilation. */,
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */

/* Interop Constraints */
"isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,

/* Type Checking */
"strict": true /* Enable all strict type-checking options. */,
"noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */

/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
},
"exclude": ["node_modules"],
"include": ["src", "tests"]
"include": ["src", "tests"],
}

0 comments on commit b77dd82

Please sign in to comment.