Skip to content

Commit

Permalink
refactor: seperate core parts into folders (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
hougesen authored Apr 3, 2023
1 parent 3092c76 commit 9f0d6ff
Show file tree
Hide file tree
Showing 16 changed files with 13 additions and 17 deletions.
5 changes: 1 addition & 4 deletions src/index.ts → cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import fs from 'fs/promises';

import { Command, Option } from '@commander-js/extra-typings';

import { convertToLanguage, SupportedLanguage } from './lib';
import { tokenize } from './tokenizer';

export * from './lib';
import { convertToLanguage, SupportedLanguage, tokenize } from '../core';

const program = new Command();

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
"name": "json2struct",
"version": "0.4.1",
"description": "Easily translate JSON into type definitions",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "dist/core/index.js",
"types": "dist/core/index.d.ts",
"files": [
"dist"
],
"bin": {
"json2struct": "./dist/cli.js"
"json2struct": "./dist/cli/index.js"
},
"scripts": {
"start": "node dist/cli.js",
"start": "node dist/cli/index.js",
"build": "tsc",
"build:clean": "tsc --build --clean && npm run build",
"format": "prettier --ignore-path .gitignore --write .",
"format:check": "prettier --check --ignore-path .gitignore --write .",
"lint": "eslint --ext \".js,.mjs,.ts,.d.ts\" --ignore-path .gitignore .",
"test": "vitest --run",
"test:watch": "vitest",
"local": "npm uninstall -g && npm install -g && json2struct",
"example:typescript": "node dist/cli.js ./examples/example.json --output ./examples/example.d.ts --language typescript --overwrite && prettier --write ./examples/example.d.ts",
"example:python": "node dist/cli.js ./examples/example.json --output ./examples/example.py --language python --overwrite",
"example:julia": "node dist/cli.js ./examples/example.json --output ./examples/example.jl --language julia --overwrite",
"example:rust": "node dist/cli.js ./examples/example.json --output ./examples/example.rs --language rust --overwrite"
"local": "npm uninstall -g && npm install -g && json2struct",
"example:typescript": "node dist/cli/index.js ./examples/example.json --output ./examples/example.d.ts --language typescript --overwrite && prettier --write ./examples/example.d.ts",
"example:python": "node dist/cli/index.js ./examples/example.json --output ./examples/example.py --language python --overwrite",
"example:julia": "node dist/cli/index.js ./examples/example.json --output ./examples/example.jl --language julia --overwrite",
"example:rust": "node dist/cli/index.js ./examples/example.json --output ./examples/example.rs --language rust --overwrite"
},
"repository": {
"type": "git",
Expand Down
5 changes: 2 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"strict": true,
"target": "es5",
Expand All @@ -13,6 +12,6 @@
"resolveJsonModule": true,
"skipLibCheck": true
},
"include": ["src/"],
"exclude": ["src/__tests__/**", "**/**/*.test.ts"]
"include": ["cli/", "core/"],
"exclude": ["core/__tests__/**", "**/**/*.test.ts"]
}

0 comments on commit 9f0d6ff

Please sign in to comment.