From daac958b311c56d5e155dfb4f652a425c67d3c7c Mon Sep 17 00:00:00 2001 From: akash-aman Date: Mon, 5 Oct 2026 08:12:09 +0530 Subject: [PATCH 1/4] fix: React 18, CommonJS and type declarations in the 1.x packages - Externalize react/jsx-runtime and react-dom subpaths (the bundle inlined React 19's runtime) and set the React peers to ^18 || ^19. - Name the CommonJS builds .cjs so require() loads them as CommonJS in these "type": "module" packages; drop core's browser field. - Ship one rolled-up declaration file per package, importing @dynamix-layout/core as a package instead of ../../../core/src, plus index.d.cts for require. - solid-js becomes a peer dependency of the Solid package, and the packages install on Node 18+. --- packages/core/package.json | 19 ++++++++++-------- packages/core/vite.config.ts | 13 ++++++++++++- packages/react/package.json | 26 +++++++++++++++---------- packages/react/tsconfig.build.json | 9 +++++++++ packages/react/vite.config.ts | 22 ++++++++++++++++++--- packages/solid/package.json | 31 +++++++++++++++++++----------- packages/solid/tsconfig.build.json | 9 +++++++++ packages/solid/vite.config.ts | 19 ++++++++++++++++-- pnpm-lock.yaml | 6 +++--- 9 files changed, 116 insertions(+), 38 deletions(-) create mode 100644 packages/react/tsconfig.build.json create mode 100644 packages/solid/tsconfig.build.json diff --git a/packages/core/package.json b/packages/core/package.json index 4fbc59a..4677df3 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -21,23 +21,27 @@ ], "repository": { "type": "git", - "url": "https://github.com/xcode-studio/dynamix-layout.git", + "url": "git+https://github.com/xcode-studio/dynamix-layout.git", "directory": "packages/core" }, "bugs": { "url": "https://github.com/xcode-studio/dynamix-layout/issues" }, "homepage": "https://github.com/xcode-studio/dynamix-layout#readme", - "main": "./dist/core.cjs.js", + "main": "./dist/core.cjs", "module": "./dist/core.es.js", - "browser": "./dist/core.iife.js", "types": "./dist/types/index.d.ts", "typings": "./dist/types/index.d.ts", "exports": { ".": { - "types": "./dist/types/index.d.ts", - "import": "./dist/core.es.js", - "require": "./dist/core.cjs.js" + "import": { + "types": "./dist/types/index.d.ts", + "default": "./dist/core.es.js" + }, + "require": { + "types": "./dist/types/index.d.cts", + "default": "./dist/core.cjs" + } } }, "files": [ @@ -53,8 +57,7 @@ }, "type": "module", "engines": { - "node": ">=22.16.0", - "pnpm": ">=10.13.1" + "node": ">=18" }, "scripts": { "dev": "vite build --watch", diff --git a/packages/core/vite.config.ts b/packages/core/vite.config.ts index 5d6ece5..81ceec5 100644 --- a/packages/core/vite.config.ts +++ b/packages/core/vite.config.ts @@ -16,13 +16,24 @@ export default defineConfig({ lib: { entry: resolve(__dirname, 'src/index.ts'), name: 'dynamix.layout.core', - fileName: (format) => `core.${format}.js`, + // `.cjs` so Node loads the CommonJS build as CommonJS in this `"type": "module"` package. + fileName: (format) => (format === 'cjs' ? 'core.cjs' : `core.${format}.js`), formats: ['cjs', 'es', 'iife', 'umd'], }, }, plugins: [ dts({ outDir: 'dist/types', + // Types-only modules never reach the bundle graph; list sources explicitly. + include: ['src'], + // One self-contained declaration file (Node16 resolution can't follow + // extensionless imports), copied to index.d.cts for `require`. + rollupTypes: true, + afterBuild: () => + fs.copyFileSync( + resolve(__dirname, 'dist/types/index.d.ts'), + resolve(__dirname, 'dist/types/index.d.cts') + ), exclude: ['node_modules/**', 'src/test/**'], }), visualizer({ diff --git a/packages/react/package.json b/packages/react/package.json index cbae04f..4e42df2 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -27,25 +27,32 @@ ], "repository": { "type": "git", - "url": "https://github.com/xcode-studio/dynamix-layout", + "url": "git+https://github.com/xcode-studio/dynamix-layout.git", "directory": "packages/react" }, "bugs": { "url": "https://github.com/xcode-studio/dynamix-layout/issues" }, "homepage": "https://github.com/xcode-studio/dynamix-layout#readme", - "main": "./dist/index.cjs.js", + "main": "./dist/index.cjs", "module": "./dist/index.es.js", "types": "./dist/types/index.d.ts", "typings": "./dist/types/index.d.ts", "style": "./dist/index.css", "exports": { ".": { - "types": "./dist/types/index.d.ts", - "import": "./dist/index.es.js", - "require": "./dist/index.cjs.js" + "import": { + "types": "./dist/types/index.d.ts", + "default": "./dist/index.es.js" + }, + "require": { + "types": "./dist/types/index.d.cts", + "default": "./dist/index.cjs" + } }, - "./style.css": "./dist/index.css" + "./style.css": "./dist/index.css", + "./styles.css": "./dist/index.css", + "./package.json": "./package.json" }, "files": [ "dist", @@ -62,8 +69,7 @@ }, "type": "module", "engines": { - "node": ">=22.16.0", - "pnpm": ">=10.13.1" + "node": ">=18" }, "scripts": { "dev": "vite build --watch", @@ -78,8 +84,8 @@ "@dynamix-layout/core": "workspace:*" }, "peerDependencies": { - "react": "^0.0.1", - "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" }, "devDependencies": { "@repo/eslint-config": "workspace:*", diff --git a/packages/react/tsconfig.build.json b/packages/react/tsconfig.build.json new file mode 100644 index 0000000..5a8c8d2 --- /dev/null +++ b/packages/react/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + // Declarations resolve @dynamix-layout/core from its built package, as users will. + "extends": "./tsconfig.json", + "compilerOptions": { + "paths": {}, + "composite": false + }, + "exclude": ["node_modules", "src/test"] +} diff --git a/packages/react/vite.config.ts b/packages/react/vite.config.ts index 13b7b10..327a94b 100644 --- a/packages/react/vite.config.ts +++ b/packages/react/vite.config.ts @@ -29,6 +29,20 @@ export default defineConfig({ plugins: [ dts({ outDir: 'dist/types', + tsconfigPath: './tsconfig.build.json', + // Types-only modules never reach the bundle graph; list sources explicitly. + include: ['src'], + // One self-contained declaration file (Node16 resolution can't follow + // extensionless imports), copied to index.d.cts for `require`. + rollupTypes: true, + afterBuild: () => + fs.copyFileSync( + resolve(__dirname, 'dist/types/index.d.ts'), + resolve(__dirname, 'dist/types/index.d.cts') + ), + // Keep `@dynamix-layout/core` as a package import in the .d.ts files. + aliasesExclude: [/^@dynamix-layout\/core/], + pathsToAliases: false, exclude: ['node_modules/**', 'src/test/**'], staticImport: true, }), @@ -46,12 +60,14 @@ export default defineConfig({ lib: { entry: resolve(__dirname, 'src/index.ts'), name: 'dynamix.layout.react', - fileName: (format) => `index.${format}.js`, - formats: ['cjs', 'es', 'iife', 'umd'], + // `.cjs` so Node loads the CommonJS build as CommonJS in this `"type": "module"` package. + fileName: (format) => (format === 'cjs' ? 'index.cjs' : `index.${format}.js`), + formats: ['cjs', 'es'], }, cssCodeSplit: true, rollupOptions: { - external: ['react', 'react-dom', '@dynamix-layout/core'], + // Subpaths too: bundling `react/jsx-runtime` tied the package to React 19. + external: [/^react($|\/)/, /^react-dom($|\/)/, /^@dynamix-layout\/core($|\/)/], output: { globals: { react: 'React', diff --git a/packages/solid/package.json b/packages/solid/package.json index 827996c..7506a25 100644 --- a/packages/solid/package.json +++ b/packages/solid/package.json @@ -26,25 +26,32 @@ ], "repository": { "type": "git", - "url": "https://github.com/xcode-studio/dynamix-layout", + "url": "git+https://github.com/xcode-studio/dynamix-layout.git", "directory": "packages/solid" }, "bugs": { "url": "https://github.com/xcode-studio/dynamix-layout/issues" }, "homepage": "https://github.com/xcode-studio/dynamix-layout#readme", - "main": "./dist/index.cjs.js", + "main": "./dist/index.cjs", "module": "./dist/index.es.js", "types": "./dist/types/index.d.ts", "typings": "./dist/types/index.d.ts", "style": "./dist/index.css", "exports": { ".": { - "types": "./dist/types/index.d.ts", - "import": "./dist/index.es.js", - "require": "./dist/index.cjs.js" + "import": { + "types": "./dist/types/index.d.ts", + "default": "./dist/index.es.js" + }, + "require": { + "types": "./dist/types/index.d.cts", + "default": "./dist/index.cjs" + } }, - "./style.css": "./dist/index.css" + "./style.css": "./dist/index.css", + "./styles.css": "./dist/index.css", + "./package.json": "./package.json" }, "files": [ "dist", @@ -61,8 +68,7 @@ }, "type": "module", "engines": { - "node": ">=22.16.0", - "pnpm": ">=10.13.1" + "node": ">=18" }, "scripts": { "dev": "vite build --watch", @@ -84,10 +90,13 @@ "typescript": "^5.9.3", "vite": "^7.3.6", "vite-plugin-solid": "2.11.14", - "vitest": "^4.1.11" + "vitest": "^4.1.11", + "solid-js": "^1.9.15" }, "dependencies": { - "@dynamix-layout/core": "workspace:*", - "solid-js": "^1.9.15" + "@dynamix-layout/core": "workspace:*" + }, + "peerDependencies": { + "solid-js": "^1.8.0" } } diff --git a/packages/solid/tsconfig.build.json b/packages/solid/tsconfig.build.json new file mode 100644 index 0000000..5a8c8d2 --- /dev/null +++ b/packages/solid/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + // Declarations resolve @dynamix-layout/core from its built package, as users will. + "extends": "./tsconfig.json", + "compilerOptions": { + "paths": {}, + "composite": false + }, + "exclude": ["node_modules", "src/test"] +} diff --git a/packages/solid/vite.config.ts b/packages/solid/vite.config.ts index dfa1b7c..1b69acb 100644 --- a/packages/solid/vite.config.ts +++ b/packages/solid/vite.config.ts @@ -32,6 +32,20 @@ export default defineConfig({ solidPlugin(), dts({ outDir: 'dist/types', + tsconfigPath: './tsconfig.build.json', + // Types-only modules never reach the bundle graph; list sources explicitly. + include: ['src'], + // One self-contained declaration file (Node16 resolution can't follow + // extensionless imports), copied to index.d.cts for `require`. + rollupTypes: true, + afterBuild: () => + fs.copyFileSync( + resolve(__dirname, 'dist/types/index.d.ts'), + resolve(__dirname, 'dist/types/index.d.cts') + ), + // Keep `@dynamix-layout/core` as a package import in the .d.ts files. + aliasesExclude: [/^@dynamix-layout\/core/], + pathsToAliases: false, exclude: ['node_modules/**', 'src/test/**'], staticImport: true, }), @@ -49,12 +63,13 @@ export default defineConfig({ lib: { entry: resolve(__dirname, 'src/index.ts'), name: 'dynamix.layout.solid', - fileName: (format) => `index.${format}.js`, + // `.cjs` so Node loads the CommonJS build as CommonJS in this `"type": "module"` package. + fileName: (format) => (format === 'cjs' ? 'index.cjs' : `index.${format}.js`), formats: ['es', 'cjs'], }, cssCodeSplit: true, rollupOptions: { - external: ['solid-js', 'solid-js/web', '@dynamix-layout/core'], + external: [/^solid-js($|\/)/, /^@dynamix-layout\/core($|\/)/], output: { globals: { 'solid-js': 'solidJs', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 74a57ee..42a584b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -580,9 +580,6 @@ importers: '@dynamix-layout/core': specifier: workspace:* version: link:../core - solid-js: - specifier: ^1.9.15 - version: 1.9.15 devDependencies: '@repo/eslint-config': specifier: workspace:* @@ -599,6 +596,9 @@ importers: jsdom: specifier: ^26.1.0 version: 26.1.0 + solid-js: + specifier: ^1.9.15 + version: 1.9.15 typescript: specifier: ^5.9.3 version: 5.9.3 From bb342619bf4366ab70b869aa6eab4fdda2fbd433 Mon Sep 17 00:00:00 2001 From: akash-aman Date: Mon, 5 Oct 2026 08:12:09 +0530 Subject: [PATCH 2/4] docs: correct the stylesheet import and repository links --- CONTRIBUTING.md | 4 ++-- README.md | 6 +++--- SECURITY.md | 2 +- apps/site/src/components/Footer.tsx | 18 +++++++++--------- apps/site/src/components/Header.tsx | 14 +++++++------- apps/site/src/components/HeroSection.tsx | 2 +- .../src/components/InstallationSection.tsx | 6 +++--- packages/core/README.md | 2 +- packages/core/src/index.ts | 2 +- packages/react/README.md | 6 +++--- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6bfa430..1c80565 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,11 +6,11 @@ First off, thank you for considering contributing to Dynamix Layout! It's people ### Reporting Bugs -If you find a bug, please open an issue on our [GitHub Issues page](https://github.com/akash-aman/dynamix-layout/issues). Please include a clear title and description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring. +If you find a bug, please open an issue on our [GitHub Issues page](https://github.com/xcode-studio/dynamix-layout/issues). Please include a clear title and description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring. ### Suggesting Enhancements -If you have an idea for an enhancement, please open an issue on our [GitHub Issues page](https://github.com/akash-aman/dynamix-layout/issues). Please provide a clear title and a detailed description of your suggestion. +If you have an idea for an enhancement, please open an issue on our [GitHub Issues page](https://github.com/xcode-studio/dynamix-layout/issues). Please provide a clear title and a detailed description of your suggestion. ### Pull Requests diff --git a/README.md b/README.md index 38ec780..9062275 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ NPM -License +License

@@ -49,7 +49,7 @@ Dynamix Layout is a powerful JavaScript library designed to help you build compl --- -![Demo](https://raw.githubusercontent.com/akash-aman/dynamix-layout/main/assets/demo1.gif) +![Demo](https://raw.githubusercontent.com/xcode-studio/dynamix-layout/main/assets/demo1.gif) --- @@ -167,7 +167,7 @@ export default App ## 🤝 Contributing -Contributions, issues, and feature requests are welcome\! Feel free to check the [issues page](https://github.com/akash-aman/dynamix-layout/issues). +Contributions, issues, and feature requests are welcome\! Feel free to check the [issues page](https://github.com/xcode-studio/dynamix-layout/issues). ## 📝 License diff --git a/SECURITY.md b/SECURITY.md index ac75864..863b5c1 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,7 +6,7 @@ The team takes the security of our project seriously. We appreciate your efforts If you discover a security vulnerability, please report it to us privately. **Do not create a public GitHub issue.** -We encourage you to report vulnerabilities through **[GitHub's Private Vulnerability Reporting](https://github.com/akash-aman/dynamix-layout/security)** feature. You can do this by going to the "Security" tab of our repository and clicking on "Report a vulnerability". +We encourage you to report vulnerabilities through **[GitHub's Private Vulnerability Reporting](https://github.com/xcode-studio/dynamix-layout/security)** feature. You can do this by going to the "Security" tab of our repository and clicking on "Report a vulnerability". Alternatively, you can email us at **[sir.akashaman@gmail.com]**. diff --git a/apps/site/src/components/Footer.tsx b/apps/site/src/components/Footer.tsx index 96d5a91..0c13bce 100644 --- a/apps/site/src/components/Footer.tsx +++ b/apps/site/src/components/Footer.tsx @@ -60,7 +60,7 @@ const Footer = () => {