Skip to content
This repository was archived by the owner on Aug 8, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .github/workflows/release.yml

This file was deleted.

5 changes: 0 additions & 5 deletions AUTHORS

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

This file is frozen history: it covers releases up to and including v8.0.8, and
is not regenerated any more. This package is deprecated and nothing is released
from here any more — see the [README](README.md) for the replacement.

## [v8.0.8](https://github.com/tanem/tanem-scripts/tree/v8.0.8) (2026-08-03)
[Full Changelog](https://github.com/tanem/tanem-scripts/compare/v8.0.7...v8.0.8)

Expand Down
127 changes: 17 additions & 110 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,115 +1,22 @@
# tanem-scripts

[![npm version](https://img.shields.io/npm/v/tanem-scripts.svg?style=flat-square)](https://www.npmjs.com/package/tanem-scripts)
[![build status](https://img.shields.io/github/actions/workflow/status/tanem/tanem-scripts/ci.yml?branch=master&style=flat-square)](https://github.com/tanem/tanem-scripts/actions/workflows/ci.yml)
[![coverage status](https://img.shields.io/codecov/c/github/tanem/tanem-scripts.svg?style=flat-square)](https://codecov.io/gh/tanem/tanem-scripts)
[![npm downloads](https://img.shields.io/npm/dm/tanem-scripts.svg?style=flat-square)](https://www.npmjs.com/package/tanem-scripts)

> Common scripts for my projects.

## Usage

```
Usage: tanem-scripts [options] [command]

Common scripts for my projects.

Options:
-V, --version output the version number
-h, --help output usage information

Commands:
authors generates a list of authors in a format suitable for inclusion in an AUTHORS file
changelog [options] generates a changelog using GitHub tags and pull requests
release runs npm-version with a valid semver.inc argument
```

## API

### authors()

Returns a `Promise` that will be resolved with a list of authors sorted alphabetically by author name. If an error occurs during execution, the `Promise` is rejected with an `Error` object.

**Example**

```ts
// Note: The `fs.promises` API was added in Node.js v10.0.0.
import { promises as fs } from 'fs';
import path from 'path';
import { authors } from 'tanem-scripts';

(async () => {
try {
const result = await authors();
await fs.writeFile(path.join(__dirname, 'AUTHORS'), result, 'utf-8');
} catch (error) {
console.error(error);
}
})();
```

---

### changelog([options])

Returns a `Promise` that will be resolved with the changelog. If an error occurs during execution, the `Promise` is rejected with an `Error` object.

**Arguments**

- `options` - _Optional_ An object containing the optional arguments defined below. Defaults to `{}`.
- `futureRelease` - _Optional_ Tag to use for PRs merged since the last published tag. If unspecified, those PRs will be excluded.

**Example**

```ts
// Note: The `fs.promises` API was added in Node.js v10.0.0.
import { promises as fs } from 'fs';
import path from 'path';
import { changelog } from 'tanem-scripts';

(async () => {
try {
const result = await changelog({
futureRelease: 'v2.0.0',
});
await fs.writeFile(path.join(__dirname, 'CHANGELOG.md'), result, 'utf-8');
} catch (error) {
console.error(error);
}
})();
```

---

### release()

Returns a `Promise` that resolves with `'released'` once the release script completes, or `'nothing-to-release'` if no pull requests have merged since the last published tag. If an error occurs during execution, the `Promise` is rejected with an `Error` object.

**Example**

```ts
import { release } from 'tanem-scripts';

(async () => {
try {
await release();
} catch (error) {
console.error(error);
}
})();
```

## Installation

```
$ npm install tanem-scripts --save-dev
```

You'll also need to generate a new [GitHub personal access token](https://github.com/settings/tokens), then set an environment variable by running the following command at the prompt or by adding it to your shell profile:

```sh
export CHANGELOG_GITHUB_TOKEN=<your_github_personal_access_token>
```
> **Deprecated.** Use [`tanem/release-action`](https://github.com/tanem/release-action) instead.

This package automated label-driven releases for my open-source repos: it
derived a semver bump from the labels on the week's merged pull requests,
versioned and tagged the repo, regenerated CHANGELOG.md, and published to npm.

That job now belongs to
[`tanem/release-action`](https://github.com/tanem/release-action), a composite
GitHub Action doing the same work with no npm dependency to install and no
personal access token to hold. Release notes there are published to GitHub
Releases rather than a regenerated CHANGELOG.md, and the `authors` command has
no successor — it was dropped rather than ported.

Every repo that used this package is off it, and nothing is released from here
any more: the weekly release cron is gone, so no release can fire.
[CHANGELOG.md](CHANGELOG.md) is frozen at v8.0.8, and this repo's history stays
readable.

## License

Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"url": "git+https://github.com/tanem/tanem-scripts.git"
},
"keywords": [
"authors",
"changelog",
"changelog-generator",
"cli",
Expand All @@ -28,7 +27,6 @@
"node",
"script",
"scripts",
"shortlog",
"typescript"
],
"license": "MIT",
Expand Down Expand Up @@ -73,7 +71,6 @@
"compile": "tsc -p tsconfig.base.json",
"format": "prettier --write \"**/*.{js,ts}\"",
"lint": "eslint . --ext .js,.ts",
"release": "node dist/cli release",
"test": "run-s check:* lint build test:*",
"test:cjs": "jest --config ./scripts/jest/config.cjs.js",
"test:src": "jest --config ./scripts/jest/config.src.js"
Expand Down
1 change: 0 additions & 1 deletion scripts/jest/config.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ module.exports = Object.assign({}, srcConfig, {
'^../src$': '<rootDir>/dist/index.js',
'^../src/data$': '<rootDir>/dist/data.js',
'^../src/changelog$': '<rootDir>/dist/changelog.js',
'^../src/authors$': '<rootDir>/dist/authors.js',
},
});
27 changes: 0 additions & 27 deletions src/authors.ts

This file was deleted.

21 changes: 0 additions & 21 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env node

import { Command } from 'commander';
import authors from './authors';
import changelog from './changelog';
import release from './release';

Expand All @@ -20,26 +19,6 @@ program.on('command:*', function () {
process.exit(1);
});

program
.command('authors')
.description(
'generates an alphabetised list of authors in a format suitable for inclusion in an AUTHORS file',
)
.action(async () => {
try {
const result = await authors();
process.stdout.write(result);
} catch (error) {
console.error(error);
process.exit(1);
}
})
.on('--help', () => {
console.log(`
Examples:
$ authors`);
});

program
.command('changelog')
.description('generates a changelog using GitHub tags and pull requests')
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export { default as authors } from './authors';
export { default as changelog } from './changelog';
export { default as release } from './release';
4 changes: 0 additions & 4 deletions src/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import execa from 'execa';
import fs from 'fs-extra';
import path from 'path';
import semver from 'semver';
import authors from './authors';
import changelog from './changelog';
import { get as getData } from './data';

Expand Down Expand Up @@ -71,9 +70,6 @@ const release = async (): Promise<'released' | 'nothing-to-release'> => {
changelogContent,
);

const authorsContent = await authors();
await fs.outputFile(path.join(process.cwd(), 'AUTHORS'), authorsContent);

await fs.writeJSON(
packagePath,
{ ...packageObj, version: newVersion },
Expand Down
14 changes: 0 additions & 14 deletions test/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ describe('CLI integration tests', () => {
}
});

test('authors command produces valid output', () => {
const output = execSync(`${CLI_PATH} authors`, {
encoding: 'utf-8',
env: process.env,
});

// Should contain valid author entries
expect(output).toMatch(/[\w\s<>@\[\].-]+/);
expect(output.split('\n').length).toBeGreaterThan(0);

// Should contain at least one email address
expect(output).toMatch(/<[^>]+>/);
});

test('changelog command produces valid markdown', () => {
const output = execSync(`${CLI_PATH} changelog`, {
encoding: 'utf-8',
Expand Down
5 changes: 0 additions & 5 deletions test/release.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
jest.mock('../src/changelog');
jest.mock('../src/authors');

import { release } from '../src';
import changelog from '../src/changelog';
import authors from '../src/authors';
import * as data from '../src/data';

const mockDataWithLabels = {
Expand Down Expand Up @@ -50,9 +48,6 @@ describe('release validation', () => {
(changelog as jest.MockedFunction<typeof changelog>).mockResolvedValue(
'# Changelog',
);
(authors as jest.MockedFunction<typeof authors>).mockResolvedValue(
'Author1',
);
});

afterEach(() => {
Expand Down
Loading