From a98ba60dedc1df81e49389077605bd98d582639d Mon Sep 17 00:00:00 2001 From: Alain Dumesny Date: Tue, 21 Jul 2026 12:27:37 -0700 Subject: [PATCH 1/3] preinstall script error fix *fix #3325 Cursor: Why is this a bug? When a user installs gridstack as a dependency (e.g., npm install gridstack), npm automatically executes the library's preinstall, install, and postinstall scripts on the consumer's machine. Because gridstack.js had "preinstall": "npx only-allow yarn" in its package.json, this script runs during the consumer's installation process. This breaks things in two ways: It attempts to download only-allow dynamically via npx over the network. For users with a private registry or restricted network (like the Nexus registry returning a 401 error in the issue description), this completely halts the installation. Even if it could download, it forces the consumer of the library to use yarn for their own app! If they are trying to build an app with npm or pnpm, our preinstall script will throw an error and refuse to let them install our library. Scripts like only-allow are meant to ensure contributors to the gridstack.js codebase use yarn, but binding it to the preinstall hook in a published library inappropriately enforces this on end-users. Suggestion / Fix The only-allow package itself is actually deprecated for exactly these kinds of reasons. The modern and native way to enforce a package manager for repository contributors is using the "packageManager" field in package.json. Node's built-in corepack reads this and will automatically ensure contributors use the correct package manager. Since gridstack.js already includes "packageManager": "yarn@1.22.22..." in its package.json, the only-allow script is completely redundant anyway. I have gone ahead and removed the "preinstall": "npx only-allow yarn" script from the package.json. --- doc/CHANGES.md | 3 +++ package.json | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/CHANGES.md b/doc/CHANGES.md index fe41a449c..e9baa9335 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -139,6 +139,9 @@ Change log +## 13.0.1 (2026-07-22) +* fix: [#3325](https://github.com/gridstack/gridstack.js/issues/3325) preinstall script + ## 13.0.0 (2026-07-18) * NEW: react wrapper: re-did to follow the Angular pattern (drag&Drop between grid doesn't destroy content), events, lazyLoad support, fix memory leak, empty content, etc... * NEW: vue wrapper: brand new wrapper follow same pattern as well diff --git a/package.json b/package.json index 22fa49401..0844a51a2 100644 --- a/package.json +++ b/package.json @@ -47,8 +47,7 @@ "test:e2e:headed": "playwright test --headed", "lint": "tsc --project tsconfig.build.json --noEmit && eslint src/*.ts angular/projects/lib/src/**/*.ts react/projects/lib/src/**/*.{ts,tsx}", "reset": "rm -rf dist node_modules", - "prepublishOnly": "yarn build", - "preinstall": "npx only-allow yarn" + "prepublishOnly": "yarn build" }, "keywords": [ "Typescript", From 9654a88de3c44c69de655867ba1f3843437bd867 Mon Sep 17 00:00:00 2001 From: Alain Dumesny Date: Wed, 22 Jul 2026 08:42:20 -0700 Subject: [PATCH 2/3] v13.0.1 patch release Co-authored-by: Cursor --- angular/doc/api/index.md | 2 +- angular/package.json | 2 +- angular/projects/lib/package.json | 2 +- doc/API.md | 2 +- doc/CHANGES.md | 2 ++ package.json | 14 +++++++++----- src/gridstack.ts | 4 ++-- vue/package.json | 2 +- vue/projects/lib/src/gridstack.ts | 1 + 9 files changed, 19 insertions(+), 12 deletions(-) diff --git a/angular/doc/api/index.md b/angular/doc/api/index.md index fc082b5ef..df2035455 100644 --- a/angular/doc/api/index.md +++ b/angular/doc/api/index.md @@ -1,4 +1,4 @@ -# GridStack Angular Library v13.0.0 +# GridStack Angular Library v13.0.1 ## Modules diff --git a/angular/package.json b/angular/package.json index ed495a21a..528a67f20 100644 --- a/angular/package.json +++ b/angular/package.json @@ -4,7 +4,7 @@ "scripts": { "ng": "ng", "start": "ng serve", - "build": "ng build", + "build": "ng build lib", "watch": "ng build --watch --configuration development", "test": "ng test", "doc": "npx typedoc --options typedoc.json && npx typedoc --options typedoc.html.json", diff --git a/angular/projects/lib/package.json b/angular/projects/lib/package.json index c3640bf30..c96f2df4e 100644 --- a/angular/projects/lib/package.json +++ b/angular/projects/lib/package.json @@ -1,6 +1,6 @@ { "name": "gridstack-angular", - "version": "13.0.0", + "version": "13.0.1", "peerDependencies": { "@angular/common": ">=14", "@angular/core": ">=14" diff --git a/doc/API.md b/doc/API.md index 5da934218..24dceca3f 100644 --- a/doc/API.md +++ b/doc/API.md @@ -1,4 +1,4 @@ -# gridstack v13.0.0 +# gridstack v13.0.1 ## Classes diff --git a/doc/CHANGES.md b/doc/CHANGES.md index e9baa9335..4bc43a89c 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -5,6 +5,7 @@ Change log **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* +- [13.0.1 (2026-07-22)](#1301-2026-07-22) - [13.0.0 (2026-07-18)](#1300-2026-07-18) - [12.6.0 (2026-04-08)](#1260-2026-04-08) - [12.5.0 (2026-04-05)](#1250-2026-04-05) @@ -141,6 +142,7 @@ Change log ## 13.0.1 (2026-07-22) * fix: [#3325](https://github.com/gridstack/gridstack.js/issues/3325) preinstall script +* fix: [#3324](https://github.com/gridstack/gridstack.js/issues/3324) vue files missing from package ## 13.0.0 (2026-07-18) * NEW: react wrapper: re-did to follow the Angular pattern (drag&Drop between grid doesn't destroy content), events, lazyLoad support, fix memory leak, empty content, etc... diff --git a/package.json b/package.json index 0844a51a2..f9404907f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gridstack", - "version": "13.0.0", + "version": "13.0.1", "license": "MIT", "author": "Alain Dumesny (https://github.com/adumesny)", "contributors": [ @@ -25,14 +25,18 @@ } ], "scripts": { - "build": "grunt && webpack && tsc --project tsconfig.build.json --stripInternal && yarn build:ng && yarn build:react && yarn doc", - "build:ng": "cd angular && yarn build lib", + "build": "yarn build:core && yarn build:ng && yarn build:react && yarn build:vue && yarn doc", + "build:core": "grunt && webpack && tsc --project tsconfig.build.json --stripInternal", + "build:ng": "cd angular && yarn build", "build:react": "cd react && yarn build:lib", - "w": "webpack", - "t": "rm -rf dist/* && grunt && tsc --project tsconfig.build.json --stripInternal", + "build:vue": "cd vue && yarn build:lib", + "w": "webpack --mode development", + "t": "rm -rf dist/* && grunt && yarn w && tsc --project tsconfig.build.json --stripInternal", "doc": "doctoc ./README.md && doctoc ./doc/CHANGES.md && node scripts/generate-docs.js", "doc:main": "node scripts/generate-docs.js --main-only", "doc:angular": "node scripts/generate-docs.js --angular-only", + "doc:react": "node scripts/generate-docs.js --react-only", + "doc:vue": "node scripts/generate-docs.js --vue-only", "test": "yarn lint && vitest run && cd react && yarn vitest run", "test:watch": "vitest", "test:ui": "vitest --ui", diff --git a/src/gridstack.ts b/src/gridstack.ts index 5b5eb905c..c5dee2a69 100644 --- a/src/gridstack.ts +++ b/src/gridstack.ts @@ -1,5 +1,5 @@ /*! - * GridStack 13.0.0 + * GridStack 13.0.1 * https://gridstackjs.com/ * * Copyright (c) 2021-2025 Alain Dumesny @@ -2202,7 +2202,7 @@ export class GridStack { } /** @internal current version compiled in code */ - static GDRev = '13.0.0'; + static GDRev = '13.0.1'; /* =========================================================================================== * drag&drop methods that used to be stubbed out and implemented in dd-gridstack.ts diff --git a/vue/package.json b/vue/package.json index 2630ec776..621ae357c 100644 --- a/vue/package.json +++ b/vue/package.json @@ -7,7 +7,7 @@ "dev": "vite", "start": "vite", "build": "vue-tsc -b && vite build", - "build:lib": "cd projects/lib && ../../../node_modules/.bin/vue-tsc -p tsconfig.build.json", + "build:lib": "cd projects/lib && ../../node_modules/.bin/vue-tsc -p tsconfig.build.json", "lint": "eslint .", "preview": "vite preview", "test": "vitest --config vitest.config.ts", diff --git a/vue/projects/lib/src/gridstack.ts b/vue/projects/lib/src/gridstack.ts index dcf430092..211d4c084 100644 --- a/vue/projects/lib/src/gridstack.ts +++ b/vue/projects/lib/src/gridstack.ts @@ -178,6 +178,7 @@ export const GridStackComponent = defineComponent({ }) grid = GridStack.init(props.options, rootEl) + if (!grid) return gridReady.value = true layoutVersion.value++ isEmpty.value = !grid.engine.nodes.length From 3c97f2561088fdca9e2c16b3237d2e6763288d47 Mon Sep 17 00:00:00 2001 From: Alain Dumesny Date: Sun, 26 Jul 2026 07:13:31 -0700 Subject: [PATCH 3/3] strict mode (v13.0.0) fails columnWidth without .breakpoints * Cursor changed the meaning when converting to strict mode. manually fixed this logic --- angular/projects/lib/package.json | 2 +- doc/CHANGES.md | 4 ++++ package.json | 2 +- src/gridstack.ts | 8 ++++++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/angular/projects/lib/package.json b/angular/projects/lib/package.json index c96f2df4e..5d4d91123 100644 --- a/angular/projects/lib/package.json +++ b/angular/projects/lib/package.json @@ -1,6 +1,6 @@ { "name": "gridstack-angular", - "version": "13.0.1", + "version": "13.0.2", "peerDependencies": { "@angular/common": ">=14", "@angular/core": ">=14" diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 4bc43a89c..0b0691a7a 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -5,6 +5,7 @@ Change log **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* +- [13.0.2 (2026-07-26)](#1302-2026-07-26) - [13.0.1 (2026-07-22)](#1301-2026-07-22) - [13.0.0 (2026-07-18)](#1300-2026-07-18) - [12.6.0 (2026-04-08)](#1260-2026-04-08) @@ -140,6 +141,9 @@ Change log +## 13.0.2 (2026-07-26) +* fix: [#3340](https://github.com/gridstack/gridstack.js/pull/3340) strict mode (v13.0.0) fails columnWidth without .breakpoints + ## 13.0.1 (2026-07-22) * fix: [#3325](https://github.com/gridstack/gridstack.js/issues/3325) preinstall script * fix: [#3324](https://github.com/gridstack/gridstack.js/issues/3324) vue files missing from package diff --git a/package.json b/package.json index f9404907f..3b233fec7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gridstack", - "version": "13.0.1", + "version": "13.0.2", "license": "MIT", "author": "Alain Dumesny (https://github.com/adumesny)", "contributors": [ diff --git a/src/gridstack.ts b/src/gridstack.ts index c5dee2a69..5acbee671 100644 --- a/src/gridstack.ts +++ b/src/gridstack.ts @@ -297,8 +297,12 @@ export class GridStack { if (!resp.columnWidth && !bk?.length) { delete opts.columnOpts; } else { - resp.columnMax = resp.columnMax || 12; - if (bk!.length > 1) bk!.sort((a, b) => (b.w || 0) - (a.w || 0)); + if (bk && bk.length > 1) { + bk.sort((a, b) => (b.w || 0) - (a.w || 0)); + delete resp.columnWidth; // breakpoints wins if both set + } else { + resp.columnMax = resp.columnMax || 12; // set resonable limit ? + } } }