rimecms 0.28.3 → 0.28.5

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.
@@ -19,7 +19,7 @@ const write = (schema) => {
19
19
  fs.writeFileSync(outputFile, schema);
20
20
  }
21
21
  catch (err) {
22
- logger.error('Error writing schema', err.message);
22
+ throw new Error(`Error writing schema: ${err.message}`);
23
23
  }
24
24
  const pm = getPackageManager();
25
25
  const commandMap = {
@@ -33,11 +33,20 @@ const write = (schema) => {
33
33
  logger.info('[✓] Schema: generated at src/lib/server/schema.ts');
34
34
  console.log('============================================================');
35
35
  console.log(`\n ⚡︎ ${command} drizzle-kit generate \n`);
36
- spawnSync(command, ['drizzle-kit', 'generate'], { stdio: 'inherit' });
36
+ const generateResult = spawnSync(command, ['drizzle-kit', 'generate'], { stdio: 'inherit' });
37
+ if (generateResult.error || generateResult.status !== 0) {
38
+ throw new Error('drizzle-kit generate failed');
39
+ }
37
40
  console.log('\n============================================================');
38
41
  console.log(`\n ⚡︎ ${command} drizzle-kit migrate \n`);
39
- spawnSync(command, ['drizzle-kit', 'migrate'], { stdio: 'inherit' });
42
+ const migrateResult = spawnSync(command, ['drizzle-kit', 'migrate'], { stdio: 'inherit' });
43
+ if (migrateResult.error || migrateResult.status !== 0) {
44
+ throw new Error('drizzle-kit migrate failed');
45
+ }
40
46
  console.log('\n============================================================');
47
+ // Only mark the schema as in sync once generate + migrate both actually
48
+ // succeeded — otherwise a future run with an unchanged schema string would
49
+ // skip re-running drizzle-kit and the DB would stay silently out of sync.
41
50
  cache.set('schema', schema);
42
51
  };
43
52
  export default write;
@@ -45,14 +45,12 @@
45
45
  onEnd: function (evt) {
46
46
  const { newIndex, to } = evt;
47
47
 
48
- //@ts-expect-error annoying
49
- const initialPath = evt.item.__attributes['data-path'];
50
- //@ts-expect-error annoying
51
- const targetListPath = to.__attributes['data-path'];
48
+ const initialPath = evt.item.dataset.path;
49
+ const targetListPath = to.dataset.path;
52
50
  const isTargetPathRoot = targetListPath === path;
53
51
  const targetPath = `${targetListPath}${!isTargetPathRoot ? '._children' : ''}.${newIndex}`;
54
52
 
55
- if (initialPath !== targetPath) {
53
+ if (initialPath !== undefined && initialPath !== targetPath) {
56
54
  treeState.moveItem(initialPath.replace(`${path}.`, ''), targetPath.replace(`${path}.`, ''));
57
55
  resetSortable();
58
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rimecms",
3
- "version": "0.28.3",
3
+ "version": "0.28.5",
4
4
  "homepage": "https://github.com/bienbiendev/rime",
5
5
  "scripts": {
6
6
  "dev": "vite dev",