Skip to content

Commit

Permalink
chore(root): Framework v2.0.3 (#6501)
Browse files Browse the repository at this point in the history
Co-authored-by: Paweł <[email protected]>
  • Loading branch information
SokratisVidros and LetItRock authored Sep 13, 2024
1 parent 03c972a commit b14ef50
Show file tree
Hide file tree
Showing 7 changed files with 374 additions and 128 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
},
"search.exclude": {
"**/.source": true
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"dev-environment-setup": "sh ./scripts/dev-environment-setup.sh",
"get-affected": "node scripts/print-affected-array.mjs",
"symlink:submodules": "pnpm --filter \"@novu/ee-*\" exec node \"$(pwd)/scripts/symlink-ee.mjs\"",
"install:with-ee": "pnpm install && pnpm symlink:submodules"
"install:with-ee": "pnpm install && pnpm symlink:submodules",
"restore-workspace-protocol": "node scripts/restore-workspace-protocol.mjs"
},
"devDependencies": {
"@auto-it/npm": "^10.36.5",
Expand Down Expand Up @@ -149,7 +150,9 @@
"eslint-plugin-unicorn": "^55.0.0",
"eslint-plugin-unused-imports": "^4.1.3",
"eslint-plugin-xss": "^0.1.12",
"execa": "^6.1.0",
"execa": "^9.3.1",
"fs-extra": "^9.0.0",
"glob": "^11.0.0",
"globby": "^12.2.0",
"gradient-string": "^2.0.1",
"husky": "^8.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/framework/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/framework",
"version": "2.0.2",
"version": "2.0.3",
"description": "The Code-First Notifications Workflow SDK.",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"main": "../dist/hooks/index.js",
"module": "../dist/hooks/index.mjs",
"types": "../dist/hooks/index.d.ts"
}
}
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/shared",
"version": "2.0.1",
"version": "2.0.2",
"description": "",
"scripts": {
"start": "npm run start:dev",
Expand Down
447 changes: 324 additions & 123 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions scripts/restore-workspace-protocol.mjs
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)));

0 comments on commit b14ef50

Please sign in to comment.