-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves template files to the `template` directory and updates the template. Fixes minor template issues.
- Loading branch information
1 parent
cea99e0
commit d23e49d
Showing
19 changed files
with
191 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: CI | ||
on: | ||
- push | ||
- pull_request | ||
jobs: | ||
test: | ||
name: Node.js ${{ matrix.node-version }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node-version: [16, 18, 20] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm install | ||
- run: npm run ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
coverage | ||
dist | ||
package-lock.json | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"rules": { | ||
"arrow-parens": "off", | ||
"quotes": "off", | ||
"@typescript-eslint/quotes": ["error", "double"], | ||
"object-curly-spacing": "off", | ||
"@typescript-eslint/object-curly-spacing": ["error", "always"], | ||
"@typescript-eslint/no-confusing-void-expression": ["error", { "ignoreArrowShorthand": true }], | ||
"object-shorthand": ["error", "always", { "avoidExplicitReturnArrows": false }], | ||
"@typescript-eslint/keyword-spacing": ["error", { "overrides": { | ||
"if": { "after": false }, | ||
"for": {"after": false }, | ||
"while": {"after": false }, | ||
"catch": {"after": false } | ||
}}] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"name": "{{ tmplr.project_name }}", | ||
"version": "0.0.0", | ||
"description": "{{ tmplr.project_description }}", | ||
"keywords": [ | ||
"cli", | ||
"cli-app", | ||
"command line" | ||
], | ||
"license": "MIT", | ||
"repository": "tommy-mitchell/{{ tmplr.project_name | skip: @tommy-mitchell/ }}", | ||
"author": { | ||
"name": "Tommy Mitchell", | ||
"url": "https://tommymitchell.io" | ||
}, | ||
"type": "module", | ||
"bin": { | ||
"{{ tmplr.command_name }}": "dist/cli.js" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"prepublishOnly": "npm run build", | ||
"build": "tsc && chmodx --package", | ||
"postbuild": "replace-in-files dist/cli.js --string='#!/usr/bin/env tsx' --replacement='#!/usr/bin/env node'", | ||
"test": "listr xo 'c8 ava'" | ||
}, | ||
"dependencies": { | ||
"meow": "^12.0.1" | ||
}, | ||
"devDependencies": { | ||
"@johnowennixon/chmodx": "1.1.0", | ||
"@tommy-mitchell/tsconfig": "^1.0.0", | ||
"@types/node": "^16", | ||
"ava": "^5.3.1", | ||
"c8": "^8.0.0", | ||
"execa": "^7.1.1", | ||
"get-bin-path": "^10.0.0", | ||
"is-executable": "^2.0.1", | ||
"listr-cli": "^0.3.0", | ||
"replace-in-files-cli": "^2.2.0", | ||
"tsx": "^3.12.7", | ||
"typescript": "~5.1.6", | ||
"xo": "^0.54.2" | ||
}, | ||
"engines": { | ||
"node": ">=16" | ||
}, | ||
"ava": { | ||
"files": [ | ||
"test/*.ts" | ||
], | ||
"extensions": { | ||
"ts": "module" | ||
}, | ||
"nodeArguments": [ | ||
"--loader=tsx" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { fileURLToPath } from "node:url"; | ||
import path from "node:path"; | ||
import { type Options as ExecaOptions } from "execa"; | ||
|
||
export const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
|
||
export const atFixture = (name: string): ExecaOptions => ({cwd: `${__dirname}/fixtures/${name}`}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import anyTest, { type TestFn } from "ava"; | ||
import { getBinPath } from "get-bin-path"; | ||
import { isExecutable } from "is-executable"; | ||
import {execa, type ExecaError} from "execa"; | ||
import { __dirname, atFixture } from "./_utils.js"; | ||
|
||
const test = anyTest as TestFn<{ | ||
binPath: string; | ||
helpText: string[]; | ||
}>; | ||
|
||
test.before("setup context", async t => { | ||
const binPath = await getBinPath(); | ||
t.truthy(binPath, "No bin path found!"); | ||
|
||
t.context.binPath = binPath!.replace("dist", "src").replace(".js", ".ts"); | ||
t.true(await isExecutable(t.context.binPath), "Source binary not executable!"); | ||
|
||
t.context.helpText = []; | ||
}); | ||
|
||
test("main", async t => { | ||
const {exitCode} = await execa(t.context.binPath); | ||
|
||
t.is(exitCode, 0); | ||
}); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "../tsconfig.test.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "@tommy-mitchell/tsconfig", | ||
"exclude": ["node_modules", "coverage", "dist"], | ||
"include": ["src"], | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"declaration": false | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"exclude": ["src"], | ||
"include": ["test"], | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"noUnusedLocals": false, | ||
}, | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.