diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4451503 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,18 @@ +name: CI +on: + push: + branches: [main, master] + pull_request: +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20, 22] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - run: npm install --no-audit --no-fund + - run: npm test diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..05b804b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Nicholas Ashkar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/package.json b/package.json index 5a6d173..abc9639 100644 --- a/package.json +++ b/package.json @@ -6,5 +6,6 @@ "bin": { "mrr": "./index.js" }, "keywords": ["mrr", "revenue", "indie-hacker", "saas", "cli", "tracker"], "license": "MIT", - "engines": { "node": ">=18" } + "scripts": { "test": "node --test" }, + "engines": { "node": ">=20" } } diff --git a/test/smoke.test.js b/test/smoke.test.js new file mode 100644 index 0000000..a2eba06 --- /dev/null +++ b/test/smoke.test.js @@ -0,0 +1,6 @@ +import { test } from 'node:test' +import { execFileSync } from 'node:child_process' +import { fileURLToPath } from 'node:url' +import { dirname, join } from 'node:path' +const root = join(dirname(fileURLToPath(import.meta.url)), '..') +test('entry is valid JavaScript', () => { execFileSync('node', ['--check', join(root, 'index.js')]) })