-
Notifications
You must be signed in to change notification settings - Fork 27
Works as a Node module #144
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
base: master
Are you sure you want to change the base?
Conversation
| "engines": { | ||
| "node": ">=12.10.0", | ||
| "npm": ">=5.6.0", | ||
| "yarn": "Yarn is disabled for this project, use npm instead" |
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.
Don't ever do this ever again. It doesn't just prevent local npm install from using yarn, but it prevents all users of your package from using yarn.
| "yarn": "Yarn is disabled for this project, use npm instead" | ||
| "npm": ">=5.6.0" | ||
| }, | ||
| "babel": {}, |
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.
At least in the version of Babel this project uses, this was interfering with downstream configs; since it doesn't define a config for the package itself, it tries to go up to configs for the parent project, which will fail since you're using an old version of babel.
| @@ -1,9 +1,11 @@ | |||
| /* global URL */ | |||
| import version from 'version' | |||
| import pkgJson from '../package.json' | |||
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.
This builds to the same code with optimisations enabled but doesn't require webpack as an intermediary, meaning that the entire module can be bundled into another webpack bundle with source maps intact.
| "name": "zendesk_app_framework_sdk", | ||
| "version": "2.0.33", | ||
| "main": "lib/zendesk-app-framework-sdk.js", | ||
| "main": "lib/index.js", |
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.
This was just wrong before
|
+1, short of Zendesk publishing as a Node module, this got my app working |
|
While #172 may have temporarily enabled importing this as a module, the introduction of $ pnpm add https://github.com/zendesk/zendesk_app_framework_sdk --save-dev
../../../Library/pnpm/store/v3/tmp/_tmp_51495_28b55e3e0bf988cb1edb299d770fa32d [[email protected]]: Running npm-install script, failed in 11.2s
...1495_28b55e3e0bf988cb1edb299d770fa32d npm-install$ npm install
│ npm warn deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
│ npm warn deprecated [email protected]: Critical bug fixed in v3.0.1, please upgrade to the latest version.
│ npm warn deprecated [email protected]: Please update to ini >=1.3.6 to avoid a prototype pollution issue
│ npm warn deprecated [email protected]: Critical bug fixed in v3.0.1, please upgrade to the latest version.
│ npm warn deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
│ npm warn deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
│ npm warn deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
│ npm warn deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
│ npm warn deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
│ npm warn deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
│ npm warn deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
│ npm warn deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
│ npm warn deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
│ npm warn deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
│ npm warn deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
│ npm warn deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
│ npm warn deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
│ npm warn deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
│ npm warn deprecated [email protected]: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
│ npm warn deprecated [email protected]: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
│ npm warn deprecated [email protected]: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
│ > [email protected] prepare
│ > npm run snyk-protect
│ > [email protected] snyk-protect
│ > snyk protect
│ Authentication failed. Please check the API token on https://snyk.io
│ npm error code 2
│ npm error path /Users/demo/Library/pnpm/store/v3/tmp/_tmp_51495_28b55e3e0bf988cb1edb299d770fa32d
│ npm error command failed
│ npm error command sh -c npm run snyk-protect
│ npm error A complete log of this run can be found in: /Users/demo/.npm/_logs/2024-12-05T15_10_06_233Z-debug-0.log
└─ Failed in 11.2s at /Users/demo/Library/pnpm/store/v3/tmp/_tmp_51495_28b55e3e0bf988cb1edb299d770fa32d
ERR_PNPM_PREPARE_PACKAGE Failed to prepare git-hosted package fetched from "https://codeload.github.com/zendesk/zendesk_app_framework_sdk/tar.gz/0a86f34fae4e184f62218df70f06a4116bc83ca5": [email protected] npm-install: `npm install`
Exit status 2CC @etanxing Even when logged into a snyk account, the build fails. Moreover, I suspect it even wouldn't work for you guys, since: |
✌️
/cc @zendesk/vegemite
Description
Your code does not properly work as a Node.js module. Now, even though it's not published to NPM, you can at least include the git repository as a node.js dependency and it will work.
Tasks
References
DevQA Steps
NOTE: DevQA steps are to be actioned only once code has been reviewed and approved.
Risks
Rollback Plan