-
Notifications
You must be signed in to change notification settings - Fork 70
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
Migrate from Rollup
to preconstruct
for bundling
#1933
base: yarn-to-pnpm
Are you sure you want to change the base?
Changes from all commits
60570fe
7ae4997
9ed2f35
6d0f60a
fa9ecad
94a8f7e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,8 @@ | |
"postinstall": "./scripts/postinstall.sh", | ||
"clean": "rm -rf coverage; manypkg exec rimraf lib dist node_modules; rm -rf node_modules", | ||
"commit": "git-cz", | ||
"build": "pnpm --recursive run build", | ||
"build": "pnpm preconstruct build", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This builds what's configured below. |
||
"check-gh-auth-token": "if [[ -z \"${GITHUB_AUTH}\" ]]; then echo \"Need to set GITHUB_AUTH\" && exit 1; fi", | ||
"build:typings": "NODE_ENV=production pnpm --recursive run build:typings", | ||
"lint": "jest --projects jest.eslint.config.js jest.flow.config.js", | ||
"lint:js": "jest --config jest.eslint.config.js", | ||
"test": "cross-env NODE_ENV=development jest --config jest.test.config.js", | ||
|
@@ -74,7 +73,7 @@ | |
"@commitlint/cli": "19.7.1", | ||
"@commitlint/config-conventional": "12.1.4", | ||
"@manypkg/cli": "0.23.0", | ||
"@rollup/plugin-alias": "5.1.1", | ||
"@preconstruct/cli": "2.8.11", | ||
"@types/jest": "26.0.24", | ||
"@types/node": "10.17.60", | ||
"@types/node-fetch": "2.5.12", | ||
|
@@ -119,19 +118,24 @@ | |
"prettier": "2.4.1", | ||
"resolve": "1.22.10", | ||
"rimraf": "3.0.2", | ||
"rollup": "4.34.9", | ||
"rollup-plugin-babel": "4.4.0", | ||
"rollup-plugin-commonjs": "10.1.0", | ||
"rollup-plugin-includepaths": "0.2.4", | ||
"rollup-plugin-json": "4.0.0", | ||
"rollup-plugin-node-globals": "1.4.0", | ||
"rollup-plugin-node-resolve": "5.2.0", | ||
"rollup-plugin-replace": "2.2.0", | ||
"rollup-plugin-uglify": "6.0.4", | ||
"rollup-watch": "4.3.1", | ||
"streamtest": "2.0.0", | ||
"ts-jest": "26.5.6", | ||
"tsconfig-replace-paths": "0.0.14", | ||
"typescript": "4.5.2" | ||
}, | ||
"preconstruct": { | ||
"packages": [ | ||
"packages/api-request-builder", | ||
"packages/http-user-agent", | ||
"packages/sdk-auth", | ||
"packages/sdk-client", | ||
"packages/sdk-middleware-auth", | ||
"packages/sdk-middleware-correlation-id", | ||
"packages/sdk-middleware-http", | ||
"packages/sdk-middleware-logger", | ||
"packages/sdk-middleware-queue", | ||
"packages/sdk-middleware-user-agent", | ||
"packages/sync-actions" | ||
Comment on lines
+128
to
+138
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are all packages which are configured as SDKs and were prior built with Rollup. |
||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,15 @@ | |
"bugs": "https://github.com/commercetools/nodejs/issues", | ||
"license": "MIT", | ||
"author": "Nicola Molinari <[email protected]> (https://github.com/emmenko)", | ||
"main": "dist/api-request-builder.cjs.js", | ||
"module": "dist/api-request-builder.es.js", | ||
"browser": "dist/api-request-builder.umd.js", | ||
"main": "dist/commercetools-api-request-builder.cjs.js", | ||
"module": "dist/commercetools-api-request-builder.esm.js", | ||
"umd:main": "dist/commercetools-api-request-builder.umd.min.js", | ||
"preconstruct": { | ||
"entrypoints": [ | ||
"./index.js" | ||
], | ||
"umdName": "commercetoolsApiRequestBuilder" | ||
}, | ||
Comment on lines
+22
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The naming change is transparent to users it follows the preconstruct and general community standards. |
||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/commercetools/nodejs.git" | ||
|
@@ -30,7 +36,6 @@ | |
"dist" | ||
], | ||
"scripts": { | ||
"build": "pnpm build:bundles", | ||
"build:bundles": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js -n CommercetoolsApiRequestBuilder -i ./src/index.js" | ||
"build": "exit 0;" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,11 +17,20 @@ | |
"bugs": "https://github.com/commercetools/nodejs/issues", | ||
"license": "MIT", | ||
"author": "Nicola Molinari <[email protected]> (https://github.com/emmenko)", | ||
"main": "dist/http-user-agent.cjs.js", | ||
"module": "dist/http-user-agent.es.js", | ||
"browser": "dist/http-user-agent.umd.js", | ||
"typings": "./dist/typings/index.d.ts", | ||
"types": "./dist/typings/index.d.ts", | ||
"main": "dist/commercetools-http-user-agent.cjs.js", | ||
"module": "dist/commercetools-http-user-agent.esm.js", | ||
"browser": { | ||
"./dist/commercetools-http-user-agent.cjs.js": "./dist/commercetools-http-user-agent.browser.cjs.js", | ||
"./dist/commercetools-http-user-agent.esm.js": "./dist/commercetools-http-user-agent.browser.esm.js" | ||
}, | ||
"typings": "./dist/commercetools-http-user-agent.cjs.d.ts", | ||
"types": "./dist/commercetools-http-user-agent.cjs.d.ts", | ||
"preconstruct": { | ||
"entrypoints": [ | ||
"./index.ts" | ||
], | ||
"umdName": "commercetoolsHttpUserAgent" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/commercetools/nodejs.git" | ||
|
@@ -31,8 +40,6 @@ | |
], | ||
"scripts": { | ||
"prebuild": "rimraf dist/**", | ||
"build": "pnpm build:bundles && pnpm build:typings", | ||
"build:bundles": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js -n CommercetoolsHttpUserAgent -i ./src/index.ts", | ||
"build:typings": "tsc -p tsconfig.declarations.json --emitDeclarationOnly --declarationDir dist/typings" | ||
"build": "exit 0;" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
type HttpUserAgentOptions = { | ||
name: string | ||
version?: string | ||
libraryName?: string | ||
libraryVersion?: string | ||
contactUrl?: string | ||
contactEmail?: string | ||
name: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Otherwise this is a syntax error. |
||
version?: string; | ||
libraryName?: string; | ||
libraryVersion?: string; | ||
contactUrl?: string; | ||
contactEmail?: string; | ||
} | ||
|
||
/* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,15 @@ | |
"bugs": "https://github.com/commercetools/nodejs/issues", | ||
"license": "MIT", | ||
"author": "Jan Juna <[email protected]> (https://github.com/junajan)", | ||
"main": "dist/sdk-auth.cjs.js", | ||
"module": "dist/sdk-auth.es.js", | ||
"browser": "dist/sdk-auth.umd.js", | ||
"main": "dist/commercetools-sdk-auth.cjs.js", | ||
"module": "dist/commercetools-sdk-auth.esm.js", | ||
"umd:min": "dist/commercetools-sdk-auth.umd.js", | ||
"preconstruct": { | ||
"entrypoints": [ | ||
"./index.js" | ||
], | ||
"umdName": "commercetoolsSdkAuth" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just the function name in the UMD bundle. |
||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/commercetools/nodejs.git" | ||
|
@@ -30,8 +36,7 @@ | |
], | ||
"scripts": { | ||
"prebuild": "rimraf dist/**", | ||
"build": "pnpm build:bundles", | ||
"build:bundles": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js -n CommercetoolsSdkAuth -i ./src/index.js" | ||
"build": "exit 0;" | ||
}, | ||
"dependencies": { | ||
"@commercetools/sdk-middleware-http": "^8.0.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,15 @@ | |
"bugs": "https://github.com/commercetools/nodejs/issues", | ||
"license": "MIT", | ||
"author": "Nicola Molinari <[email protected]> (https://github.com/emmenko)", | ||
"main": "dist/sdk-client.cjs.js", | ||
"module": "dist/sdk-client.es.js", | ||
"browser": "dist/sdk-client.umd.js", | ||
"main": "dist/commercetools-sdk-client.cjs.js", | ||
"module": "dist/commercetools-sdk-client.esm.js", | ||
"umd:min": "dist/commercetools-sdk-client.umd.js", | ||
"preconstruct": { | ||
"entrypoints": [ | ||
"./index.js" | ||
], | ||
"umdName": "commercetoolsSdkClient" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/commercetools/nodejs.git" | ||
|
@@ -30,7 +36,6 @@ | |
], | ||
"scripts": { | ||
"prebuild": "rimraf dist/**", | ||
"build": "pnpm build:bundles", | ||
"build:bundles": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js -n CommercetoolsSdkClient -i ./src/index.js" | ||
"build": "exit 0;" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,15 @@ | |
"bugs": "https://github.com/commercetools/nodejs/issues", | ||
"license": "MIT", | ||
"author": "Nicola Molinari <[email protected]> (https://github.com/emmenko)", | ||
"main": "dist/sdk-middleware-auth.cjs.js", | ||
"module": "dist/sdk-middleware-auth.es.js", | ||
"browser": "dist/sdk-middleware-auth.umd.js", | ||
"main": "dist/commercetools-sdk-middleware-auth.cjs.js", | ||
"module": "dist/commercetools-sdk-middleware-auth.esm.js", | ||
"umd:min": "dist/commercetools-sdk-middleware-auth.umd.js", | ||
"preconstruct": { | ||
"entrypoints": [ | ||
"./index.js" | ||
], | ||
"umdName": "commercetoolsSdkMiddlewareAuth" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/commercetools/nodejs.git" | ||
|
@@ -31,10 +37,10 @@ | |
], | ||
"scripts": { | ||
"prebuild": "rimraf dist/**", | ||
"build": "pnpm build:bundles", | ||
"build:bundles": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js -n CommercetoolsSdkMiddlewareAuth -i ./src/index.js" | ||
"build": "exit 0;" | ||
}, | ||
"dependencies": { | ||
"@commercetools/sdk-middleware-http": "^8.0.0", | ||
"node-fetch": "^2.6.7" | ||
}, | ||
"devDependencies": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,15 @@ | |
"bugs": "https://github.com/commercetools/nodejs/issues", | ||
"license": "MIT", | ||
"author": "Tobias Deekens <[email protected]> (https://github.com/tdeekens)", | ||
"main": "dist/sdk-middleware-correlation-id.cjs.js", | ||
"module": "dist/sdk-middleware-correlation-id.es.js", | ||
"browser": "dist/sdk-middleware-correlation-id.umd.js", | ||
"main": "dist/commercetools-sdk-middleware-correlation-id.cjs.js", | ||
"module": "dist/commercetools-sdk-middleware-correlation-id.esm.js", | ||
"umd:min": "dist/commercetools-sdk-middleware-correlation-id.umd.js", | ||
"preconstruct": { | ||
"entrypoints": [ | ||
"./index.js" | ||
], | ||
"umdName": "commercetoolsSdkMiddlewareCorrelationId" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/commercetools/nodejs.git" | ||
|
@@ -31,7 +37,6 @@ | |
], | ||
"scripts": { | ||
"prebuild": "rimraf dist/**", | ||
"build": "pnpm build:bundles", | ||
"build:bundles": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js -n CommercetoolsSdkMiddlewareCorrelationId -i ./src/index.js" | ||
"build": "exit 0;" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,15 @@ | |
"bugs": "https://github.com/commercetools/nodejs/issues", | ||
"license": "MIT", | ||
"author": "Nicola Molinari <[email protected]> (https://github.com/emmenko)", | ||
"main": "dist/sdk-middleware-http.cjs.js", | ||
"module": "dist/sdk-middleware-http.es.js", | ||
"browser": "dist/sdk-middleware-http.umd.js", | ||
"main": "dist/commercetools-sdk-middleware-http.cjs.js", | ||
"module": "dist/commercetools-sdk-middleware-http.esm.js", | ||
"umd:min": "dist/commercetools-sdk-middleware-http.umd.js", | ||
"preconstruct": { | ||
"entrypoints": [ | ||
"./index.js" | ||
], | ||
"umdName": "commercetoolsSdkMiddlewareHttp" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/commercetools/nodejs.git" | ||
|
@@ -30,8 +36,7 @@ | |
], | ||
"scripts": { | ||
"prebuild": "rimraf dist/**", | ||
"build": "pnpm build:bundles", | ||
"build:bundles": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js -n CommercetoolsSdkMiddlewareHttp -i ./src/index.js" | ||
"build": "exit 0;" | ||
}, | ||
"devDependencies": { | ||
"abort-controller": "3.0.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,15 @@ | |
"bugs": "https://github.com/commercetools/nodejs/issues", | ||
"license": "MIT", | ||
"author": "Nicola Molinari <[email protected]> (https://github.com/emmenko)", | ||
"main": "dist/sdk-middleware-logger.cjs.js", | ||
"module": "dist/sdk-middleware-logger.es.js", | ||
"browser": "dist/sdk-middleware-logger.umd.js", | ||
"main": "dist/commercetools-sdk-middleware-logger.cjs.js", | ||
"module": "dist/commercetools-sdk-middleware-logger.esm.js", | ||
"umd:min": "dist/commercetools-sdk-middleware-logger.umd.js", | ||
"preconstruct": { | ||
"entrypoints": [ | ||
"./index.js" | ||
], | ||
"umdName": "commercetoolsSdkMiddlewareLogger" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/commercetools/nodejs.git" | ||
|
@@ -30,7 +36,6 @@ | |
], | ||
"scripts": { | ||
"prebuild": "rimraf dist/**", | ||
"build": "pnpm build:bundles", | ||
"build:bundles": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js -n CommercetoolsSdkMiddlewareLogger -i ./src/index.js" | ||
"build": "exit 0;" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,15 @@ | |
"bugs": "https://github.com/commercetools/nodejs/issues", | ||
"license": "MIT", | ||
"author": "Nicola Molinari <[email protected]> (https://github.com/emmenko)", | ||
"main": "dist/sdk-middleware-queue.cjs.js", | ||
"module": "dist/sdk-middleware-queue.es.js", | ||
"browser": "dist/sdk-middleware-queue.umd.js", | ||
"main": "dist/commercetools-sdk-middleware-queue.cjs.js", | ||
"module": "dist/commercetools-sdk-middleware-queue.esm.js", | ||
"umd:min": "dist/commercetools-sdk-middleware-queue.umd.js", | ||
"preconstruct": { | ||
"entrypoints": [ | ||
"./index.js" | ||
], | ||
"umdName": "commercetoolsSdkMiddlewareQueue" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/commercetools/nodejs.git" | ||
|
@@ -30,7 +36,6 @@ | |
], | ||
"scripts": { | ||
"prebuild": "rimraf dist/**", | ||
"build": "pnpm build:bundles", | ||
"build:bundles": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js -n CommercetoolsSdkMiddlewareQueue -i ./src/index.js" | ||
"build": "exit 0;" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed anymore.