Include or Exclude node_modules with esbuild - visual-studio-code

I am using esbuild to build a vscode extension. The build gives a warning like:
✨ Done in 1.28s.
This extension consists of 7026 files, out of which 5430 are JavaScript files. For performance reasons, you should bundle your extension: https://aka.ms/vscode-bundle-extension . You should also exclude unnecessary files by adding them to your .vscodeignore: https://aka.ms/vscode-vscodeignore
DONE Packaged: /my-vscode/my-vscode-0.0.2.vsix (7026 files, 8.43MB)
I am not sure I node_modules need to be added to .vscodeignore ? when I tried doing it and installed the plugin, I get an error that my commands are not found ..
Any thoughts ?

Related

CMake under eclipse - locate linked files and libraries from other non-cmake projects

I got a following problem. We have a very silly git structure and guidelines, so my eclipse projects use linked files. I have to make google tests for the projects, and the only way I found it to work is to use cmake. However, the test files are not in workspace but in a git repository and only linked to eclipse project. I cant figure out how to make CMakeLists.txt to follow the files.... I tried using include_directories with either relative or absolute paths..
Errors I get:
mingw32-make.exe[2]: *** No rule to make target 'C:/Users/name/eclipse-
workspace/MyTestCmake/Solver_test.cpp', needed by 'CMakeFiles/Solver_test.dir/Solver_test.cpp.obj'. Stop.
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:164: CMakeFiles/Solver_test.dir/all] Error 2
mingw32-make.exe: *** [Makefile:145: all] Error 2
Another question is - one of the libraries is built without cmake. How can I specify the path to it, where the cmake should find it?
Current Cmakelists.txt:
cmake_minimum_required(VERSION 3.14)
project (RadiTestCmake)
include(FetchContent)
FetchContent_Declare(googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG release-1.12.1 )
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
include_directories(
"${PROJECT_BINARY_DIR}"
"${PROJECT_BINARY_DIR}/../../../../../../gitlocal/backend/tests/"
)
add_executable(
hello_test
hello_test.cc
Solver_test.cpp
)
target_link_libraries(
hello_test
GTest::gtest_main
)
include(GoogleTest)
gtest_discover_tests(hello_test)

node_modules not installed when running 'vsce package' command

I wrote a VSCode extension and am trying to publish it locally via vsce package. When I install my app through the VSIX file, there's no 'node_modules' folder inside my extension which leads to my extension not loading correctly because no modules are found
I have checked that my required dependencies are indeed inside dependencies and not peerDependencies or devDependencies. I should note that I have a .vscodeingore file containing the following:
.vscode/**
.vscode-test/**
out/test/**
src/**
.gitignore
vsc-extension-quickstart.md
**/tsconfig.json
**/tslint.json
**/*.map
**/*.ts
node_modules
webpack.config.js
I would like that my node_modules be installed and I would see a "node_modules" folder inside my './vscode/extensions/' folder.
Thanks!

How to run babel without inflating my package?

I added babel to my project with 2 presets (es2015 and stage-0) and it added 100+ MB of dependencies to my node_modules folder.
Would it be possible to package only my transpiled code without babel dependencies, using a system-wide babel-cli? I tried installing this way but it errors:
Couldn't find preset "es2015" relative to directory "."

