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

Use npm file: protocol to link @kustom/Samples dependency #32

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

shama
Copy link
Contributor

@shama shama commented Jan 18, 2023

When running the samples/run.sh script, I hit a permission error because npm link was trying to link into my global module location. Instead if the file: protocol is used in the package.json, it will have the same effect linking the local dependency but avoid potential permission issues.

24 actionable tasks: 6 executed, 18 up-to-date
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/@kustom
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@kustom'
npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@kustom'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules/@kustom'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

With this change, all the tests are running and passing for me:

found 0 vulnerabilities
✅   Generics: generics interface re-typed
✅   Generics: generics interface re-typed
✅   Generics: generics interface re-typed
✅   Generics: generics interface re-typed
✅   Exceptions: TS can interact with an object containing an Exception
✅   Exceptions: Kotlin can interface with an object containing an Exception
✅   Exceptions: Kotlin can retrieve the stacktrace from the exception
✅   MixingAnnotations: Retrieve data from a @JsExport class
✅   MixingAnnotations: Retrieve data from a @KustomExport class
✅   ValueClass: value class can wrap String
✅   ValueClass: value class can wrap Long
✅   ValueClass: value class can wrap Long
✅   CollectionMapping: mapping for List<Long>
✅   FunctionTypes: mapping for function types
✅   BasicTypeMapping: mapping for Boolean
✅   BasicTypeMapping: mapping for Byte
✅   BasicTypeMapping: mapping for Short
✅   BasicTypeMapping: mapping for Int
✅   BasicTypeMapping: mapping for Float
✅   BasicTypeMapping: mapping for Double
✅   BasicTypeMapping: mapping for String
//TODO: Typed arrays
✅   BasicTypeMapping: mapping for Any
✅   LongMapping: mapping for Long (2147483647)
✅   LongMapping: mapping for Long (4294967295)
✅   Enum: can consume enums in Kotlin code
✅   Enum: values() contains 4 items
✅   Enum: values() contains NORTH
✅   Enum: valueOf(NORTH) -> NORTH
✅   Enum: valueOf(UP) is null
✅   Enum: export doesn't duplicate wrappers
✅   Top-level function: is supported
✅   Top-level function: suspend is supported
✅   Coroutines: execute Kotlin coroutines
✅   Coroutines: execute Kotlin coroutines with 'then'
✅   Coroutines: parallel setTimeout
✅   Coroutines: reject throws an Error
✅   Coroutines: can cancel (timeout throw CancellationException)
✅   Coroutines: can cancel (work is aborted)
✅   Coroutines: can cancel Kotlin coroutines from Typescript (work has been cancelled and will never complete)
✅   EmptyClass: can instantiate
✅   SealedClass: Sealed class 1
✅   SealedClass: Sealed class 2
✅   SealedClass: Extended sealed class
✅   SimpleClass: can retrieve value
✅   Inherit: can instantiate
✅   Cascade: direct child
✅   Cascade: sub childs
✅   Statics: static factory can be used
✅   DataClass: created from Kotlin and Typescript are equals
✅   Cascade: direct child
✅   Cascade: sub childs

Thanks!

@glureau
Copy link
Collaborator

glureau commented Jan 18, 2023

Thanks for your PR! Not an expert on the package.json so I believe in you ;)

@glureau glureau merged commit 0726ff6 into deezer:master Jan 18, 2023
@shama shama deleted the npm-local-link branch January 18, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants