I noticed I can use libman to download many libraries into my Asp.Net Core app in a nice way. E.g. I can easily get the latest #microsoft signalr:
However, in my application I can't rely on external package sources and would like to store the packages I need within my network.
I noticed that libman supports "filesystem" mode, so I copied all the files downloaded from unpkg onto my local network drive, let's call it "L:"
/ L:
| local_unpkg
| #microsoft
| signalr
| 5.0.2
| package.json
| README.md
| src
| ... // a lot of files
| dist
| browser
| cjs
| esm
| ... // other subfolders
When I try using "filesystem" provider, I get only the files in directly in the folder I specify, without nested folders:
Is there a way to import entire packages that way, without manually specifying all the subfolders in the libman.json file?
If not, what's the recommended approach for using the tool in an environment, when I don't want to rely on external package sources?
The filesystem provider specifically does not support recursive directory contents. With the other providers, the contents of the package are available all at once via the catalog metadata. But with file paths, and especially network file paths, iterating the file system can lead to extremely poor performance in large (or deep) directory structures. In many cases, you'd be typing out the path and the wizard would try to evaluate the contents as you type (e.g. once you typed L:\ it would recognize that directory and enumerate all its contents recursively, over the network).
I'm trying to make a project with a public folder inside. That folder is where the web server is pointing at, but I can't make PhpStorm to understand that and open in the built-in browser the correct URL.
I mean:
Project root
|-- app
|-- config
|-- core
`-- public (Web server root folder)
`-- index.php
I have a CSS file that I want to upload to npm. My project's folder structure is as follows:
my-project (folder)
|
+---- css (folder)
|
+---- my-project.css
|
+---- my-project.min.css
When I try to upload my project to NPM, it asks for an entry point, where the default is set to index.js. For my case where there are only 2 files inside a folder called css, what should it be? Moreover, what is the meaning of the entry-point for an npm project?
Entry point is a JavaScript file that gets called when your module is needed.
By common practice, it is usually given the name "app.js" or "index.js" (your case).
The entry point is also the path that will be used to access your module.
CSS files cannot be entry points.
I installed GPS and ADA and stated ready a couple of books ant looking at websites on Internet.
After doing a few of exercises, I transformed a couple to a local library since they where constantly used in further chapters.
I do not see (understand?) How I can setup a local library in the project file of the exercises.
Directory structure of my test environment:
The file Test01 uses Basic_IO and Test02 uses Both Basic_IO and the generic Basic_Stack.
Here is the project file for Test01:
Can someone explain to me how to get setup the lib so the program would compile and link?
The trick is to create seperate project files (.gpr files) for Basic_IO and Basic_Stack and reference these project files (using with) in your test project files. You might want to take a look on learn.adacore.com and in the GPRbuild user’s guide. I would also change the directory structure to (something like) this:
|
+-- learning_ada.gpr
|
+-- tests/
| |
| +-- test01/
| | |
| | +-- test01.gpr
| | +-- obj/
| | +-- src/
| | |
| | +-- test01.adb
| |
| +-- test02/
| |
| +-- test02.gpr
| +-- obj/
| +-- src/
| |
| +-- test02.adb
|
+-- shared/
|
+-- basic_io/
| |
| +-- basic_io.gpr
| +-- obj/
| +-- src/
| |
| +-- basic_io.ads
| +-- basic_io.adb
|
+-- basic_stack/
|
+-- basic_stack.gpr
+-- obj/
+-- src/
|
+-- basic_stack.ads
+-- basic_stack.adb
The "library" projects could (in your case) remain quite simple. As an example, for Basic_IO, I'm pretty sure that something like
basic_io.gpr
project Basic_IO is
for Source_Dirs use ("src");
for Object_Dir use "obj";
end Basic_IO;
could already work. This project can then be referenced from test01.gpr using
test01.gpr
with "..\..\shared\basic_io\basic_io.gpr";
project Test01 is
for Source_Dirs use ("src");
for Object_Dir use "obj";
for Main use ("test01.adb");
end Test01;
First of all, your library's gpr file should specify that it is a library, for example:
library project Some_Library_Name is
for Languages use ("Ada");
for Source_Dirs use ("src");
for Library_Name use "Some_Library_Name";
for Library_Version use "1.0.0";
end Some_Library_Name;
Next, you need to add a with Some_Library.gpr statement to your client's gpr file. There are three ways to do is, in order of increasing initial complexity but also long-term utility.
Relative dir (simplest)
You can with Some_Dir/Another_Dir/library.gpr specifying the directory from the client's gpr file to the library's gprfile. If this means going up with .. that qualifies as a rather pungent code smell.
Through GPR_PROJECT_PATH
To find the gprfile specified above, gprbuild will look in the current directory of the client gprfile, and in each directory given in GPR_PROJECT_PATH. You can find more information on this method in AdaCore's own documentation of this variable.
For instance, if you had C:/ada_projects or ~/ada_projects defined, and inside that were several libraries, you might add to your client.gpr file:
with Library_One/lib1.gpr
Or if you added each individual library's own directory to GPR_PROJECT_PATH, you would omit Library_One from the above.
If in resolving the with statement there are multiple matches, compilation will fail. (Thank you, Ada!)
Note this was previously called ADA_PROJECT_PATH, which still works but is deprecated.
Alire Ada package manager (most flexible)
There are some problems with the above; it requires you to set things per-machine (or per-user) which, when you add a new developer to your team or need to set up a new computer, you will quickly run into as your projects won't compile until that is done. Next, you will run into versioning problems because you never wrote down which version of said libraries you were building against. Finally, even if you meticulously record that and inform your development team, you will still run into problems when you return to an old project after creating some new ones, and you find you want to use two different versions of the same library, which isn't possible with this approach.
Alire solves this in a similar way to Rust's cargo, python's pip, C#'s NuGet, Haskell's stackage and no doubt many others, by placing the library inside your client's directory, adding each library's root to GPR_PROJECT_PATH, building the project, and then resetting the environment again. If you have an online environment and only want to use, not publish alire package, then you don't need to know the details, you just add with Project_File.gpr (without relative directory) and run alr build instead of gprbuild.
Alire makes you record the version you want of each library, and allows for multiple versions of the same library being used in different projects, and even indirectly in the same project; i.e. library1 and library2 refer to different versions of sublibrary_foo, and your client can now include both library1 and library2; if it needs sublibrary_foo, it must include it itself or specifically include the version under library1 or library2.
AdaCore is working on support in GNATStudio (the new name for GPS 20 and beyond), in the meantime you can just run alr build from the commandline.
See the official website for more about Alire.
I was trying to debug typescript with IntelliJ but I cannot get it working. I use webpack to build the typescript files and maps and only the compiled js is used in the page. I also use an external webserver, so I cannot use the build in IDEA webserver.
My structure looks as follows:
root
|-- compiled
|-- compiled.js
|-- compiled.js.map
|-- src
|-- file1.ts
|-- some_subfolder
|-- file2.ts
|-- ....
I setup a debug configuration for Javascript, installed the Chrome extension and did the path mappings. If I put a breakpoint into compiled.js, the breakpoint gets hit and I can debug. Breakpoints in my ts files are ignored though. I did mark the compiled folder as excluded as per documentation (it says the IDE will then autoload map files from these folders). As far as I can see there is no option to manually set a map file for the script file in the debug configuration.
Any ideas what I might be missing?