Passing targets in as a dependency and making sure they output something useful and meaningful to be consumed by next target - monorepo

I am trying to get a plugin to use run-commands and I want it to run and execute a dependent task and pass the result to my command. In this case, I want to have a dependent target start up a webserver and keep it running.
I have tried to do the following and nx graph shows the right DAG but I am not seeing the output I want.
"executor": "nx:run-commands",
"options": {
"command": "./my-cli-tool --arg={frontendApp:serve}"
},
"dependsOn": [
"frontendApp:serve"
]
I know that in a monorepo tool like bazel, passing around the target like //frontendApp:serve would do what I am expecting here so I am guessing there should be a way to do this in nx.
Update: To help with debugging.
If the dependency is running, it is failing silently. I can run it individually, e.g. npx nx run frontendApp:serve. I can't see the port starting up and being taken so if something is happening, its happening silently.

dependsOn configuration looks a little different. It's in the docs here:
https://nx.dev/reference/project-configuration#dependson
Basically, you need have a local target which invokes the target in the other project.
{
"foo": {
"executor": "nx:run-commands",
"options": {
"command": "./my-cli-tool --arg={frontendApp:serve}"
},
"dependsOn": ["serve"]
},
"serve": {
"executor": "nx:run-commands",
"options": {
"command": "nx run frontendApp:serve"
}
}
}
Another option is to use Angular DevKit's allOf or concat executors for running multiple things at once:
"serve-with-graphql": {
"executor": "#angular-devkit/architect:allOf",
"options": {
"targets": [
{
"target": "web:serve"
},
{
"target": "graphql:dev-server"
}
]
}
},
https://github.com/angular/angular-cli/blob/main/packages/angular_devkit/architect/builders/builders.json#L14-L23
allOf runs each target at the same time
concat runs them serially

Related

How to debug unconverted source code correctly in react18 jest unit test?

Environment:react18 source code, win10 , node v16.13.1
I'm using jest tests inside the source code to explore the react18 source code,but jest use babel to convert source code, when i debug jest unit test,it will jump to babel's converted code,it is hard to read,
So I want to ask is there any way to debug on the source code,not the converted code?
for Example:
when i debug it,it will be converted
Even in some places,It's almost unreadable:
i want to debug unconverted source code correctly in react18 jest unit test.
here is my vscode lanuch.json config:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest Current File",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"${fileBasenameNoExtension}",
"--config",
"./scripts/jest/config.source.js",
"--runInBand"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"env": {
"NODE_ENV": "development"
},
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
}
}
]
}
i found in 'preprocessor.js' file , it contain babel configuration
so,we just add global item process.env.JEST_ENABLE_SOURCE_MAPS : inline.

Uploading appx from electron builder to Windows Store giving Invalid package identity name ... (expected: XXXAppName)

