Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jacekradko committed Nov 21, 2024
1 parent 85241b9 commit 37b5a95
Show file tree
Hide file tree
Showing 27 changed files with 40 additions and 59 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"version-packages": "changeset version && pnpm install --lockfile-only --engine-strict=false",
"version-packages:canary": "./scripts/canary.mjs",
"version-packages:snapshot": "./scripts/snapshot.mjs",
"yalc:all": "for d in packages/*/; do echo $d; cd $d; pnpm dlx yalc push --replace --sig; cd '../../'; done"
"yalc:all": "for d in packages/*/; do echo $d; cd $d; pnpm yalc push --replace --sig; cd '../../'; done"
},
"devDependencies": {
"@actions/core": "^1.10.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"lint": "eslint src/",
"lint:attw": "attw --pack . --ignore-rules no-resolution cjs-resolves-to-esm internal-resolution-error",
"lint:publint": "pnpm copy:components && publint",
"publish:local": "pnpm dlx yalc push --replace --sig"
"publish:local": "pnpm yalc push --replace --sig"
},
"dependencies": {
"@clerk/backend": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"build:declarations": "tsc -p tsconfig.declarations.json",
"dev": "tsup --watch",
"dev:publish": "pnpm dev -- --env.publish",
"publish:local": "pnpm dlx yalc push --replace --sig",
"publish:local": "pnpm yalc push --replace --sig",
"build:lib": "tsup --env.NODE_ENV production",
"build:runtime": "cpy 'src/runtime/**/*.{mjs,js,cjs}' dist/runtime",
"clean": "rimraf ./dist",
Expand Down
2 changes: 1 addition & 1 deletion packages/chrome-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"lint": "eslint src/",
"lint:attw": "attw --pack .",
"lint:publint": "publint",
"publish:local": "pnpm dlx yalc push --replace --sig",
"publish:local": "pnpm yalc push --replace --sig",
"test": "jest",
"test:cache:clear": "jest --clearCache --useStderr",
"test:ci": "jest --maxWorkers=70%",
Expand Down
2 changes: 1 addition & 1 deletion packages/expo-passkeys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"lint": "eslint src/",
"open:android": "open -a \"Android Studio\" example/android",
"open:ios": "xed example/ios",
"publish:local": "pnpm dlx yalc push --replace --sig"
"publish:local": "pnpm yalc push --replace --sig"
},
"dependencies": {
"@clerk/shared": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"dev": "tsup --watch",
"dev:publish": "pnpm dev -- --env.publish",
"lint": "eslint src/",
"publish:local": "pnpm dlx yalc push --replace --sig"
"publish:local": "pnpm yalc push --replace --sig"
},
"dependencies": {
"@clerk/clerk-js": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"lint": "eslint src/",
"lint:attw": "attw --pack .",
"lint:publint": "publint",
"publish:local": "pnpm dlx yalc push --replace --sig",
"publish:local": "pnpm yalc push --replace --sig",
"test": "jest",
"test:cache:clear": "jest --clearCache --useStderr",
"test:ci": "jest --maxWorkers=70%"
Expand Down
2 changes: 1 addition & 1 deletion packages/fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"lint": "eslint src/",
"lint:attw": "attw --pack .",
"lint:publint": "publint",
"publish:local": "pnpm dlx yalc push --replace --sig",
"publish:local": "pnpm yalc push --replace --sig",
"test": "jest",
"test:cache:clear": "jest --clearCache --useStderr"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"lint": "eslint src/",
"lint:attw": "attw --pack . --ignore-rules no-resolution unexpected-module-syntax",
"lint:publint": "publint",
"publish:local": "pnpm dlx yalc push --replace --sig",
"publish:local": "pnpm yalc push --replace --sig",
"test": "vitest"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"lint": "eslint src/",
"lint:attw": "attw --pack . --ignore-rules no-resolution cjs-resolves-to-esm",
"lint:publint": "publint",
"publish:local": "pnpm dlx yalc push --replace --sig"
"publish:local": "pnpm yalc push --replace --sig"
},
"dependencies": {
"@clerk/backend": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"lint": "eslint src/",
"lint:attw": "attw --pack .",
"lint:publint": "publint",
"publish:local": "pnpm dlx yalc push --replace --sig",
"publish:local": "pnpm yalc push --replace --sig",
"test": "jest",
"test:cache:clear": "jest --clearCache --useStderr",
"test:ci": "jest --maxWorkers=70%"
Expand Down
2 changes: 1 addition & 1 deletion packages/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"lint": "eslint src/",
"lint:attw": "attw --pack .",
"lint:publint": "publint",
"publish:local": "pnpm dlx yalc push --replace --sig"
"publish:local": "pnpm yalc push --replace --sig"
},
"dependencies": {
"@clerk/backend": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"build": "pnpm clean && tsup",
"dev": "tsup --watch",
"dev:publish": "pnpm dev -- --env.publish",
"publish:local": "pnpm dlx yalc push --replace --sig",
"publish:local": "pnpm yalc push --replace --sig",
"clean": "rimraf ./dist",
"lint": "eslint src/",
"lint:publint": "publint",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"lint": "eslint src/",
"lint:attw": "attw --pack .",
"lint:publint": "publint",
"publish:local": "pnpm dlx yalc push --replace --sig",
"publish:local": "pnpm yalc push --replace --sig",
"test": "jest",
"test:cache:clear": "jest --clearCache --useStderr",
"test:ci": "jest --maxWorkers=70%",
Expand Down
2 changes: 1 addition & 1 deletion packages/tanstack-start/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"lint": "eslint src/",
"lint:attw": "attw --pack . --ignore-rules cjs-resolves-to-esm",
"lint:publint": "publint",
"publish:local": "pnpm dlx yalc push --replace --sig"
"publish:local": "pnpm yalc push --replace --sig"
},
"dependencies": {
"@clerk/backend": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"lint": "eslint src/",
"lint:attw": "attw --pack . --ignore-rules no-resolution cjs-resolves-to-esm",
"lint:publint": "publint",
"publish:local": "pnpm dlx yalc push --replace --sig",
"publish:local": "pnpm yalc push --replace --sig",
"test": "vitest",
"test:ci": "vitest --maxWorkers=70%"
},
Expand Down
35 changes: 8 additions & 27 deletions patches/yalc@1.0.0-pre.53.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ index 930c1ca9954777dd1492a9e2373029d4644804cc..01e709cffb2a100bc6b0089edf91527d
},
"devDependencies": {
diff --git a/src/copy.js b/src/copy.js
index 3a6dca7b7a6ffde2527e7866f923c56f7d7061b8..9f84150a5d139562545c57965ad0f7488a8a050c 100644
index 3a6dca7b7a6ffde2527e7866f923c56f7d7061b8..19ac807a17779219800a0230b0620a5dfd4c641d 100644
--- a/src/copy.js
+++ b/src/copy.js
@@ -56,6 +56,7 @@ var fs_extra_1 = __importDefault(require("fs-extra"));
Expand All @@ -22,13 +22,13 @@ index 3a6dca7b7a6ffde2527e7866f923c56f7d7061b8..9f84150a5d139562545c57965ad0f748
var _1 = require(".");
var _2 = require(".");
var shortSignatureLength = 8;
@@ -120,6 +121,38 @@ var resolveWorkspaceDepVersion = function (version, pkgName, workingDir) {
@@ -120,6 +121,19 @@ var resolveWorkspaceDepVersion = function (version, pkgName, workingDir) {
return '*';
}
};
+var resolveCatalogDepVersion = function (subCatalog, pkgName, workingDir) {
+ var _a;
+ var workspaceFilePath = path_1.join(workingDir, 'pnpm-workspace.yaml');
+ var workspaceFilePath = path_1.join(workingDir, '../../pnpm-workspace.yaml');
+ var workspaceContent = fs_extra_1.default.readFileSync(workspaceFilePath, 'utf8');
+ var workspaceYaml = yaml_1.parse(workspaceContent);
+ if (!workspaceYaml) {
Expand All @@ -37,44 +37,25 @@ index 3a6dca7b7a6ffde2527e7866f923c56f7d7061b8..9f84150a5d139562545c57965ad0f748
+ var packages = subCatalog && subCatalog.length > 0
+ ? ((_a = workspaceYaml === null || workspaceYaml === void 0 ? void 0 : workspaceYaml.catalogs) === null || _a === void 0 ? void 0 : _a[subCatalog]) || []
+ : (workspaceYaml === null || workspaceYaml === void 0 ? void 0 : workspaceYaml.catalog) || [];
+ try {
+ for (var _i = 0, packages_1 = packages; _i < packages_1.length; _i++) {
+ var pkgPattern = packages_1[_i];
+ var potentialPath = path_1.join(workingDir, pkgPattern, pkgName, 'package.json');
+ try {
+ var resolvedPackage = require.resolve(potentialPath);
+ var pkgManifest = require(resolvedPackage);
+ return pkgManifest.version || '*';
+ }
+ catch (_b) {
+ continue; // Try the next pattern
+ }
+ }
+ console.warn("Could not find a package matching " + pkgName + " in catalog.");
+ return '*';
+ }
+ catch (e) {
+ console.error('Error reading pnpm-workspace.yaml:', e);
+ return '*';
+ }
+ return packages[pkgName] || '*';
+};
var resolveWorkspaces = function (pkg, workingDir) {
var resolveDeps = function (deps) {
return deps
@@ -130,6 +163,12 @@ var resolveWorkspaces = function (pkg, workingDir) {
@@ -130,6 +144,12 @@ var resolveWorkspaces = function (pkg, workingDir) {
console.log("Resolving workspace package " + depPkgName + " version ==> " + resolved);
return resolved;
}
+ if (val.startsWith('catalog:')) {
+ var version = val.split(':')[1];
+ var resolved = resolveCatalogDepVersion(version, depPkgName, workingDir);
+ var subCatalog = val.split(':')[1];
+ var resolved = resolveCatalogDepVersion(subCatalog, depPkgName, workingDir);
+ console.log("Resolving catalog package " + depPkgName + " version ==> " + resolved);
+ return resolved;
+ }
return val;
})
: deps;
@@ -160,9 +199,9 @@ exports.copyPackageToStore = function (options) { return __awaiter(void 0, void
@@ -160,9 +180,9 @@ exports.copyPackageToStore = function (options) { return __awaiter(void 0, void
case 2:
npmList = _c.sent();
filesToCopy = npmList.filter(function (f) { return !ignoreRule.ignores(f); });
Expand Down
6 changes: 3 additions & 3 deletions playground/app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev:yalc": "pnpm yalc && rm -rf .next && next dev --port 4011",
"yalc": "yalc add -- @clerk/nextjs @clerk/clerk-react @clerk/backend @clerk/types @clerk/shared",
"dev:yalc": "pnpm yalc:add && rm -rf .next && next dev --port 4011",
"yalc:add": "pnpm yalc add -- @clerk/nextjs @clerk/clerk-react @clerk/backend @clerk/types @clerk/shared",
"dev": "next dev --port 4011",
"build": "next build",
"build:yalc": "pnpm yalc && rm -rf .next && next build",
"build:yalc": "pnpm yalc:add && rm -rf .next && next build",
"start": "next start",
"lint": "next lint"
},
Expand Down
2 changes: 1 addition & 1 deletion playground/chrome-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
"scripts": {
"build": "vite build",
"dev": "pnpm yalc:add && nodemon",
"yalc:add": "yalc add -- @clerk/chrome-extension @clerk/clerk-react @clerk/clerk-js @clerk/localizations @clerk/themes @clerk/types @clerk/shared"
"yalc:add": "pnpm yalc add -- @clerk/chrome-extension @clerk/clerk-react @clerk/clerk-js @clerk/localizations @clerk/themes @clerk/types @clerk/shared"
}
}
2 changes: 1 addition & 1 deletion playground/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"ios": "expo run:ios",
"start": "expo start",
"web": "expo start --web",
"yalc": "yalc add @clerk/clerk-expo @clerk/clerk-js @clerk/clerk-react @clerk/types @clerk/shared @clerk/types @clerk/expo-passkeys",
"yalc:add": "pnpm yalc add @clerk/clerk-expo @clerk/clerk-js @clerk/clerk-react @clerk/types @clerk/shared @clerk/types @clerk/expo-passkeys",
"expo:update": "pnpm expo install --fix"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion playground/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"start": "ts-node ./src/server.ts",
"yalc:add": "yalc add -- @clerk/express @clerk/types @clerk/backend @clerk/shared",
"yalc:add": "pnpm yalc add -- @clerk/express @clerk/types @clerk/backend @clerk/shared",
"dev:fromlocal": " nodemon --watch .yalc --watch src --exec \"pnpm yalc:add && pnpm start\""
},
"author": "",
Expand Down
4 changes: 2 additions & 2 deletions playground/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev:yalc": "pnpm yalc && rm -rf .next && next dev --port 4011",
"yalc": "yalc add @clerk/nextjs @clerk/clerk-react @clerk/backend @clerk/types @clerk/shared",
"dev:yalc": "pnpm yalc:add && rm -rf .next && next dev --port 4011",
"yalc:add": "pnpm yalc add @clerk/nextjs @clerk/clerk-react @clerk/backend @clerk/types @clerk/shared",
"dev": "rm -rf .next && next dev --port 4011",
"build": "next build",
"start": "next start",
Expand Down
2 changes: 1 addition & 1 deletion playground/remix-cf-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dev": "remix build && run-p \"dev:*\"",
"start": "cross-env NODE_ENV=production pnpm dev:wrangler",
"typecheck": "tsc -b",
"yalc:add": "yalc add @clerk/types && yalc add @clerk/remix && yalc add @clerk/backend"
"yalc:add": "pnpm yalc add @clerk/types && yalc add @clerk/remix && yalc add @clerk/backend"
},
"dependencies": {
"@clerk/backend": "file:.yalc/@clerk/backend",
Expand Down
2 changes: 1 addition & 1 deletion playground/remix-cf-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dev:miniflare": "cross-env NODE_ENV=development miniflare ./build/index.js --watch",
"dev": "remix build && run-p \"dev:*\"",
"start": "cross-env NODE_ENV=production miniflare ./build/index.js",
"yalc:add": "yalc add @clerk/types && yalc add @clerk/remix && yalc add @clerk/backend"
"yalc:add": "pnpm yalc add @clerk/types && yalc add @clerk/remix && yalc add @clerk/backend"
},
"dependencies": {
"@clerk/backend": "file:.yalc/@clerk/backend",
Expand Down
2 changes: 1 addition & 1 deletion playground/remix-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dev": "remix dev",
"start": "remix-serve build",
"clean": "rm -rf .cache build",
"yalc:add": "yalc add -- @clerk/types @clerk/shared @clerk/backend @clerk/remix @clerk/clerk-react"
"yalc:add": "pnpm yalc add -- @clerk/types @clerk/shared @clerk/backend @clerk/remix @clerk/clerk-react"
},
"dependencies": {
"@clerk/backend": "file:.yalc/@clerk/backend",
Expand Down
4 changes: 2 additions & 2 deletions playground/vite-react-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"dev:yalc": "pnpm yalc && vite",
"yalc": "yalc add -- @clerk/clerk-react @clerk/types @clerk/shared"
"dev:yalc": "pnpm yalc:add && vite",
"yalc:add": "pnpm yalc add -- @clerk/clerk-react @clerk/types @clerk/shared"
},
"dependencies": {
"@clerk/clerk-js": "file:.yalc/@clerk/clerk-js",
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 37b5a95

Please sign in to comment.