From 6dfdc3ed6fcbc145a6780dbd51054cd7d6641b24 Mon Sep 17 00:00:00 2001 From: jshemas Date: Fri, 28 Jun 2024 21:39:36 -0400 Subject: [PATCH 1/7] updating the jsonLD unit test to make sure we do not send back empty objects --- tests/unit/static.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/static.spec.ts b/tests/unit/static.spec.ts index cd48f42..b4a0e84 100644 --- a/tests/unit/static.spec.ts +++ b/tests/unit/static.spec.ts @@ -218,6 +218,7 @@ describe('static check meta tags', function () { it('jsonLD', function () { const metaHTML = ` + `; mockAgent.get('http://www.test.com') From 367bbba500134dafd28c71dbe6c9ba16075e5a25 Mon Sep 17 00:00:00 2001 From: jshemas Date: Fri, 28 Jun 2024 21:40:41 -0400 Subject: [PATCH 2/7] moving types out of exports to support ts module set to commonjs --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6fbc3c3..5e29004 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,10 @@ "exports": { ".": { "require": "./dist/cjs/index.js", - "import": "./dist/esm/index.js", - "types": "./types/index.d.ts" + "import": "./dist/esm/index.js" } }, + "types": "./types/index.d.ts", "scripts": { "build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir dist/cjs/", "build:declaration": "tsc --project tsconfig.declaration.json --module node16 --moduleResolution node16", From b4fcf13c4f4d442ebf9482c742b17df2e7dcec96 Mon Sep 17 00:00:00 2001 From: jshemas Date: Fri, 28 Jun 2024 21:47:55 -0400 Subject: [PATCH 3/7] adding types back to the exports object for NextJS --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5e29004..aed1e6f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "exports": { ".": { "require": "./dist/cjs/index.js", - "import": "./dist/esm/index.js" + "import": "./dist/esm/index.js", + "types": "./types/index.d.ts" } }, "types": "./types/index.d.ts", From 0d44af125a49dc5760bb9169cc9cdeaa48fb5853 Mon Sep 17 00:00:00 2001 From: jshemas Date: Fri, 28 Jun 2024 21:51:13 -0400 Subject: [PATCH 4/7] turn off the vimeo tests for now --- tests/integration/basic.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/basic.spec.ts b/tests/integration/basic.spec.ts index fd3148a..8200575 100644 --- a/tests/integration/basic.spec.ts +++ b/tests/integration/basic.spec.ts @@ -224,7 +224,8 @@ describe('basic', function () { }); }); - it('vimeo.com should return open graph data', function () { + // vimeo.com is now blocking OGS even when using the "User Agent" header + it.skip('vimeo.com should return open graph data', function () { return ogsRequire({ url: 'https://vimeo.com/232889838' }).then(function ({ error, result, response }) { console.log('error:', error); console.log('result:', result); From dcf800ca688f0671c813f0a462ebc2bdb9c6e328 Mon Sep 17 00:00:00 2001 From: jshemas Date: Sat, 29 Jun 2024 17:38:41 -0400 Subject: [PATCH 5/7] adding main and types back into the package.json --- package.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index aed1e6f..3b322c0 100644 --- a/package.json +++ b/package.json @@ -3,14 +3,15 @@ "description": "Node.js scraper module for Open Graph and Twitter Card info", "version": "6.6.1", "license": "MIT", + "main": "./dist/cjs/index.js", + "types": "./types/index.d.ts", "exports": { ".": { - "require": "./dist/cjs/index.js", + "types": "./types/index.d.ts", "import": "./dist/esm/index.js", - "types": "./types/index.d.ts" + "require": "./dist/cjs/index.js" } }, - "types": "./types/index.d.ts", "scripts": { "build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir dist/cjs/", "build:declaration": "tsc --project tsconfig.declaration.json --module node16 --moduleResolution node16", From 15057940b26cbf763bb689946b94b757e7c38fcf Mon Sep 17 00:00:00 2001 From: jshemas Date: Sat, 29 Jun 2024 18:20:15 -0400 Subject: [PATCH 6/7] updating changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a04cb7..29f75b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 6.6.2 + +- Fixed issue with `package.json` `exports` was not working in `CommonJs` projects. + ## 6.6.1 - Use `node16` for `module`/`moduleResolution` ESM build From 5e897d117afdaac73acc67caf8d0aa226dbec53b Mon Sep 17 00:00:00 2001 From: jshemas Date: Sat, 29 Jun 2024 18:20:22 -0400 Subject: [PATCH 7/7] 6.6.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index bb1e84d..c462cf8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "open-graph-scraper", - "version": "6.6.1", + "version": "6.6.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "open-graph-scraper", - "version": "6.6.1", + "version": "6.6.2", "license": "MIT", "dependencies": { "chardet": "^2.0.0", diff --git a/package.json b/package.json index 3b322c0..6d33e07 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "open-graph-scraper", "description": "Node.js scraper module for Open Graph and Twitter Card info", - "version": "6.6.1", + "version": "6.6.2", "license": "MIT", "main": "./dist/cjs/index.js", "types": "./types/index.d.ts",