TFS Task plugin upload exception and create warning on console - azure-devops

Getting exception and warning while uploading and package extension of Build Task.
I make a build task plugin i use below manifest file
{
"id": "sample-custom-build-task",
"type": "ms.vss-distributed-task.task",
"description": "Adds sample type Build Task",
"targets": [
"ms.vss-distributed-task.tasks"
],
"properties": {
"name": "buildtask"
}
}
Buildtask is a folder in home directory that contains node_modules,task.json,tsconfig,package.json and task image file.
tsConfig.json is look like this.
{
"compilerOptions":
{
"target": "es6",
"module": "commonjs",
"lib": ["es2015"],
"allowJs": true,
"checkJs": true,
"sourceMap": true,
"removeComments": true,
"strict": true,
"noImplicitAny": false,
"moduleResolution": "node",
"typeRoots": ["node_modules/typings"],
"types": ["node"]
},
"exclude": [
"**/node_modules/*",
"/NodeExecutor.ts"
],
"enableAutoDiscovery":true
}
Whenever i package my plugin there is some warning on console.
Refer image
and upload an extension show this error
Strange, for me, in past i make build task plugin but no error and warning whenever i add node_modules in my package it gave me error.
What i going to wrong, i add whole build task folder in my manifest file.
Thanks in advance.

Remove "addressable": true code for BuildTask:
"files": [
{
"path": "logo.png",
"addressable": true
},
{
"path": "BuildTask"
}
]
Also, the BuildTask folder should contains task.json file.

Related

yo #theia/plugin gives error TS1005 ',' expected and others

I was looking for developing my own theia plugin. First, I want to try the simple "Hello World" plugin with the command yo #theia/plugin.
Yeoman command to generate Theia plugin
I develop with Ubuntu 20.04. I get many TypeScript errors as we can see in the following image.
Errors with yeoman commands
I tried to figure out by myself. I installed many tsc versions, but nothing worked. I've readed the Prerequisites first and installed every dependencies.
I understand that the TypeScript version may not be the good one, but not sure which one and why.
Here are some versions I use:
yarn: 1.22.19
node: v16.14.2
tsc: 3.1.3
Here is the tsconfig file that was autogenetared with yo command:
{
"compilerOptions": {
"strict": true,
"experimentalDecorators": true,
"noUnusedLocals": true,
"emitDecoratorMetadata": true,
"downlevelIteration": true,
"module": "commonjs",
"moduleResolution": "node",
"target": "es6",
"lib": [
"es6",
"webworker"
],
"sourceMap": true,
"rootDir": "src",
"outDir": "lib",
"skipLibCheck": true
},
"include": [
"src"
]
}
Here is the package.json:
{
"name": "hello",
"publisher": "theia",
"keywords": [
"theia-plugin"
],
"version": "0.0.1",
"license": "none",
"files": [
"src"
],
"activationEvents": [
"*"
],
"devDependencies": {
"#theia/plugin": "next",
"#theia/plugin-packager": "latest",
"rimraf": "2.6.2",
"typescript-formatter": "7.2.2",
"typescript": "3.5.3"
},
"scripts": {
"prepare": "yarn run clean && yarn run build",
"clean": "rimraf lib",
"format-code": "tsfmt -r",
"watch": "tsc -watch",
"compile": "tsc",
"build": "yarn run format-code && yarn run compile && theia-plugin pack"
},
"engines": {
"theiaPlugin": "next"
},
"theiaPlugin": {
"backend": "lib/hello-backend.js"
}
}
I changed nothing from the yo command
I am a little lost as why it happens. Can everyone help me out?
I was expecting the yo and yarn commands to be successful.

NestJS/VSCode Debugging not working in domain code

