Skip to content

Commit 687d95f

Browse files
committed
better organize/isolate config/components
the life of a monorepo
1 parent 5e143a1 commit 687d95f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+172
-451
lines changed

__tests__/ezql.ts renamed to __tests__/lib/ezql.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DEFAULT_HOST, EZQL, Prompt } from '../src/ezql'
1+
import { DEFAULT_HOST, EZQL, Prompt } from '../../src/lib/ezql'
22

33
describe('register EZQL', () => {
44
const token = 'arbitrary-value'

jest.config.js renamed to config/jest.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ module.exports = {
33
preset: 'ts-jest',
44
testEnvironment: 'node',
55
roots: ['<rootDir>/__tests__'],
6+
rootDir: '../',
67
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import typescript from '@rollup/plugin-typescript'
22

33
export default {
4-
input: 'src/index.ts',
4+
input: 'src/lib/index.ts',
55
output: {
66
name: 'Outerbase',
77
file: 'dist/umd/bundle.js',
88
format: 'umd',
99
sourcemap: true,
1010
},
11-
plugins: [typescript()],
11+
plugins: [typescript({ tsconfig: 'config/tsconfig.umd.json' })],
1212
}

config/tsconfig.cjs.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"extends": "../tsconfig",
3+
"include": ["../src/lib"],
34
"compilerOptions": {
4-
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
5-
"outDir": "../dist/cjs" /* Redirect output structure to the directory. */
5+
"outDir": "../dist/cjs",
6+
"sourceMap": true
67
}
78
}

config/tsconfig.cli.json

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
{
2-
"include": ["../cli/**/*", "../src/**/*"],
2+
"extends": "../tsconfig",
3+
"include": ["../src/cli"],
34
"compilerOptions": {
4-
"rootDir": "..",
5-
"outDir": "../dist",
6-
"strict": true,
75
"target": "es6",
8-
"module": "commonjs",
9-
"sourceMap": true,
10-
"esModuleInterop": true,
11-
"resolveJsonModule": true,
12-
"moduleResolution": "node"
6+
"outDir": "../dist/cli"
137
}
148
}

config/tsconfig.esm.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"extends": "../tsconfig",
3+
"include": ["../src/lib"],
34
"compilerOptions": {
4-
"module": "ESNext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
5-
"outDir": "../dist/esm" /* Redirect output structure to the directory. */
5+
"module": "ESNext",
6+
"outDir": "../dist/esm",
7+
"sourceMap": true
68
}
79
}

config/tsconfig.types.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"extends": "../tsconfig",
3+
"exclude": ["../src/react-ezql", "../src/cli"],
34
"compilerOptions": {
4-
"declaration": true /* Generates corresponding '.d.ts' file. */,
5+
"declaration": true,
56
"emitDeclarationOnly": true,
67
"outDir": "../dist/types" /* Redirect output structure to the directory. */
78
}

config/tsconfig.umd.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "../tsconfig",
3+
"include": ["../src/lib"],
34
"compilerOptions": {
4-
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
5-
"declaration": false /* Generates corresponding '.d.ts' file. */
5+
"module": "ESNext"
66
}
77
}

dist/cjs/ezql.d.ts

-17
This file was deleted.

dist/cjs/ezql.d.ts.map

-1
This file was deleted.

dist/cjs/ezql.js

+31-72
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cjs/ezql.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cjs/index.d.ts

-3
This file was deleted.

dist/cjs/index.d.ts.map

-1
This file was deleted.

dist/cjs/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cjs/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cli/index.js renamed to dist/cli/cli/index.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
1111
};
1212
Object.defineProperty(exports, "__esModule", { value: true });
1313
const extra_typings_1 = require("@commander-js/extra-typings");
14-
const index_1 = require("../src/index");
15-
const package_json_1 = require("../package.json");
14+
const index_1 = require("../lib/index");
15+
const version = '0.0.2';
1616
const program = new extra_typings_1.Command();
1717
program
18-
.version(package_json_1.version)
18+
.version(version)
1919
.description('A natural language to SQL converter')
2020
.argument('<phrase>', 'A query written in natural language to be executed against your database.')
2121
.option('-e, --execute', 'Specifies whether to automatically execute the generated SQL statement. Defaults to false.')
@@ -31,4 +31,3 @@ program
3131
console.log(response);
3232
}))
3333
.parse(process.argv);
34-
//# sourceMappingURL=index.js.map

dist/cli/index.js.map

-1
This file was deleted.

dist/src/ezql.js renamed to dist/cli/lib/ezql.js

-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,3 @@ class EZQL {
5959
}
6060
}
6161
exports.EZQL = EZQL;
62-
//# sourceMappingURL=ezql.js.map

dist/src/index.js renamed to dist/cli/lib/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ exports.EZQL = exports.Prompt = void 0;
44
const ezql_1 = require("./ezql");
55
Object.defineProperty(exports, "Prompt", { enumerable: true, get: function () { return ezql_1.Prompt; } });
66
Object.defineProperty(exports, "EZQL", { enumerable: true, get: function () { return ezql_1.EZQL; } });
7-
//# sourceMappingURL=index.js.map

dist/esm/ezql.d.ts

-17
This file was deleted.

dist/esm/ezql.d.ts.map

-1
This file was deleted.

0 commit comments

Comments
 (0)