cookout 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +57 -0
- package/bin/cookout.js +4 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +84 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.js +113 -0
- package/package.json +57 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 cookout contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# cookout
|
|
2
|
+
|
|
3
|
+
Release readiness for packages, CLIs, and services.
|
|
4
|
+
|
|
5
|
+
Cookout will help run checks like:
|
|
6
|
+
|
|
7
|
+
- typecheck
|
|
8
|
+
- lint
|
|
9
|
+
- tests
|
|
10
|
+
- smoke tests
|
|
11
|
+
- package artifact checks
|
|
12
|
+
- install-from-tarball checks
|
|
13
|
+
- README snippet checks
|
|
14
|
+
- release metadata checks
|
|
15
|
+
|
|
16
|
+
For now, the package exposes a small CLI and config helper while the real runner takes shape.
|
|
17
|
+
|
|
18
|
+
## Use
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npx cookout@alpha check
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
npm install --save-dev cookout@alpha
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## CLI
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
cookout check
|
|
34
|
+
cookout check --json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`cookout check` currently prints the release-readiness checks Cookout plans to support. It exits successfully without running project commands while the runner is still in alpha.
|
|
38
|
+
|
|
39
|
+
## Config Helper
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
const { defineCookoutConfig } = require('cookout');
|
|
43
|
+
|
|
44
|
+
module.exports = defineCookoutConfig({
|
|
45
|
+
project: 'cli',
|
|
46
|
+
packageManager: 'npm',
|
|
47
|
+
checks: [
|
|
48
|
+
'typecheck',
|
|
49
|
+
'lint',
|
|
50
|
+
'tests',
|
|
51
|
+
{
|
|
52
|
+
id: 'smoke',
|
|
53
|
+
command: 'npm run smoke:cli',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
});
|
|
57
|
+
```
|
package/bin/cookout.js
ADDED
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const index_1 = require("./index");
|
|
7
|
+
main();
|
|
8
|
+
function main() {
|
|
9
|
+
const parsed = parseArgs(process.argv.slice(2));
|
|
10
|
+
if (parsed.help) {
|
|
11
|
+
process.stdout.write(helpText());
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (parsed.version) {
|
|
15
|
+
process.stdout.write(`${packageVersion()}\n`);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (parsed.command !== 'check') {
|
|
19
|
+
process.stderr.write(`Unknown command: ${parsed.command}\n\n${helpText()}`);
|
|
20
|
+
process.exitCode = 1;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const plan = (0, index_1.createCheckPlan)();
|
|
24
|
+
if (parsed.json) {
|
|
25
|
+
process.stdout.write(`${JSON.stringify(plan, null, 2)}\n`);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
process.stdout.write(`${(0, index_1.formatCheckPlan)(plan)}\n`);
|
|
29
|
+
}
|
|
30
|
+
function parseArgs(args) {
|
|
31
|
+
const parsed = {
|
|
32
|
+
command: 'check',
|
|
33
|
+
help: false,
|
|
34
|
+
json: false,
|
|
35
|
+
version: false,
|
|
36
|
+
};
|
|
37
|
+
const positional = [];
|
|
38
|
+
for (const arg of args) {
|
|
39
|
+
if (arg === '--help' || arg === '-h') {
|
|
40
|
+
parsed.help = true;
|
|
41
|
+
}
|
|
42
|
+
else if (arg === '--version' || arg === '-v') {
|
|
43
|
+
parsed.version = true;
|
|
44
|
+
}
|
|
45
|
+
else if (arg === '--json') {
|
|
46
|
+
parsed.json = true;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
positional.push(arg);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
parsed.command = positional[0] ?? parsed.command;
|
|
53
|
+
return parsed;
|
|
54
|
+
}
|
|
55
|
+
function helpText() {
|
|
56
|
+
return `cookout ${packageVersion()}
|
|
57
|
+
|
|
58
|
+
Release readiness for packages, CLIs, and services.
|
|
59
|
+
|
|
60
|
+
Usage:
|
|
61
|
+
cookout check
|
|
62
|
+
cookout check --json
|
|
63
|
+
|
|
64
|
+
Options:
|
|
65
|
+
--json Print the planned checks as JSON
|
|
66
|
+
-v, --version Print the package version
|
|
67
|
+
-h, --help Show this help
|
|
68
|
+
`;
|
|
69
|
+
}
|
|
70
|
+
function packageVersion() {
|
|
71
|
+
const packageJsonPath = (0, node_path_1.join)(__dirname, '..', 'package.json');
|
|
72
|
+
const rawPackageJson = JSON.parse((0, node_fs_1.readFileSync)(packageJsonPath, 'utf8'));
|
|
73
|
+
if (isPackageMetadata(rawPackageJson)) {
|
|
74
|
+
return rawPackageJson.version;
|
|
75
|
+
}
|
|
76
|
+
return '0.0.0';
|
|
77
|
+
}
|
|
78
|
+
function isPackageMetadata(value) {
|
|
79
|
+
if (typeof value !== 'object' || value === null) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
const candidate = value;
|
|
83
|
+
return typeof candidate.version === 'string';
|
|
84
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export declare const checkCatalog: readonly [{
|
|
2
|
+
readonly id: "typecheck";
|
|
3
|
+
readonly label: "Typecheck";
|
|
4
|
+
readonly description: "Run the project type checker.";
|
|
5
|
+
}, {
|
|
6
|
+
readonly id: "lint";
|
|
7
|
+
readonly label: "Lint";
|
|
8
|
+
readonly description: "Run static analysis and style checks.";
|
|
9
|
+
}, {
|
|
10
|
+
readonly id: "tests";
|
|
11
|
+
readonly label: "Tests";
|
|
12
|
+
readonly description: "Run the automated test suite.";
|
|
13
|
+
}, {
|
|
14
|
+
readonly id: "smoke";
|
|
15
|
+
readonly label: "Smoke tests";
|
|
16
|
+
readonly description: "Exercise the built package, CLI, or service in a real invocation.";
|
|
17
|
+
}, {
|
|
18
|
+
readonly id: "package-artifact";
|
|
19
|
+
readonly label: "Package artifact checks";
|
|
20
|
+
readonly description: "Inspect the packed or built release artifact.";
|
|
21
|
+
}, {
|
|
22
|
+
readonly id: "install-tarball";
|
|
23
|
+
readonly label: "Install-from-tarball checks";
|
|
24
|
+
readonly description: "Install the packed tarball into a fresh project and verify it loads.";
|
|
25
|
+
}, {
|
|
26
|
+
readonly id: "readme-snippets";
|
|
27
|
+
readonly label: "README snippet checks";
|
|
28
|
+
readonly description: "Run documented examples so the README stays honest.";
|
|
29
|
+
}, {
|
|
30
|
+
readonly id: "release-metadata";
|
|
31
|
+
readonly label: "Release metadata checks";
|
|
32
|
+
readonly description: "Validate package metadata, tags, files, engines, and release notes.";
|
|
33
|
+
}];
|
|
34
|
+
export type CookoutCheckId = typeof checkCatalog[number]['id'];
|
|
35
|
+
export type CookoutProjectKind = 'cli' | 'package' | 'service';
|
|
36
|
+
export interface CookoutCheckDefinition {
|
|
37
|
+
id: CookoutCheckId;
|
|
38
|
+
command?: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface CookoutConfig {
|
|
42
|
+
checks?: ReadonlyArray<CookoutCheckDefinition | CookoutCheckId>;
|
|
43
|
+
packageManager?: 'npm' | 'pnpm' | 'yarn' | 'bun';
|
|
44
|
+
project?: CookoutProjectKind;
|
|
45
|
+
}
|
|
46
|
+
export interface CookoutPlannedCheck {
|
|
47
|
+
id: CookoutCheckId;
|
|
48
|
+
label: string;
|
|
49
|
+
description: string;
|
|
50
|
+
command: string | null;
|
|
51
|
+
}
|
|
52
|
+
export interface CookoutCheckPlan {
|
|
53
|
+
packageManager: NonNullable<CookoutConfig['packageManager']>;
|
|
54
|
+
project: CookoutProjectKind;
|
|
55
|
+
status: 'planned';
|
|
56
|
+
checks: CookoutPlannedCheck[];
|
|
57
|
+
}
|
|
58
|
+
export declare function defineCookoutConfig(config: CookoutConfig): CookoutConfig;
|
|
59
|
+
export declare function createCheckPlan(config?: CookoutConfig): CookoutCheckPlan;
|
|
60
|
+
export declare function formatCheckPlan(plan: CookoutCheckPlan): string;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkCatalog = void 0;
|
|
4
|
+
exports.defineCookoutConfig = defineCookoutConfig;
|
|
5
|
+
exports.createCheckPlan = createCheckPlan;
|
|
6
|
+
exports.formatCheckPlan = formatCheckPlan;
|
|
7
|
+
exports.checkCatalog = [
|
|
8
|
+
{
|
|
9
|
+
id: 'typecheck',
|
|
10
|
+
label: 'Typecheck',
|
|
11
|
+
description: 'Run the project type checker.',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: 'lint',
|
|
15
|
+
label: 'Lint',
|
|
16
|
+
description: 'Run static analysis and style checks.',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: 'tests',
|
|
20
|
+
label: 'Tests',
|
|
21
|
+
description: 'Run the automated test suite.',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 'smoke',
|
|
25
|
+
label: 'Smoke tests',
|
|
26
|
+
description: 'Exercise the built package, CLI, or service in a real invocation.',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'package-artifact',
|
|
30
|
+
label: 'Package artifact checks',
|
|
31
|
+
description: 'Inspect the packed or built release artifact.',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'install-tarball',
|
|
35
|
+
label: 'Install-from-tarball checks',
|
|
36
|
+
description: 'Install the packed tarball into a fresh project and verify it loads.',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'readme-snippets',
|
|
40
|
+
label: 'README snippet checks',
|
|
41
|
+
description: 'Run documented examples so the README stays honest.',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'release-metadata',
|
|
45
|
+
label: 'Release metadata checks',
|
|
46
|
+
description: 'Validate package metadata, tags, files, engines, and release notes.',
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
const DEFAULT_CHECKS = [
|
|
50
|
+
'typecheck',
|
|
51
|
+
'lint',
|
|
52
|
+
'tests',
|
|
53
|
+
'smoke',
|
|
54
|
+
'package-artifact',
|
|
55
|
+
'install-tarball',
|
|
56
|
+
'readme-snippets',
|
|
57
|
+
'release-metadata',
|
|
58
|
+
];
|
|
59
|
+
const DEFAULT_COMMANDS = {
|
|
60
|
+
typecheck: 'npm run check',
|
|
61
|
+
lint: 'npm run lint',
|
|
62
|
+
tests: 'npm test',
|
|
63
|
+
smoke: 'npm run smoke',
|
|
64
|
+
'package-artifact': 'npm pack --dry-run',
|
|
65
|
+
'install-tarball': 'npm pack && npm install <tarball>',
|
|
66
|
+
'readme-snippets': 'cookout check readme',
|
|
67
|
+
'release-metadata': 'cookout check metadata',
|
|
68
|
+
};
|
|
69
|
+
function defineCookoutConfig(config) {
|
|
70
|
+
return config;
|
|
71
|
+
}
|
|
72
|
+
function createCheckPlan(config = {}) {
|
|
73
|
+
const checks = config.checks ?? DEFAULT_CHECKS;
|
|
74
|
+
return {
|
|
75
|
+
packageManager: config.packageManager ?? 'npm',
|
|
76
|
+
project: config.project ?? 'package',
|
|
77
|
+
status: 'planned',
|
|
78
|
+
checks: checks.map(normalizeCheck),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function formatCheckPlan(plan) {
|
|
82
|
+
const header = [
|
|
83
|
+
'cookout check',
|
|
84
|
+
`project ${plan.project}`,
|
|
85
|
+
`package manager ${plan.packageManager}`,
|
|
86
|
+
`status ${plan.status}`,
|
|
87
|
+
];
|
|
88
|
+
const rows = plan.checks.map((check) => {
|
|
89
|
+
const command = check.command ? ` -> ${check.command}` : '';
|
|
90
|
+
return ` - ${check.id}: ${check.label}${command}`;
|
|
91
|
+
});
|
|
92
|
+
return [
|
|
93
|
+
...header,
|
|
94
|
+
'',
|
|
95
|
+
'Planned release-readiness checks:',
|
|
96
|
+
...rows,
|
|
97
|
+
'',
|
|
98
|
+
'Runner execution is not wired yet in this alpha.',
|
|
99
|
+
].join('\n');
|
|
100
|
+
}
|
|
101
|
+
function normalizeCheck(input) {
|
|
102
|
+
const candidate = typeof input === 'string' ? { id: input } : input;
|
|
103
|
+
const catalogEntry = exports.checkCatalog.find((entry) => entry.id === candidate.id);
|
|
104
|
+
if (!catalogEntry) {
|
|
105
|
+
throw new Error(`Unknown cookout check: ${candidate.id}`);
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
id: catalogEntry.id,
|
|
109
|
+
label: catalogEntry.label,
|
|
110
|
+
description: candidate.description ?? catalogEntry.description,
|
|
111
|
+
command: candidate.command ?? DEFAULT_COMMANDS[catalogEntry.id],
|
|
112
|
+
};
|
|
113
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cookout",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"description": "Release readiness for packages, CLIs, and services.",
|
|
5
|
+
"author": "cookout contributors",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"bin": {
|
|
16
|
+
"cookout": "bin/cookout.js"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -p tsconfig.build.json",
|
|
20
|
+
"check": "tsc --noEmit",
|
|
21
|
+
"demo": "npm run build --silent && node ./bin/cookout.js check",
|
|
22
|
+
"lint": "eslint .",
|
|
23
|
+
"prepack": "npm run build",
|
|
24
|
+
"publish:alpha": "npm publish --tag alpha --access public",
|
|
25
|
+
"test": "npm run build --silent && vitest run",
|
|
26
|
+
"verify": "npm run check && npm run lint && npm test"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"bin",
|
|
31
|
+
"README.md",
|
|
32
|
+
"LICENSE"
|
|
33
|
+
],
|
|
34
|
+
"keywords": [
|
|
35
|
+
"cli",
|
|
36
|
+
"release",
|
|
37
|
+
"readiness",
|
|
38
|
+
"checks",
|
|
39
|
+
"testing",
|
|
40
|
+
"packaging",
|
|
41
|
+
"smoke-tests"
|
|
42
|
+
],
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=18"
|
|
45
|
+
},
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "^26.1.0",
|
|
52
|
+
"eslint": "^10.6.0",
|
|
53
|
+
"eslint-config-rubric": "^0.1.0-alpha.0",
|
|
54
|
+
"typescript": "^6.0.3",
|
|
55
|
+
"vitest": "^4.1.9"
|
|
56
|
+
}
|
|
57
|
+
}
|