I'm trying to upload an appx file generated by electron builder to the windows store.
Unfortunately I'm now receiving the following error:
Invalid package identity name: Teselagen.OpenVectorEditor (expected: 56560Teselagen.OpenVectorEditor)
Invalid package family name: Teselagen.OpenVectorEditor_6fpmqnhnq2nc4 (expected: 56560Teselagen.OpenVectorEditor_6fpmqnhnq2nc4)
I'm not sure where those weird numbers are coming from or why that would be expected. Here's what my electron builder settings look like:
"build": {
"appx": {
"identityName": "Teselagen.OpenVectorEditor",
"publisher": "CN=D373F92F-3481-433F-9DC5-0BE55DE5500D",
"publisherDisplayName": "Teselagen",
"applicationId": "OpenVectorEditor",
"displayName": "OpenVectorEditor"
},
"win": {
"target": "appx"
},
Does anyone know how to get around this or why those weird numbers would be expected. Thanks so much!
Ok.. after troubleshooting for quite a long time.. the following finally worked for me:
"build": {
"appx": {
"identityName": "56560Teselagen.OpenVectorEditor", //I changed this to include the identityName that was generated for me
"publisher": "CN=D373F92F-3481-433F-9DC5-0BE55DE5500D",
"publisherDisplayName": "Teselagen",
"applicationId": "OpenVectorEditor", //need to include this otherwise it will default to the identityName which will break because applicationId isn't allowed to start with numbers
"displayName": "OpenVectorEditor"
},
"win": {
"target": "appx"
},
Originally I didn't realize that an identityName had been generated for me when I created a submission on the windows developer page. You can find your identityName here:

Visual Studio 2019 debug embedded targets. How to force VS to not treat it as a windows executable

I am trying to set up Cmake ARM uC (STM32) embedded project in the VS 2019.
Project buils OK but I struggle to start the debug session.
I have amended launch.vs.json
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"type": "cppdbg",
"name": "GCEC-FW.elf",
"project": "out\\build\\IoT-Debug\\GCEC-FW.elf",
"projectTarget": "",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}\\BUILD\\${workspaceRootFolderName}.elf",
"MIMode": "gdb",
"externalConsole": true,
"inheritEnvironments": [
"gcc_arm"
],
"miDebuggerPath": "${env.gccpath}\\bin\\arm-none-eabi-gdb.exe",
"setupCommands": [
{
"text": "-environment-cd ${workspaceRoot}/BUILD"
},
{
"text": "-file-exec-and-symbols ${workspaceRootFolderName}.elf",
"description": "load file",
"ignoreFailures": false
},
{
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"visualizerFile": "${debugInfo.linuxNatvisPath}",
"showDisplayString": true,
"miDebuggerServerAddress": "localhost:3333",
"launchCompleteCommand": "None",
"debugServerPath": "C:\\Program Files (x86)\Atollic\\TrueSTUDIO for STM32 9.3.0\\Servers\\J-Link_gdbserver\\JLinkGDBServerCL.exe",
"debugServerArgs": "-port 2331 -s -CPU Cortex-M -device STM32F427II -endian little -speed 4000 -vd -swoport 2332",
"serverStarted": "GDB\\ server\\ started",
"filterStderr": true,
"filterStdout": true
}
]
}
But when I try to start the debug session I am getting error stating that my .elf file is not an win32 executable (which is actually correct - it is not).
The question is: what has to be done VS to start this session?
edit
I needed to change the name when adding appending the new microcontroller debug configuration.
"name": "GCEC-FW.elf"
Now it complains about the path to the gdb.
The new question is: can I output or see build variables in VisualStudio - Like
${workspaceRootFolderName} or ${env.gccpath}
Regarding "... can I output or see build variables in VisualStudio - Like: ${workspaceRootFolderName} or ${env.gccpath}
To display all of the currently available macros, in the Property
Pages dialog, under VC++ Directories, choose the drop-down arrow at
the end of a property row. Click on Edit and then in the edit dialog
box, choose the Macros button. The current set of properties and
macros visible to Visual Studio is listed along with the current value
for each. For more information, see the Specifying User-Defined Values
section of C++ project property page reference.
More here about that.

Babel Snippets for ReactJS not working in sublime text

I edited my key bindings because the only trigger that would work inside the editor is when I type rcc. Was hoping that when I type cdm, it will work. This is the package I installed - https://github.com/babel/babel-sublime-snippets
{
"keys": ["ctrl+shift+,"],
"command": "insert_snippet",
"args": {
"name": "Packages/Babel Snippets/react_wrap.sublime-snippet"
}
}
to this
{
"keys": ["ctrl+shift+,"],
"command": "insert_snippet",
"args": {
"name": "Packages/Babel Snippets/react_componentDidMount_(class).sublime-snippet"
}
}
For people who will encounter this in the future. I got it working. Part of the problem that confused me was that there was no documentation on what and how to add a snippet. There was an instruction for adding a keybinding for react_wrap. Normally when we see tons of snippet files, we would do the same thing, add config for each files.
I really didn't have to add the react_componentDidMount_(class).sublime-snippet. I was told to type cdm inside the class and it worked.
Make sure the current language selected is not javascript but javascript(Babel). If you don't have it, just install it from package manager. It's available by the name of Babel
Also you can set it the default language for some extensions like .jsx.

Atom custom language package not picking up file extensions or highlighting correctly

I'm trying to build a simple atom package that displays some filetypes associated with squarespace development in the correct highlighted way. Iv'e tried reading the docs and looking at related packages and mirroring mine off of theirs but it seems no matter what I do atom wont pickup that these file types have an associated language package installed, and when I manually apply my language it doesn't even highlight them correctly.
The associations I'm trying to build are
.block -> html
.region -> html
.list -> html
.item -> html
.conf -> json
.preset -> json
my package.json looks like
{
"name": "language-squarespace",
"version": "0.4.0",
"description": "Syntax Highlighting for SquareSpace files",
"repository": {
"type": "git",
"url": "https://github.com/blaketarter/language-squarespace"
},
"license": "MIT",
"engines": {
"atom": "*",
"node": "*"
}
}
and an example of one of my grammar files is
'filetypes': [
'block'
]
'name': 'block (squarespace)'
'patterns': [
{
'include': 'source.html'
}
]
'scopeName': 'source.block'
I feel like im missing something important because I based mine off of https://github.com/rgbkrk/language-ipynb and things seem to match.

Resources