Skip to content
Open
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
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ All notable changes to json2sql will be documented in this file.

- CLI integration tests with comprehensive coverage (#8, #9, #10)
- Standalone dialect tests and converter edge cases (#10)
- npm wrapper (`package.json` + `cli.js`) for npm publishing
- GitHub Actions: PyPI publish workflow (release or manual dispatch)
- GitHub Actions: GitHub Pages deployment workflow
- GitHub Actions: npm publish workflow (release or manual dispatch)
Expand Down Expand Up @@ -45,13 +44,14 @@ All notable changes to json2sql will be documented in this file.
- README rewritten with unified pricing tables, Revenue Holdings branding
- README expanded with CI/CD integration examples and alternatives comparison
- README tool count and DevForge URLs updated
- npm install instructions added to README
- README install instructions limited to pip, Homebrew, and Scoop (no npm package)

## [0.1.0] — 2026-05-14

### Added

- Initial release
- PyPI package publishing (json2sql-cli) and local Node.js CLI wrapper
- JSON to SQL INSERT conversion
- Nested JSON auto-flattening into relational tables
- Multi-dialect output: PostgreSQL, MySQL, SQLite
Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ scoop bucket add Coding-Dev-Tools https://github.com/Coding-Dev-Tools/scoop-buck
scoop install json2sql-cli
```

**npm (Node.js wrapper):**
```bash
npm install -g json2sql
```
Then run: `json2sql --help`

## Quick Start

```bash
Expand Down
61 changes: 61 additions & 0 deletions tests/smoke.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,64 @@ test("smoke: required repo files present", () => {
assert.ok(fs.existsSync(path.join(root, f)), `${f} must exist`);
}
});

test("smoke: README documents supported install paths only", () => {
const readmePath = path.join(__dirname, "..", "README.md");
assert.ok(fs.existsSync(readmePath), "README.md must exist");

const readme = fs.readFileSync(readmePath, "utf8");
const lines = readme.split(/\r?\n/);

const installStart = lines.findIndex((line) => /^##\s+Install(?:ation)?\s*$/i.test(line));
assert.notStrictEqual(installStart, -1, "README must have an Install section");
const nextHeading = lines.findIndex(
(line, index) => index > installStart && /^##\s+/.test(line)
);
const installSection = lines
.slice(installStart + 1, nextHeading === -1 ? undefined : nextHeading)
.join("\n");

assert.match(
installSection,
/pip install (?:json2sql-cli|git\+https:\/\/github\.com\/Coding-Dev-Tools\/json2sql(?:\.git)?)/,
"README Install section must document `pip install json2sql-cli` (or the documented git fallback)"
);
assert.match(
installSection,
/\bjson2sql-cli\b/,
"README Install section must name the json2sql-cli package"
);

for (const [needle, label] of [
["brew tap ", "Homebrew tap"],
["scoop bucket add ", "Scoop bucket"],
]) {
assert.ok(installSection.includes(needle), `README must document ${label}`);
}

const fencedBlocks = [
...readme.matchAll(/^```[^\n]*\n([\s\S]*?)^```[ \t]*$/gm),
].map((match) => match[1]);

const forbiddenNpmUsage = [
[/\bnpm\s+(?:install|i|add|exec|x|dlx)\b[^\n]*\bjson2sql(?:-cli)?(?![\w.-])/i, "npm"],
[/\bnpx\b[^\n]*\bjson2sql(?:-cli)?(?![\w.-])/i, "npx"],
[
/\b(?:pnpm|yarn)\s+(?:add|global\s+add|dlx)\b[^\n]*\bjson2sql(?:-cli)?(?![\w.-])/i,
"pnpm/yarn",
],
];

const sources = [
["README.md", readme],
...fencedBlocks.map((block, index) => [`README.md fenced code block ${index + 1}`, block]),
];
for (const [sourceName, source] of sources) {
for (const [pattern, runner] of forbiddenNpmUsage) {
assert.ok(
!pattern.test(source),
`${sourceName} must not use \`${runner}\` to install or run json2sql: npm \`json2sql\` is an unrelated third-party package and this project publishes no npm package`
);
}
}
});
Loading