-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(root): Framework v2.0.3 (#6501)
Co-authored-by: Paweł <[email protected]>
- Loading branch information
1 parent
03c972a
commit b14ef50
Showing
7 changed files
with
374 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
"main": "../dist/hooks/index.js", | ||
"module": "../dist/hooks/index.mjs", | ||
"types": "../dist/hooks/index.d.ts" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import fs from 'fs-extra'; | ||
import path from 'node:path'; | ||
import { glob } from 'glob'; | ||
import { execa } from 'execa'; | ||
|
||
// The following node packages don't belong to the monorepo and must always be references with specific semver. | ||
const IGNORE_LIST = new Set(['@novu/ntfr-client', '@novu/floating-vue']); | ||
|
||
// WIP: Find all package names in the workspace dynamically and eliminate the need for the IGNORE_LIST | ||
async function getPackageNames() { | ||
const { stdout } = await execa`pnpm nx show projects`; | ||
return stdout; | ||
} | ||
|
||
// Function to update versions of @novu dependencies | ||
function updateNovuDependencies(dependencies) { | ||
for (const [key] of Object.entries(dependencies || {})) { | ||
if (key.startsWith('@novu/') && IGNORE_LIST.has(key)) { | ||
dependencies[key] = 'workspace:*'; | ||
} | ||
} | ||
} | ||
|
||
function processPackageJson(filePath) { | ||
const packageJson = fs.readJsonSync(filePath); | ||
|
||
updateNovuDependencies(packageJson.dependencies); | ||
updateNovuDependencies(packageJson.devDependencies); | ||
updateNovuDependencies(packageJson.peerDependencies); | ||
updateNovuDependencies(packageJson.optionalDependencies); | ||
|
||
fs.writeJsonSync(filePath, packageJson, { spaces: 2 }); | ||
console.log(`Restored workspace protocol at ${filePath}`); | ||
} | ||
|
||
// Find all package.json files in the repo | ||
const files = await glob('packages/**/package.json', { ignore: 'packages/**/node_modules/**' }); | ||
|
||
files.forEach((file) => processPackageJson(path.resolve(file))); |