I have been going by this tutorial
http://yizeng.me/2017/05/20/add-typescript-support-to-ruby-on-rails-a-quick-and-hacky-example/
And all working great.
Now tsconfig is looking like this
{
"compilerOptions": {
"outFile": "app/assets/javascripts/generated/welcome.js",
"noImplicitAny": true,
"noEmitOnError": true,
"sourceMap": true,
"target": "es5"
},
"files": [
"app/assets/javascripts/welcome.ts"
]
}
But as I see in tsconfig file I have outfile and files. How I can set all files with .ts extension in files. And How I can make it to compile not in one outfile?
UPDATE
I tried to write it like this
"files": [
"app/**/*.ts"
]
But I get this error
error TS6053: File '/Users/admin/Documents/GitHub/falco-web/app/**/*.ts' not found.
File is under this path
app/assets/javascripts/welcome.ts
Related
I have an electron app which I would like to automatically update and to do that I am using electron-updater. It seems all the working parts are together but I cannot have the Release Notes. Here's my script to package and upload it to S3.
"package": "electron-builder build --publish always",
And here's my build
"mac": {
"category": "my.category.app",
"target": [{
"target": "dmg",
"arch": [
"arm64",
"x64"
]
}, {
"target": "zip",
"arch": [
"arm64",
"x64"
]
}],
"type": "distribution",
"hardenedRuntime": true,
"gatekeeperAssess": false,
"publish": {
"provider": "s3",
"bucket": "my-bucket-name",
"publishAutoUpdate": true
}
},
Now when I run the package, it packages the app and uploads it in my S3 bucket. I can see that all the zip, dmg and blockmap files for both x64 and arm64 are already uploaded and in addition to them, I also have the latest-mac.yml file.
When I run the app on dev, I can see that it recognizes that there is an update available and it downloads it automatically and when it is already downloaded, I can see that there is no release notes in the latest-mac.yml file. But I would like to have that as well so I can display it to my users before they accept to install it.
Any idea how to do that? Really appreciate it.
When I extract the app.asar inside the builded Mac app with:
npx asar extract app.asar destfolder
I can see that it includes mostly everything which is in my project folder.
How can I exclude the files from app.asar?
This are parts of my package.json: (because its too much code for stackoverflow)
"directories": {
"buildResources": "resources"
},
"extraResources": [
"./content/**",
"settings.json",
{
"from": "resources/icon.png",
"to": ""
},
{
"from": "resources/${os}",
"to": "../"
},
{
"from": "binaries/${os}",
"to": "binaries",
"filter": [
"**/*"
]
}
]
This is my project folder:
And this is the content of the builded app.asar file:
It seems I have to exclude every folder I dont want in the app.asar in the build section of the package.json like this:
"build": {
"files": [
"!binaries/**/*",
"!mac-build/**/*"
],
I'm cresting electron app using node-canvas.
I generated an app-installer by the following command:
$ electron-builder --mac --x64 --config ./build_mac.js
build_mac.js
const config = {
"appId": "jp.maplat.editor",
"asarUnpack": [
"assets/mac/canvas"
],
"directories": {
"output": "dist"
},
"files": [
"assets/mac",
"backend",
"css",
"frontend/dist",
"html",
"img",
"locales",
"package.json",
"package-lock.json",
"tms_list.json"
],
"afterSign": "script/notarize/notarize.js",
"mac": {
"icon": "assets/mac/icon_mac.icns",
"target": [
"dmg"
],
"hardenedRuntime": true,
"gatekeeperAssess": false,
"entitlements": "script/notarize/entitlements.mac.plist",
"entitlementsInherit": "script/notarize/entitlements.mac.plist",
},
"win": {
"icon": "assets/win/icon_win.ico",
"target": "nsis"
},
"nsis":{
"oneClick": false,
"allowToChangeInstallationDirectory": true
}
};
module.exports = config;
But after installing the electron app, the app outputs following error message on web console:
Uncaught Error: dlopen(/Applications/MaplatEditor.app/Contents/Resources/app.asar.unpacked/assets/mac/canvas/build/Release/canvas.node, 1): Library not loaded: /usr/local/opt/pixman/lib/libpixman-1.0.dylib
Referenced from: /Applications/MaplatEditor.app/Contents/Resources/app.asar.unpacked/assets/mac/canvas/build/Release/canvas.node
Reason: no suitable image found. Did find:
/usr/local/opt/pixman/lib/libpixman-1.0.dylib: code signature in (/usr/local/opt/pixman/lib/libpixman-1.0.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
How to solve this?
I think there are 2 issues,
How to sign this dylib?
This dylib looks installed under "/usr/local/opt", it is out of the application folder. Is this correct expected behavior?
Does anyone have the answer for this?
The solution to fix this is put all dylibs (except under "/usr/lib" or "/System/Library/Frameworks") under the folder which is in under control of electron.
Something like this in my project:
https://github.com/code4history/MaplatEditor/tree/master/assets/mac/canvas/build/Release
But just putting dylib is not working, because each dylib has information about link to other libraries.
You can check which libraries are linked from each dylib by using "otool" command, and youcan overwrite it by using "install_name_tool" command.
https://github.com/code4history/MaplatEditor/blob/master/mac_canvas_dylib
In this URL, you can find what I did for my project.
While running "ng build" or "ng build --prod" there is no dist/out-tsc folder and even if i create one the folder remains empty. Although ng serve works fine and the site loads.
I want to host this site but without the output folder it is worthless.
ts-config.json is as below:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"node_modules/#types"
],
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
}
}
Note: the project was generating all the required files until last week but stopped doing it all of a sudden.
I have also tried creating a new project and building it the result is same i.e. no out-tsc folder.
You can solve this issue in two ways.
Method 1
Update outputPath in angular.json
"prefix": "app",
"architect": {
"build": {
"builder": "#angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/out-tsc",
"index": "src/index.html",
"main": "src/main.ts",
Method 2
Use the following command for production build
ng build --prod --output-path=dist/out-tsc/
I've tested both methods for your code. Both are working fine.
I'm trying to achieve a copy tool to move the PDF file to a different folder than the compiled one.
The idea behind this is to have the main tex files in a cloud base folder (onedrive), but prevent to generate all the files in OneDrive (because it sync the generated files...).
So I tried to make a new tool. But unfortunatly, it isn't working. Can someone help me with this ?
I'm on Windows 10.
I tried with copy (but it isn't a known command). So I tried with xcopy. It seems to find the command, but it tells that the number of parameters are wrong....
{
"name": "copyPDF",
"command": "xcopy",
"args": [
"%TMPDIR%/%DOCFILE%.pdf",
"%DIR%/PDF/%DOCFILE%.pdf",
"/y",
]
}
I've just tried to do the exact same thing.
It took me longer than I'd like to admit and it might be too late for your request, but it can help possible future visitors.
This is my settings.json:
"latex-workshop.latex.recipes": [
{
"name": "latexmk ➞ copyPDF",
"tools": ["latexmk", "copyPDF"]
}
],
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"-outdir=%OUTDIR%",
"%DOC%"
],
"env": {}
},
{
"name": "copyPDF",
"command": "cmd.exe",
"args": [
"/c",
"copy",
"%OUTDIR%\\%DOCFILE%.pdf",
"%DIR%",
],
"env": {}
},
],
Had some problems with rheinert.leon's answer, mainly because of spaces in the filenames. Here's a a powershell tool version that accounts for that:
"latex-workshop.latex.tools": [
{
"name": "copyPDF",
"command": "powershell.exe",
"args": [
"copy '%OUTDIR%\\%DOCFILE%.pdf' %DIR%"
],
"env": {}
}
...
],