CMAKE FILE(COPY... adding permission not in FILE_PERMISSIONS list

To complete an install on Ubuntu necessitates adding postinst and prerm scripts to the package built with CMAKE. Adding the script files using SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA... was the easy part, however, when an install is attempted, Lintian complains about the quality of the package, specifically, the file permissions for postinst and prerm are not set properly to 755. After a considerable amount of searching for an answer one was found using FILE(COPY and setting the FILE_PERMISSIONS to OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE (755) before setting CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA. Now Lintian is still complaining about the package quality only this time the file permissions are set to 775 which includes GROUP_WRITE but that is not in the FILE_PERMISSIONS list. It is unclear how this is possible. The relevant snippet of CMAKE is posted below:
FILE(COPY ${installation_add_ins}/linux/postinst_in DESTINATION ${installation_add_ins}/linux/postinst
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
FILE(COPY ${installation_add_ins}/linux/prerm_in DESTINATION ${installation_add_ins}/linux/prerm
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${installation_add_ins}/linux/postinst;${installation_add_ins}/linux/prerm;")
What's even more interesting is that if "Ingnore and install" is selected, the package works as expected. Ubuntu's package manager appears to fixup the file permissions and both install and uninstall work properly. But this fact is not relevant to the question.
Why is GROUP_WRITE being set on the resultant file when it is not specified in the permissions?

What is the difference between building C++ Builder project from IDE and command line?

I have different behaviour of compiler, when building project from IDE and from command-line, which I can not explain.
The detailed issue's description is rather big, but it's really simple.
I have a C++ Builder project, which has a PAS-file included (IncludeUnits.pas). This pas-file has several units and inc-files listed. These files are located in separate folders and these folders are listed in library&include paths in project's options.
Folders layout:
C:\Demo\Bin
C:\Demo\Project
C:\Demo\Project\CBuilder5
C:\Demo\Project\Common
C:\Demo\Source
C:\Demo\Source\Common
Bin is output folder, Project/CBuilder5 holds project (bpr-file), Project/Common holds included pas-file (IncludeUnits.pas), Source and Source/Common hold other files (pas&inc). I think that it's pretty usual layout.
C:\Demo\Project\Common\ IncludeUnits.pas :
unit IncludeUnits;
interface
uses
Test;
implementation
end.
C:\Demo\Source\ Test.pas :
unit Test;
interface
{$I Test.inc}
implementation
end.
C:\Demo\Source\Common\ Test.inc :
// this file is empty
If I compile this project from C++ Builder IDE - it will compile fine. C++ Builder IDE doesn't have any additional paths in IDE settings set.
Now, I want to compile it from command-line. First, I issue
bpr2mak.exe MyProject.bpr
command.
This command creates MyProject.mak file, where I can see all paths ("....\Source" and "....\Source\Common" are the paths in question):
...
INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;..\Common;..\..\Source;..\..\Source\Common
LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;..\Common;..\..\Source;..\..\Source\Common
...
Now, I run make command:
make.exe -B -f"MyProject.mak"
It gives me the following output:
C:\PROGRA~1\Borland\CBUILD~2\BIN\dcc32 -N2....\Bin -N0....\Bin -$Y+ -$W -$R -v -JPHNE -M -UC:\PROGRA~1\Borland\CBUILD~2\bin..\include;C:\PROGRA~1\Borland\CBUILD~2\bin..\include\vcl;..\Common;..\..\Source;..\..\Source\Common -D_DEBUG;_RTLDLL;NO_STRICT -OC:\PROGRA~1\Borland\CBUILD~2\bin..\include;C:\PROGRA~1\Borland\CBUILD~2\bin..\include\vcl;..\Common;..\..\Source;..\..\Source\Common --BCB ..\Common\IncludeUnits.PAS
Borland Delphi Version 13.0 Copyright (c) 1983,99 Inprise Corporation
C:\Demo\Project\Common\IncludeUnits.pas(1) C:\Demo\Project\Common\IncludeUnits.pas(1) C:\Demo\Project\Common\IncludeUnits.pas(1) C:\Demo\Project\Common\IncludeUnits.pas(6) C:\Demo\Source\Test.pas(1) C:\Demo\Source\Test.pas(5) Fatal: File not found: 'Test.inc'
As you can see - all search path is passed to compiler and the file (Test.inc) is all here - in that Source\Common folder. But still compiler can't find it?
Of course, I run both commands from folder with bpr-file. And changing paths to absolute doesn't help.
Copying Test.inc from Source\Common to Source will help. Changing {$I Test.inc} to {$I Common\Test.inc} will also help.
Why? It seems that I'm missing something. Remember: project have no problems with compiling from IDE, Test.inc is found without copying or changing declaration. Did I miss some switch to make or dcc32?
I found the reason: command line for dcc32 misses -I switch, which specifies paths for include files.
For some reason, bpr2mak doesn't respect this option. Fortunately, it allows you to specify alternate template for conversion bpr -> mak. I edited default template and added "-I" option to it, pass new template to bpr2mak - and it worked.