Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v7.0.0 #523

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3f78832
Include NextJS test app as pnpm workspace (#521)
Andarist Sep 26, 2024
a35a928
feat: Switch to Preconstruct for library building (#520)
Andarist Sep 27, 2024
d90d823
chore(release): 7.0.0-beta.1 [skip ci]
semantic-release-bot Sep 27, 2024
b1d1f61
fix: make sure to publish types (#528)
Andarist Oct 3, 2024
54f37bc
chore(release): 7.0.0-beta.2 [skip ci]
semantic-release-bot Oct 3, 2024
4bebc50
Merge branch 'main' into beta
colbyfayock Oct 14, 2024
48a800f
chore(release): 7.0.0-beta.3 [skip ci]
semantic-release-bot Oct 14, 2024
5d5de83
Merge branch 'main' into beta
colbyfayock Oct 15, 2024
86fd6ce
chore(release): 7.0.0-beta.4 [skip ci]
semantic-release-bot Oct 15, 2024
80c442d
Merge branch 'main' into beta
colbyfayock Oct 15, 2024
8562302
upgrading util packages to beta which refactors type system and how p…
colbyfayock Oct 25, 2024
08a60de
fix: upgrading util packages to beta which refactors type system and …
colbyfayock Oct 25, 2024
7b81087
chore(release): 7.0.0-beta.5 [skip ci]
semantic-release-bot Oct 25, 2024
edeee00
fix: upgrading url-loader to new beta
colbyfayock Oct 31, 2024
b164b93
Merge branch 'beta' of github.com:cloudinary-community/next-cloudinar…
colbyfayock Oct 31, 2024
d2e115e
fix: oops, pnpm lock
colbyfayock Oct 31, 2024
47d8f80
chore(release): 7.0.0-beta.6 [skip ci]
semantic-release-bot Oct 31, 2024
94e9e87
fix: upgrading util packages, fixing prop definitions
colbyfayock Oct 31, 2024
32111f5
Merge branch 'beta' of github.com:cloudinary-community/next-cloudinar…
colbyfayock Oct 31, 2024
1282ddf
chore(release): 7.0.0-beta.7 [skip ci]
semantic-release-bot Oct 31, 2024
f237e58
Merge branch 'main' into beta
colbyfayock Nov 1, 2024
a3a58bd
chore(release): 7.0.0-beta.8 [skip ci]
semantic-release-bot Nov 1, 2024
1b9c160
fix: upgrading to stable releases for url-loader and util packages
colbyfayock Nov 1, 2024
c7d1520
Merge branch 'beta' of github.com:cloudinary-community/next-cloudinar…
colbyfayock Nov 1, 2024
2955336
chore(release): 7.0.0-beta.9 [skip ci]
semantic-release-bot Nov 1, 2024
74e1b96
fix: add src type to CloudinaryLoaderCldOptions interface (#552)
vickywane Nov 1, 2024
2892d85
chore(release): 7.0.0-beta.10 [skip ci]
semantic-release-bot Nov 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 78 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,84 @@
# [6.16.0](https://github.com/cloudinary-community/next-cloudinary/compare/v6.15.0...v6.16.0) (2024-10-22)
# [7.0.0-beta.10](https://github.com/cloudinary-community/next-cloudinary/compare/v7.0.0-beta.9...v7.0.0-beta.10) (2024-11-01)


### Bug Fixes

* add src type to CloudinaryLoaderCldOptions interface ([#552](https://github.com/cloudinary-community/next-cloudinary/issues/552)) ([74e1b96](https://github.com/cloudinary-community/next-cloudinary/commit/74e1b96e8d6f81135628c90a61ac6ac2584c3d4b)), closes [#425](https://github.com/cloudinary-community/next-cloudinary/issues/425)

# [7.0.0-beta.9](https://github.com/cloudinary-community/next-cloudinary/compare/v7.0.0-beta.8...v7.0.0-beta.9) (2024-11-01)


### Bug Fixes

* upgrading to stable releases for url-loader and util packages ([1b9c160](https://github.com/cloudinary-community/next-cloudinary/commit/1b9c160dca04601d133b83d7dc15b34acccfa54f))

# [7.0.0-beta.8](https://github.com/cloudinary-community/next-cloudinary/compare/v7.0.0-beta.7...v7.0.0-beta.8) (2024-11-01)


### Bug Fixes

* lockfile ([cb44682](https://github.com/cloudinary-community/next-cloudinary/commit/cb4468258a0589dabc614ccbf5014d4d37e365de))


### Features

* nextjs 15 support in package.json ([fb75bff](https://github.com/cloudinary-community/next-cloudinary/commit/fb75bffabc41390339c2b5dc3cd754e473d5674e))

# [7.0.0-beta.7](https://github.com/cloudinary-community/next-cloudinary/compare/v7.0.0-beta.6...v7.0.0-beta.7) (2024-10-31)

### Bug Fixes

* upgrading util packages, fixing prop definitions ([94e9e87](https://github.com/cloudinary-community/next-cloudinary/commit/94e9e87d69565dccf1c2a7c62617b26ef1c7c6f3))

# [7.0.0-beta.6](https://github.com/cloudinary-community/next-cloudinary/compare/v7.0.0-beta.5...v7.0.0-beta.6) (2024-10-31)


### Bug Fixes

* oops, pnpm lock ([d2e115e](https://github.com/cloudinary-community/next-cloudinary/commit/d2e115ea51b7ab689c9e730e76a0ff66a5b48c5c))
* upgrading url-loader to new beta ([edeee00](https://github.com/cloudinary-community/next-cloudinary/commit/edeee003fd5d1169fe20ccf54e646bf35467c7a3))

# [7.0.0-beta.5](https://github.com/cloudinary-community/next-cloudinary/compare/v7.0.0-beta.4...v7.0.0-beta.5) (2024-10-25)


### Bug Fixes

* upgrading util packages to beta which refactors type system and how props are exported ([08a60de](https://github.com/cloudinary-community/next-cloudinary/commit/08a60de07288a9594efd3f9b4d20a6234dc89446))

# [7.0.0-beta.4](https://github.com/cloudinary-community/next-cloudinary/compare/v7.0.0-beta.3...v7.0.0-beta.4) (2024-10-15)


### Features

* Log x-cld-error on image error ([#553](https://github.com/cloudinary-community/next-cloudinary/issues/553)) ([711c759](https://github.com/cloudinary-community/next-cloudinary/commit/711c75989d30ef544f69914efdb961bd0963d492)), closes [#512](https://github.com/cloudinary-community/next-cloudinary/issues/512)

# [7.0.0-beta.3](https://github.com/cloudinary-community/next-cloudinary/compare/v7.0.0-beta.2...v7.0.0-beta.3) (2024-10-14)

### Bug Fixes

* removed ts-ignore ([#535](https://github.com/cloudinary-community/next-cloudinary/issues/535)) ([32931c9](https://github.com/cloudinary-community/next-cloudinary/commit/32931c9f0aab70a03df8e4f0bca05a56f5d75210)), closes [#426](https://github.com/cloudinary-community/next-cloudinary/issues/426)
* use more proper type to derive `CldVideoPlayerProps` ([#537](https://github.com/cloudinary-community/next-cloudinary/issues/537)) ([65c3dd1](https://github.com/cloudinary-community/next-cloudinary/commit/65c3dd199176cd91d43161289672381b8c640b68))
* lockfile ([cb44682](https://github.com/cloudinary-community/next-cloudinary/commit/cb4468258a0589dabc614ccbf5014d4d37e365de))

### Features

* added unique id generation using React's `useId()` hook ([#529](https://github.com/cloudinary-community/next-cloudinary/issues/529)) ([682f4c2](https://github.com/cloudinary-community/next-cloudinary/commit/682f4c22cf7ed710383b34a9f52cf3db05bd1fb1)), closes [#493](https://github.com/cloudinary-community/next-cloudinary/issues/493)

# [7.0.0-beta.2](https://github.com/cloudinary-community/next-cloudinary/compare/v7.0.0-beta.1...v7.0.0-beta.2) (2024-10-03)

* Switch to Preconstruct for library building ([#520](https://github.com/cloudinary-community/next-cloudinary/issues/520)) ([a35a928](https://github.com/cloudinary-community/next-cloudinary/commit/a35a92872dc2e78626060e977b2bf7b1b60856dd))

# [7.0.0-beta.1](https://github.com/cloudinary-community/next-cloudinary/compare/v6.13.0...v7.0.0-beta.1) (2024-09-27)

### Features
* make sure to publish types ([#528](https://github.com/cloudinary-community/next-cloudinary/issues/528)) ([b1d1f61](https://github.com/cloudinary-community/next-cloudinary/commit/b1d1f61ba086959f05d0d3bcd08747c7e2b33abc))

### BREAKING CHANGES

* New build tool, no longer requires `use client` directive, marking as breaking for safety
* use more proper type to derive `CldVideoPlayerProps` ([#537](https://github.com/cloudinary-community/next-cloudinary/issues/537)) ([65c3dd1](https://github.com/cloudinary-community/next-cloudinary/commit/65c3dd199176cd91d43161289672381b8c640b68))

# [6.16.0](https://github.com/cloudinary-community/next-cloudinary/compare/v6.15.0...v6.16.0) (2024-10-22)

* nextjs 15 support in package.json ([fb75bff](https://github.com/cloudinary-community/next-cloudinary/commit/fb75bffabc41390339c2b5dc3cd754e473d5674e))

Expand All @@ -26,20 +98,21 @@

## [6.14.1](https://github.com/cloudinary-community/next-cloudinary/compare/v6.14.0...v6.14.1) (2024-10-04)

## [6.14.2](https://github.com/cloudinary-community/next-cloudinary/compare/v6.14.1...v6.14.2) (2024-10-14)

## [6.14.1](https://github.com/cloudinary-community/next-cloudinary/compare/v6.14.0...v6.14.1) (2024-10-04)

### Bug Fixes

* removed ts-ignore ([#535](https://github.com/cloudinary-community/next-cloudinary/issues/535)) ([32931c9](https://github.com/cloudinary-community/next-cloudinary/commit/32931c9f0aab70a03df8e4f0bca05a56f5d75210)), closes [#426](https://github.com/cloudinary-community/next-cloudinary/issues/426)

# [6.14.0](https://github.com/cloudinary-community/next-cloudinary/compare/v6.13.0...v6.14.0) (2024-10-03)


### Features
# [6.14.0](https://github.com/cloudinary-community/next-cloudinary/compare/v6.13.0...v6.14.0) (2024-10-03)

* added unique id generation using React's `useId()` hook ([#529](https://github.com/cloudinary-community/next-cloudinary/issues/529)) ([682f4c2](https://github.com/cloudinary-community/next-cloudinary/commit/682f4c22cf7ed710383b34a9f52cf3db05bd1fb1)), closes [#493](https://github.com/cloudinary-community/next-cloudinary/issues/493)

# [6.13.0](https://github.com/cloudinary-community/next-cloudinary/compare/v6.12.0...v6.13.0) (2024-09-13)

# [6.13.0](https://github.com/cloudinary-community/next-cloudinary/compare/v6.12.0...v6.13.0) (2024-09-13)

### Features

Expand Down
5 changes: 0 additions & 5 deletions next-cloudinary/.npmignore

This file was deleted.

15 changes: 10 additions & 5 deletions next-cloudinary/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
module.exports = api => {
const presets = []

if ( api.env('test') ) {
return {
presets: [['@babel/preset-env', {targets: {node: 'current'}}]],
}
presets.push([['@babel/preset-env', {targets: {node: 'current'}}]]);
}

return {};
};
presets.push(['@babel/preset-react', { runtime: 'automatic' }]);
presets.push(['@babel/preset-typescript']);

return {
presets
};
};
64 changes: 51 additions & 13 deletions next-cloudinary/package.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,78 @@
{
"name": "next-cloudinary",
"version": "6.16.0",
"version": "7.0.0-beta.10",
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"source": "src/index.ts",
"main": "dist/next-cloudinary.cjs.js",
"module": "dist/next-cloudinary.esm.js",
"exports": {
".": {
"types": {
"import": "./dist/next-cloudinary.cjs.mjs",
"default": "./dist/next-cloudinary.cjs.js"
},
"module": "./dist/next-cloudinary.esm.js",
"import": "./dist/next-cloudinary.cjs.mjs",
"default": "./dist/next-cloudinary.cjs.js"
},
"./package.json": "./package.json",
"./cld-video-player.css": "./dist/cld-video-player.css",
"./dist/cld-video-player.css": "./dist/cld-video-player.css",
"./cloudinary_icon_for_black_bg.svg": "./dist/cloudinary_icon_for_black_bg.svg",
"./dist/cloudinary_icon_for_black_bg.svg": "./dist/cloudinary_icon_for_black_bg.svg",
"./cloudinary_icon_for_white_bg.svg": "./dist/cloudinary_icon_for_white_bg.svg",
"./dist/cloudinary_icon_for_white_bg.svg": "./dist/cloudinary_icon_for_white_bg.svg"
},
"types": "./dist/next-cloudinary.cjs.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"build": "preconstruct build && tsx scripts/copy-assets.ts",
"dev": "preconstruct watch",
"prepublishOnly": "cp ../README.md . && cp ../LICENSE . && pnpm build",
"postpublish": "rm ./README.md && rm ./LICENSE",
"test": "vitest run",
"test:app": "NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=\"test\" pnpm build && cd tests/nextjs-app && npm install && npm run build",
"test:app": "NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=\"test\" pnpm build && cd tests/nextjs-app && pnpm build",
"test:watch": "vitest"
},
"dependencies": {
"@cloudinary-util/types": "1.5.10",
"@cloudinary-util/url-loader": "5.10.4",
"@cloudinary-util/util": "4.0.0"
"@cloudinary-util/types": "1.6.0",
"@cloudinary-util/url-loader": "6.0.0",
"@cloudinary-util/util": "4.1.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/preset-env": "^7.25.4",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@tsconfig/recommended": "^1.0.7",
"@types/node": "^22.0.2",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"dotenv": "^16.4.5",
"mkdirp": "^3.0.1",
"tsup": "^8.2.3",
"tsx": "^4.19.1",
"typescript": "^5.5.4",
"vitest": "^2.0.5"
},
"peerDependencies": {
"next": "^12 || ^13 || ^14 || >=15.0.0-rc || ^15",
"react": "^17 || ^18 || >=19.0.0-beta || ^19"
},
"preconstruct": {
"exports": {
"importConditionDefaultExport": "default",
"extra": {
"./cld-video-player.css": "./dist/cld-video-player.css",
"./dist/cld-video-player.css": "./dist/cld-video-player.css",
"./cloudinary_icon_for_black_bg.svg": "./dist/cloudinary_icon_for_black_bg.svg",
"./dist/cloudinary_icon_for_black_bg.svg": "./dist/cloudinary_icon_for_black_bg.svg",
"./cloudinary_icon_for_white_bg.svg": "./dist/cloudinary_icon_for_white_bg.svg",
"./dist/cloudinary_icon_for_white_bg.svg": "./dist/cloudinary_icon_for_white_bg.svg"
}
},
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
"importsConditions": true
}
}
}
80 changes: 0 additions & 80 deletions next-cloudinary/plugins/copy-assets.ts

This file was deleted.

78 changes: 78 additions & 0 deletions next-cloudinary/scripts/copy-assets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import path from 'path';
import { createWriteStream } from 'fs';
import { mkdirp } from 'mkdirp';
import https from 'https';

const PLAYER_VERSION = '1.11.1';

const assets = [
{
uri: `https://unpkg.com/cloudinary-video-player@${PLAYER_VERSION}/dist/cld-video-player.min.css`,
name: 'cld-video-player.css'
},
{
directory: 'fonts',
assets: [
`https://unpkg.com/cloudinary-video-player@${PLAYER_VERSION}/dist/fonts/cloudinary_icon_for_black_bg.svg`,
`https://unpkg.com/cloudinary-video-player@${PLAYER_VERSION}/dist/fonts/cloudinary_icon_for_white_bg.svg`,
]
}
];

let hasWrittenAssets = false;

async function copyAssets() {
const rootPath = path.join(__dirname, '../');
const distPath = path.join(rootPath, 'dist');

if ( hasWrittenAssets ) return;

await mkdirp(distPath);

for ( const asset of assets ) {
if ( typeof asset === 'string' || typeof asset.uri === 'string' ) {

let name = asset.name;
let uri = asset.uri;

if ( typeof asset === 'string' ) {
name = path.basename(asset);
uri = asset;
}

const writePath = path.join(distPath, name);
await downloadFile(uri, writePath);

console.log(`Wrote ${uri} to ${writePath}`);
} else if ( typeof asset.directory === 'string' ) {
await mkdirp(path.join(distPath, asset.directory));

for ( const dirAsset of asset.assets ) {
const writePath = path.join(distPath, asset.directory, path.basename(dirAsset));
await downloadFile(dirAsset, writePath);
console.log(`Wrote ${dirAsset} to ${writePath}`);
}
}
}

hasWrittenAssets = true;
}

/**
* downloadFile
*/

function downloadFile(assetUrl: string, writePath: string) {
return new Promise<void>((resolve) => {
const file = createWriteStream(writePath);
https.get(assetUrl, function(response) {
response.pipe(file);
file.on('finish', () => {
file.close();
resolve();
});
});
})
}

copyAssets();
Loading