I have an app that is written in NestJS that I have inherited. When I try to debug the app using nest start --debug I am having trouble hitting breakpoints.
The odd thing is, if I put a breakpoint in my main.ts file, it hits it just fine. It's once the project has loaded up all the controllers, modules and the like that I cannot hit the breakpoints in the various .ts files. If I load up one of the .js files from my dist folder, I can breakpoint them, but everytime I stop and restart, I have to delete the contents of my dist folder. If i don't I get a TS5055 error about not being able to overwrite files.
Here's the tsconfig.json I have:
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"watch": true,
"allowJs": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": false,
},
"exclude": ["apminsightdata", "devops", "node_modules"]
}
The apminsightdata is because of site24x7 integration and devops is where I keep documents and SQL for our other teams to run when deploying.
add this configuration in the launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch app",
"type": "node",
"request": "launch",
"args": [
"src/main.ts"
],
"runtimeArgs": [
"-r",
"ts-node/register",
"-r",
"tsconfig-paths/register"
],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart",
"env": {
"NODE_ENV": "local",
"NODE_PORT": "3000"
},
"sourceMaps": true,
"console": "internalConsole",
"outputCapture": "std"
}
]
}
no need to config luangch.json
Open Vscode, and enter CTRL+SHIFT+P, select Toggle auto attach, choose always
Click the code line you want to debug
npm run start
It will hit the line you want to debug

VS code extension dependencies not being deployed when debugging?

Running Visual Studio Code 1.52.1.
I created a simple VS Code extension as described in this tutorial. Then I added a dependency as shown below. The problem is that this dependency does not seem to get deployed when debugging.
package.json
"dependencies": {
"#types/markdown-table": "^2.0.0"
}
And the actual import looks like this:
import * as table from 'markdown-table'
Then I hit F5 just as described in the linked tutorial. When my registered command is run, I get the following error message:
Activating extension 'undefined_publisher.hello-world' failed: Cannot
find module 'markdown-table'
For completeness, here is the generated tsconfig.json:
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": [
"es6"
],
"sourceMap": true,
"rootDir": "src",
"strict": true
},
"exclude": [
"node_modules",
".vscode-test"
]
}
Should be able to add a preLaunchTask.
For Example in .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"preLaunchTask": "npm: build"
}
]
}

sources assets files in js-debug missing with visual studio code on Apache Royale

I use visual studio code and setup it following theses instructions :
https://github.com/apache/royale-asjs/wiki/Visual-Studio-Code
Everythings worked fine.
For now I deleted bin folder in main project, and when launch debug, then bin and js-debug and others stuffs are right generated, but my assets dir with used jpg are not copied.
For exemple in the code I use <j:Image src="assets/logo.png" percentHeight="100"/> but the is no assets/logo.png in js-debug. So I must copy it manualy...
Here is my asconfig.json :
{
"compilerOptions": {
"targets": [
"JSRoyale"
],
"theme": "${royalelib}/themes/JewelTheme/src/main/resources/defaults.css",
//"html-template": "src/main/resources/jewel-example-index-template.html",
"source-map": true,
"source-path": [
"src"
],
},
"files":
[
"src/main/royale/App.mxml"
]
}
and tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"type": "actionscript",
"clean": true,
"problemMatcher": []
},
{
"label": "build",
"type": "actionscript",
"debug": true,
"problemMatcher": []
}
]
}
Could someone tell me how to copy assets folder automatically ?
thanks
Regards
Add to your asconfig.json file:
"copySourcePathAssets": true

Duplicate Identifier 'Map' in ionic

I have the following error suddenly happens
Typescript Error
Duplicate identifier 'Map'.
/node_modules/#types/googlemaps/index.d.ts
Tried this way but it wasnt fixed
ionic 2 Duplicate identifier 'export='
my tsconfig file looks like below
{
"compilerOptions": {
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"declaration": false,
"sourceMap": true,
"noUnusedParameters": false,
"lib": [
"dom",
"es2015"
]
},
"types": [
"jasmine"
],
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
],
"compileOnSave": false,
"atom": {
"rewriteTsconfig": false
},
"awesomeTypescriptLoaderOptions": {
"forkChecker": true,
"useWebpackText": true
}
}
ionic -v 3.2.0
Check the section on #types, typeRoots and types
in tsconfig.json docs.
Because you have included
"types": [
"jasmine"
],
Typescript will only pick jasmine type declarations. You should add googlemaps to the array as well.
"types": [
"jasmine",
"googlemaps
],
Or remove the types array from tsconfig.json as typescript is configured to look at #types from node_modules by default.
Check this answer for further information.