orchid-orm 1.5.15 → 1.5.16
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/CHANGELOG.md +6 -0
- package/dist/bin.js +17 -0
- package/dist/bin.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/bin/init.test.ts +2 -0
- package/src/bin/init.ts +19 -0
- package/src/codegen/testUtils.ts +6 -5
- package/src/codegen/updateMainFile.test.ts +16 -16
- package/src/codegen/updateMainFile.ts +2 -2
- package/src/codegen/updateTableFile/changeTable.test.ts +72 -72
- package/src/codegen/updateTableFile/createTable.test.ts +6 -6
- package/src/codegen/updateTableFile/renameTable.test.ts +17 -17
- package/src/codegen/updateTableFile/renameTable.ts +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1644,7 +1644,7 @@ const updateMainFile = async (filePath, tablePath, ast, options) => {
|
|
|
1644
1644
|
};
|
|
1645
1645
|
const createTable$1 = ({ filePath, tablePath, statements, object, content, spaces }, ast) => {
|
|
1646
1646
|
const key = toCamelCase(ast.name);
|
|
1647
|
-
const value = toPascalCase(ast.name)
|
|
1647
|
+
const value = `${toPascalCase(ast.name)}Table`;
|
|
1648
1648
|
const changes = new FileChanges(content);
|
|
1649
1649
|
const importPath = getImportPath(filePath, tablePath(ast.name));
|
|
1650
1650
|
const importPos = ts.import.getEndPos(statements);
|
|
@@ -1667,7 +1667,7 @@ ${spaces}`;
|
|
|
1667
1667
|
const dropTable = ({ filePath, tablePath, statements, object, content }, ast) => {
|
|
1668
1668
|
const changes = new FileChanges(content);
|
|
1669
1669
|
const importPath = getImportPath(filePath, tablePath(ast.name));
|
|
1670
|
-
const tableClassName = toPascalCase(ast.name)
|
|
1670
|
+
const tableClassName = `${toPascalCase(ast.name)}Table`;
|
|
1671
1671
|
const importNames = [];
|
|
1672
1672
|
for (const node of ts.import.iterateWithSource(statements, importPath)) {
|
|
1673
1673
|
changes.remove(node.pos, node.end);
|
|
@@ -2234,7 +2234,7 @@ const renameTable = async (_a) => {
|
|
|
2234
2234
|
}
|
|
2235
2235
|
}
|
|
2236
2236
|
}
|
|
2237
|
-
await fs.writeFile(
|
|
2237
|
+
await fs.writeFile(tablePath, changes.apply());
|
|
2238
2238
|
};
|
|
2239
2239
|
|
|
2240
2240
|
var __defProp$1 = Object.defineProperty;
|