Global deno.json configuration file? - deno

I want to apply this deno.json configuration file to all my deno projects:
{
"fmt": {
"options": {
"indentWidth": 4
}
}
}
Is there a way to globally apply this configuration so I don't have to have this deno.json file in every project?
I'm using VSCode, Ubuntu and Deno 1.28.1.

Because of the way that the Deno VS Code extension overrides/suppresses the built-in TS language server, it is not advised to enable the extension globally: this would cause problems in every non-Deno TypeScript project.
That said, you can create a single deno.json(c) file at a high-level location in your filesystem — for example: in your home directory. To use a concrete example location — on Linux — /home/your_username/deno.json.
Then, when configuring a new VS Code project, you only need to configure the location of the config file in .vscode/settings.json in order for the extension to use it:
{
"deno.enable": true,
"deno.config": "/home/your_username/deno.json"
}
When using Deno in the CLI, it will automatically walk your filesystem and find the nearest parent config file. From the manual:
Since v1.18,
Deno will automatically detect deno.json or deno.jsonc configuration file if
it's in your current working directory (or parent directories).
Regardless of the above, this strategy is not advised: a better approach might be to simply to create a personal CLI script/function which will generate a new deno config and VS Code config from a template that you create. This way, each of your projects maintains its own configuration data (a good thing) and you also don't have to manually configure each new one because you did the work once to create the template generation script (win-win).

Related

Can Premake package a project?

I have a Premake 5 project that builds a static library (primarily via the gmake2 or vs2017 actions). I'd like to create a build target for the release material itself: the library zipped up with some text and header files.
How do I do this with Premake? I tried something like:
project "thing_export"
kind "Utility"
os.mkdir "Release"
-- etc
...but of course the os... functions are executed when Premake runs, they don't end up in the build files.
I also tried using custom build commands:
project "thing_export"
kind "Utility"
buildmessage "Creating release"
buildcommands { "{copy} README.md '%{prj.location}'" }
buildoutputs { "'%{prj.location}/README.md'" }
The makefile generated by the gmake or gmake2 actions is the same as for an empty project. No actions are generated for it.
How can I use Premake to create my releases?
Depending on what you need to do, you might be able to make that approach work. What I usually do (and what Premake itself does) is write a Lua script to automate the release packaging, and use a custom Premake action to run it.
Have a look at Premake's package.lua script to see how it automates the packaging. And here is the custom action that calls package.lua:
newaction {
trigger = "package",
description = "Creates source and binary packages",
execute = function ()
include (path.join(corePath, "scripts/package.lua"))
end
}

The output directory is under your source tree in meteor

how do I solve this
The output directory is under your source tree
warning:the output directory is under your source tree
your generated files may get interpreted as source code
consider building into a different directory instead meteor build ../output
I apologize for my ignorance on this matter, I am new in the world of programming and meteor. about my case. 1. I have a folder on Desk called “Findme” where I have the structure of my project (the code and everything which forms the application which works) 2. Then through the console I access that directory findme and then run the command meteor build/Desktop/MyApp --server = https: //findme.com, and start downloading. 3. But inside the console I also get the message indicated before and when it is finished, and I check the folder MyApp, it is empty. 4. And when I check the Findme folder it has created a folder named ~ and inside displays a file called Desktop/MyApp but it also doesn’t have any useful files, only winrar and nothing useful. 5. I am trying to generate the apk, could you please let me know what I might be doing wrong? Is there another way to generate the apk? I would appreciate it if you could help me!
Your should specify a path for where to build your application that is outside of your project directory.
Otherwise this can lead to problems with Meteor's file watcher and as your error already pointed out:
your generated files may get interpreted as source code consider
building into a different directory instead
So if your command uses a relative path, as used in meteor build ../output then it is important to call this command at the most upper project folder.
Consider the following project structure:
/myapp
/client
/import
/server
If you call meteor build ../output from within /myapp it will generate the output folder as expected outside of the project:
/output
/myapp
/client
/import
/server
However if you call it from within a subfolder, say /myapp/imports it may generate the output within the project like so:
/myapp
/client
/import
/output
/server
So keep this in mind when building your app.
Further readings:
https://guide.meteor.com/deployment.html#custom-deployment
https://docs.meteor.com/commandline.html#meteorbuild

Set sbt options in build.sbt

I'm working on an SBT project that has to be built with the options like:
-Xmx2G -Xss256M -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled
This means that every new developer has to read the readme and assign the options to SBT_OPTS in bash profile or put them in the sbtopts file. Similarly, this has to be configured on Jenkins and this applies to all the projects (so if someone wants to use -XX:+UseG1GC with other projects it becomes an issue). Is it possible to specify the required options in the build file itself? This seems logical to me, as the options are project-specific and without them, you cannot build the project.
Create a .sbtopts file at the root of the build with contents:
-J-Xmx2G
-J-Xss256M
-J-XX:+UseConcMarkSweepGC
-J-XX:+CMSClassUnloadingEnabled

How to use Laravel 5 with Gulp, Elixir and Bower?

I am completely new to all this, 'Bower' and 'Gulp' and Laravel 'Elixir'. I purchased a template that uses them (unfortunately) and now I need some help on how to go about implementing them. I have already installed NPM and Bower. All my packages have been downloaded into:
resources > assets > vendor
This is a screenshot:
Now my question is how do I include all those packages I downloaded in my view? From my understanding I can't run less files directly in the browser, it only runs once due to 'browser caching' or something like that, also the JS scripts are just too many to include in my page.
I want a way where I can work on my files and have them automatically compiled with the compiled files being referenced in my app.php file.
This is a link to the GulpJS file included in my template: http://pastebin.com/3PSN6NZY
You do not need to compile every time someone visits. The compiled sass/js should be run in dev and then the output files referenced.
If you have gulp installed on the project, you should see a gulp.js file in the root of your project. If not, visit here for instructions:
Gulp/Elixer installation and setup
In your gulp.js file:
var elixir = require('laravel-elixir');
elixir(function(mix) {
mix.less([
'app.less',
'normalize.less',
'some-other-less.less',
'and-another.less'
]);
mix.scripts(['app.js', 'some-other-js.js'], 'public/js/output-file.js');
});
While in development you can run gulp watch from the command line to listen for changes and run compile tasks when it hears a change. Then you simply reference the output files in the public directory as you normally would.
If you don't want to listen, you can just run the gulp command for a single once-off task run.
The docs are pretty straight forward and can be found here:
Gulp/Elixer docs

Run a task when any file in given directory is changed in SBT?

Is there a way to run a task on every code change in a given directory? Preferably, something that works well with ~ operator in SBT so that I could do:
~jadeCompile
to run custom jadeCompile task.
Take a look at the documentation for triggered execution. You can configure the watched directory using the watchSources setting. This is a bit trickier as only Scala source files will be watched by default, so we need to specify an appropriate path finder:
watchSources <++= baseDirectory map { path =>
((path / "src/main/jade") ** "*.jade").get }
The watchSources setting is not scoped, so you will need to watch all sources at once. Then you just have to run:
~jadeCompile

Resources