Compiling Reason source files to the same directory as the source files - reason

I'm writing a node application, where I would like to mix Reason and raw JavaScript.
This section in the bucklescript documentation describes it
When user has an existing JS project, it makes sense to output the JS
file in the same directory as vanilla JS, the schema added a key
called in-source so that generate JS file next to ML file.
I assume that this is in the bsconfig.json file? But what value should the key have? The schema documentation does not mention this option.
I'm running Bucklescript version 1.9.1 - so the functionality should be available (available since 1.9.0).
How do I use the in-source option?
My bsconfig.json file looks like this:
{
"name": "re-server",
"version": "0.1.0",
"bsc-flags": ["-bs-super-errors"],
"in-source": true, // I tried adding the key here
"sources": [{
"dir": "src",
"in-source": true // I tried adding the key here
}
],
"bs-dependencies" : [
"bs-express"
]
}

It should be in the "package-specs" section:
{
...
"package-specs" : [{
"module": ...,
"in-source": true
}]
}
So your bsconfig.json should look like:
{
"name": "re-server",
"version": "0.1.0",
"bsc-flags": ["-bs-super-errors"],
"package-specs" : [{
"module": "commonjs",
"in-source": true
}],
"sources": [{
"dir": "src"
}
],
"bs-dependencies" : [
"bs-express"
]
}

Related

VS Code: Add single file (README) to multi-root workspace

You can configure a vs-code multi-root workspace to include several folders. Eg,
{
"folders": [
{
// Source code
"name": "Product",
"path": "vscode"
},
{
// Docs and release notes
"name": "Documentation",
"path": "vscode-docs"
},
{
// Yeoman extension generator
"name": "Extension generator",
"path": "vscode-generator-code"
}
]
}
I would also like to include a README file from a root directory that pertains to all those folders. Is there a way to do this?

How to add configurations to user to a VSCode extension

I am trying to add a simple configuration to my VSCode extension, but I can't find the correct information.
I just want that the user have a string input field, that has a default value, and read it from my typescript code through the vscode library
Can someone provide me and example about which file should I add, where, and how to consume? also if more configurations are needed.
Thanks!
Ok, found
I need to add into my package.json
...
"contributes": {
"commands": [
...
],
"configuration": {
"title": "My Extension",
"properties": {
"myExtension.myProperty": {
"type": "string",
"default": "default",
"description": "description"
}
}
}
},
and consume
vscode.workspace.getConfiguration('myExtension').myProperty;

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

Using a different .eslintrc config file for typescript and javascript in VSCode?

I have a project with both JS and TS files (and JSX/TSX). I have a separate .eslintrc.json file for JS vs. TS. I'd like to be able to tell VSCode which eslint config file to use depending on the file extension.
Tried putting the settings in settings.json under the [typescript] field but that didn't work.
I think it should be possible to use 1 file and overrides option:
.eslintrc.js
module.exports = {
"root": true,
"plugins": ["#typescript-eslint"],
"rules": {
// JavaScript rules
},
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"parser": "#typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": [
"#typescript-eslint"
],
"rules": {
// TypeScript rules
}
}
]
}
And changing workspace settings:
"eslint.validate": [
{
"language": "typescript",
"autoFix": true
},
{
"language": "typescriptreact",
"autoFix": true
}
]

How to use a library on SAPWebIDE

i am trying to use the openui5-googlemaps library, but the WebIDE looks at a different path than my SAP-System then the app is deployed.
libs: ["sap.m", "sap.ui.layout", "sap.ushell", "openui5.googlemaps"],
my SAP-System looks at path resources/openui5/googlemaps.
However this does not work in the WebIDE.
Any ideas why and how i can fix it?
Thanks
Either change the path, or load via your index.
API With Example
In Index
~ update may 2017 ~
You can now use the manifest to add libraries:
"resources": {
"css": [
{
"uri": "css/style.css"
},
{
"uri": "css/croppie.css"
}
],
"js": [
{
"uri": "library/croppie.min.js"
}
]