In the following project:
https://github.com/MarcinMoskala/AnkiMarkdown
When I push a package to NPM, it seems empty. No binary code. I do export a single class:
https://github.com/MarcinMoskala/AnkiMarkdown/blob/master/src/jsMain/kotlin/AnkiConnectorJs.kt
In the build/packages/js I have all the files I need, they are just not included in the final package.
Related
I'm building a Kotlin multiplatform library. One of the targets in this project is javascript. In the source set I have added a dependency like this:
val jsMain by getting {
dependencies {
implementation(npm("libphonenumber-js", "1.10.13"))
}
}
The gradle sync was successful, now I want to import the files in jsMain directory. How can I achieve this?
Add npm dependency with generateExternals as you already did
implementation(npm("libphonenumber-js", "1.10.13", generateExternals = true))
generateExternals = true triggers a tool called Dukat that generates Kotlin external declarations from the Typescript definition file of that npm module.
Once your project syncs, it would have externals folder under your shared module's build folder like shown below,
(Ignore kmp-lib-1621 in above image. That would be your module/library name instead)`
Now copy and paste these files in your project (jsMain source set) and remove generateExternal = true from your dependency otherwise it would generate this files everytime. (1) you would lose any manual change (2) if you update the library version then it can potentially break your project
You should be able to call generated external code from Kotlin code, whether you keep it in build folder or you pasted it in your project code.
Important Note: Dukat tool is experiemental and known to create externals that may not work 100% times. So remove all unnecessary code from external generated code so you only end up having few references of classes you want to use from the npm library. Do some trial and error and you would be fine.
Hope this helps!
You have to use js(IR) backend and generate externals
implementation(npm("libphonenumber-js", "1.10.13", generateExternals = true)).
I built a dbt package for internal use. I'd like to specify the seed configurations in the dbt_project.yml of that package, and have those configurations apply to all projects that use the package. So far, I'm not sure if there's an issue with my syntax or if this just isn't possible.
The package dbt_project.yml includes the following:
seeds:
seed_name:
+quote_columns: false
+column_types:
column_name: varchar(127)
In a project that uses this package, there is a file data/seed_name.csv. When I run dbt seed for that project, I want the configuration defined in the package to apply to this seed. Instead, it seems to be ignored. To be clear, the .csv is included in the project that uses the package, not in the package itself.
It works if I move the above code out of the package and into the project-specific dbt_project.yml. However, this would mean that anyone using my package needs to copy that code into their file, which I'd prefer to avoid.
I have a repository that contains three python packages: a main package, and two addon packages, with shared documentation. Each project is in its own directory, with its own setup.py, as so:
Repository
Main Project
setup.py
Addon One
setup.py
Addon Two
setup.py
Documentation
RST files, RTD conf, etc.
Previously, I was using setuptools.find_packages() to build my packages, but was having issues with the contents of the packages bleeding together, as they shared namespaces. So I switched to specifying the packages I wanted to build, such as
packages=["Main Package"]
However, this broke my ReadTheDocs auto-build, where I had specified
- method: setuptools
path: Main Project
in .readthedocs.yml, with RTD now complaining my package (inside the Main Project directory) doesn't exist, as it attempts to build it.
In my project, I use a script to build the packages, where I move into each directory, run its setup, then move out. Works fine, my packages and documentation all build locally. However, it looks like RTD is only using the defined path to prepend my setup.py script, and therefore not finding the source package as the working directory is the parent directory (but I could be wrong!).
I've read through the documentation, including https://github.com/readthedocs/readthedocs.org/issues/4354 where the feature was originally added, but I have not been able to find a solution myself yet.
How can I tell RTD to change directory before building the packages, or is there an alternative approach that will support my repo structure?
Repository in question is here.
I found a solution:
I changed my local build script to use the root project directory, as per-RTD. I then added the directive package_dir={"": "[directory]"} to the setuptools.setup() calls in each project's setup.py.
I have created an npm library but I don't want to publish it in the public repository (So I cannot use #typings npm package to put my typings there). On the other side, I don't want to put .d.ts file into that package but wanted to publish another package called lib-typings.
Is it possible to consume lib-typings for a library called lib in Typescript 2?
As cartant said, property typeRoots in tsconfig.json is for addressing this problem.
I want to parse pdf document to be indexed by Lucene using pdfbox package. The required class LucenePDFDocument which is in org.apache.pdfbox.examples.lucene.LucenePDFDocument package. But in the jar file I have not found it. So, my java program is not getting compiled.
Kindly help!!!
The answer of the question goes as follows...
Previously before pdfbox version 1.7.1, org.apache.pdfbox.examples package was included but there is no package as examples.lucene.LucenePDFDocument.
From 1.7.1 there is no org.apache.pdfbox.examples package.
So, in order to use LucenePDFDocument class in your application, one has to compile the source and make a jar and use it in the application. In the source there is a example package directory. So, example package will be included once compiled from source.