drizzle-kit 0.9.23 → 0.9.24

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.
Files changed (2) hide show
  1. package/index.js +17 -34
  2. package/package.json +5 -2
package/index.js CHANGED
@@ -159822,14 +159822,9 @@ var createResolveTablesMachine = (props) => (0, import_xstate.createMachine)({
159822
159822
  NEXT: [
159823
159823
  {
159824
159824
  target: "done",
159825
- cond: "isMissingTablesResolved",
159825
+ cond: "isResolved",
159826
159826
  actions: ["resolveRemaining"]
159827
159827
  },
159828
- {
159829
- target: "done",
159830
- cond: "isNewTablesResolved",
159831
- actions: ["resolveMissing"]
159832
- },
159833
159828
  {
159834
159829
  target: "table"
159835
159830
  }
@@ -159858,7 +159853,7 @@ var createResolveTablesMachine = (props) => (0, import_xstate.createMachine)({
159858
159853
  on: {
159859
159854
  CANCEL: "action.actionChoice",
159860
159855
  CONFIRM: [
159861
- { target: "final", actions: ["delete"] }
159856
+ { target: "check", actions: ["delete"] }
159862
159857
  ]
159863
159858
  }
159864
159859
  },
@@ -159866,21 +159861,20 @@ var createResolveTablesMachine = (props) => (0, import_xstate.createMachine)({
159866
159861
  on: {
159867
159862
  CANCEL: "action.actionChoice",
159868
159863
  CONFIRM: [
159869
- { target: "final", actions: ["rename"] }
159864
+ { target: "check", actions: ["rename"] }
159870
159865
  ]
159871
159866
  }
159872
159867
  },
159873
- final: {
159874
- entry: (0, import_xstate.send)({ type: "NEXT" }),
159868
+ check: {
159875
159869
  on: {
159876
159870
  NEXT: [
159877
159871
  {
159878
159872
  target: "done",
159879
- cond: "isMissingTablesResolved",
159873
+ cond: "isResolved",
159880
159874
  actions: ["resolveRemaining"]
159881
159875
  },
159882
159876
  {
159883
- target: "idle"
159877
+ target: "table"
159884
159878
  }
159885
159879
  ]
159886
159880
  }
@@ -159889,8 +159883,7 @@ var createResolveTablesMachine = (props) => (0, import_xstate.createMachine)({
159889
159883
  }
159890
159884
  }, {
159891
159885
  guards: {
159892
- isMissingTablesResolved: ({ missingTables }) => !missingTables.length,
159893
- isNewTablesResolved: ({ newTables }) => !newTables.length
159886
+ isResolved: ({ missingTables, newTables }) => !missingTables.length || !newTables.length
159894
159887
  },
159895
159888
  actions: {
159896
159889
  choseItem: (0, import_xstate.assign)({
@@ -159935,14 +159928,12 @@ var createResolveTablesMachine = (props) => (0, import_xstate.createMachine)({
159935
159928
  newTables,
159936
159929
  createdTables
159937
159930
  }) => [...createdTables, ...newTables],
159938
- newTables: (context) => []
159939
- }),
159940
- resolveMissing: (0, import_xstate.assign)({
159941
159931
  deletedTables: ({
159942
159932
  missingTables,
159943
159933
  deletedTables
159944
159934
  }) => [...deletedTables, ...missingTables],
159945
- missingTables: (context) => []
159935
+ missingTables: (context) => [],
159936
+ newTables: (context) => []
159946
159937
  })
159947
159938
  }
159948
159939
  });
@@ -159970,14 +159961,9 @@ var createResolveColumnsMachine = (props) => (0, import_xstate2.createMachine)({
159970
159961
  NEXT: [
159971
159962
  {
159972
159963
  target: "done",
159973
- cond: "isMissingColumnsResolved",
159964
+ cond: "isResolved",
159974
159965
  actions: ["resolveRemaining"]
159975
159966
  },
159976
- {
159977
- target: "done",
159978
- cond: "isNewColumnsResolved",
159979
- actions: ["resolveMissing"]
159980
- },
159981
159967
  {
159982
159968
  target: "table"
159983
159969
  }
@@ -160006,7 +159992,7 @@ var createResolveColumnsMachine = (props) => (0, import_xstate2.createMachine)({
160006
159992
  on: {
160007
159993
  CANCEL: "action.actionChoice",
160008
159994
  CONFIRM: [
160009
- { target: "final", actions: ["delete"] }
159995
+ { target: "check", actions: ["delete"] }
160010
159996
  ]
160011
159997
  }
160012
159998
  },
@@ -160014,17 +160000,17 @@ var createResolveColumnsMachine = (props) => (0, import_xstate2.createMachine)({
160014
160000
  on: {
160015
160001
  CANCEL: "action.actionChoice",
160016
160002
  CONFIRM: [
160017
- { target: "final", actions: ["rename"] }
160003
+ { target: "check", actions: ["rename"] }
160018
160004
  ]
160019
160005
  }
160020
160006
  },
160021
- final: {
160007
+ check: {
160022
160008
  entry: (0, import_xstate2.send)({ type: "NEXT" }),
160023
160009
  on: {
160024
160010
  NEXT: [
160025
160011
  {
160026
160012
  target: "done",
160027
- cond: "isMissingColumnsResolved",
160013
+ cond: "isResolved",
160028
160014
  actions: ["resolveRemaining"]
160029
160015
  },
160030
160016
  {
@@ -160037,8 +160023,7 @@ var createResolveColumnsMachine = (props) => (0, import_xstate2.createMachine)({
160037
160023
  }
160038
160024
  }, {
160039
160025
  guards: {
160040
- isMissingColumnsResolved: ({ deletedColumns }) => !deletedColumns.length,
160041
- isNewColumnsResolved: ({ addedColumns }) => !addedColumns.length
160026
+ isResolved: ({ deletedColumns, addedColumns }) => !deletedColumns.length || !addedColumns.length
160042
160027
  },
160043
160028
  actions: {
160044
160029
  choseItem: (0, import_xstate2.assign)({
@@ -160083,14 +160068,12 @@ var createResolveColumnsMachine = (props) => (0, import_xstate2.createMachine)({
160083
160068
  addedColumns,
160084
160069
  created
160085
160070
  }) => [...created, ...addedColumns],
160086
- addedColumns: (context) => []
160087
- }),
160088
- resolveMissing: (0, import_xstate2.assign)({
160089
160071
  deleted: ({
160090
160072
  deletedColumns,
160091
160073
  deleted
160092
160074
  }) => [...deleted, ...deletedColumns],
160093
- deletedColumns: (context) => []
160075
+ deletedColumns: (context) => [],
160076
+ addedColumns: (context) => []
160094
160077
  })
160095
160078
  }
160096
160079
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.9.23",
3
+ "version": "0.9.24",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/lambda-direct/drizzle-kit",
6
6
  "author": "Alex Blokh <aleksandrblokh@gmail.com>",
@@ -12,7 +12,7 @@
12
12
  "start": "ts-node ./src/index.ts",
13
13
  "watch": "esbuild ./src/cli/index.tsx --bundle --platform=node --target=node10.4 --outfile=./dist/index.js --external:esbuild --watch",
14
14
  "diff": "ts-node ./src/diff.ts",
15
- "test": "ts-node ./index.ts",
15
+ "test": "jest --silent",
16
16
  "imports": "ts-node ./test.ts",
17
17
  "build": "esbuild ./src/cli/index.tsx --bundle --platform=node --target=node10.4 --outfile=./dist/index.js --external:esbuild"
18
18
  },
@@ -30,6 +30,7 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/ink-divider": "^2.0.2",
33
+ "@types/jest": "^27.0.3",
33
34
  "@types/js-yaml": "^4.0.3",
34
35
  "@types/lodash.flatten": "^4.4.6",
35
36
  "@types/object-hash": "2.1.1",
@@ -46,8 +47,10 @@
46
47
  "eslint-plugin-jsx-a11y": "^6.4.1",
47
48
  "eslint-plugin-react": "^7.21.5",
48
49
  "eslint-plugin-react-hooks": "^1.7.0",
50
+ "jest": "^27.4.5",
49
51
  "prettier": "^2.3.2",
50
52
  "source-map-loader": "^3.0.0",
53
+ "ts-jest": "^27.1.2",
51
54
  "tsconfig-paths-webpack-plugin": "^3.5.1",
52
55
  "webpack": "^5.42.0",
53
56
  "webpack-cli": "^4.7.2",