.NET Core project.json copyToOutput file in parent directory - asp.net-core

I need to include a file in my build output. This file is two folders above project.json. If I specify this using "../../", the config file is copied over, but to the wrong location. Instead of being copied over to /bin/Debug/net461, it's placed two folders higher in /bin.
How do I get a file in a parent directory to be copied over to actual output folder where the dlls are placed?
"buildOptions": {
"copyToOutput": { "includeFiles": [ "../../config.json" ] }
},

Try use this instead, it's tested way and working very well:
"buildOptions": {
"copyToOutput": "project.json",
"emitEntryPoint": true,
"preserveCompilationContext": true
}
You can use copy single file "copyToOutput":"name" or array "copyToOutput":["name1","name2"]. To copy directory need to use "copyToOutput":"name\\"

Related

vue.js / electron How to list all folder names in public folder

I'm quite new in the Vue / electron...
I need to list all folder names that are in the /public directory.
Inside of these folders may be other subfolders with .pdf files.
So far i try it with:
require.context('#/../public/pdf/moreFolders', true, /^.*\.*$/)
but this seems more for displaying files inside a folder.
In the end, I want to show a menu that has the tree structure of that public folder.
Any idea of how I can display such a structure in Vue?
You can list files and read the content simply by using nodejs modules:
const fs = require('fs')
...
If the build should contain those files you have to add an entry in the vue.config.js
module.exports = {
transpileDependencies: [
'vuetify'
],
pluginOptions: {
electronBuilder: {
builderOptions: {
...
extraFiles: [
{
from: './data',
to: 'data',
filter: [
'**/*'
]
But that is only needed, if you want to use another directory, I would suggest. Public is always copied, as I know.

"Cucumber Full Support" extension in VS code and I'm facing configuration issues

Issue:
-Curly lines are displayed in the feature file even when step definitions are available and properly mentioned in the settings.json file
-Go to step definitions and Peek Step definitions options aren't displayed
Expected behavior:
User should be displayed Curly lines only for steps which doesn't have step definitions
User should be able to Go to step definitions from feature files using "Go to Step definition" option on right click
Settings.json file:
{
"cucumberautocomplete.steps": ["stepDefinitions/*.ts"],
"cucumberautocomplete.syncfeatures": "featureFiles/*feature",
"cucumberautocomplete.strictGherkinCompletion": true,
"cucumberautocomplete.strictGherkinValidation": true,
"cucumberautocomplete.smartSnippets": true,
"cucumberautocomplete.stepsInvariants": true,
"workbench.iconTheme": "vscode-icons",
"files.autoSave": "afterDelay",
"cucumberautocomplete.customParameters": [
]
}
My Project structure:
-PROJECT NAME
-featureFiles
-features1.feature
-features1.feature
-stepDefinitions
-stepDefintions_1.ts
-stepDefintions_2.ts
-stepDefintions_3.ts
-pageObjects
-logs
-configFiles
-commonUtlities
-node_modules
-reports
-package.json
-ts-config.json
So this works for me. My settings.json file lives in the .vscode folder, which sits in the folder that I open in vscode (see image). The cucumberautocomplete.steps value is relative to this same folder.
I had the same problem. And, like you, I tried many variations of path.
Finally, only these settings worked for me:
"cucumberautocomplete.steps": [
"**/*.rb"
],
"cucumberautocomplete.syncfeatures": "**/*.feature",
"cucumberautocomplete.strictGherkinCompletion": true,
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": true
}

StencilJS: compile scss and copy to dist folder

My goal is to provide a css file in the distribution package which can be used by the consumer if needed.
For that I would like to create a kind of global scss file, but I want to avoid that this style is attached to each component + it also won't be used directly by the components. So for that I would like to create my-style.scss file somewhere in the /src folder.
What would be the best way to compile this file to my-style.css and copy it to the dist folder?
It is possible to specify a global style with Stencil. Simply add the globalStyle property to your stencil.config.js and provide the entry scss file. Your config should look something like this:
const sass = require('#stencil/sass');
exports.config = {
namespace: 'my-component-lib',
outputTargets:[
{
type: 'dist'
},
{
type: 'www',
serviceWorker: false
}
],
globalStyle: 'src/globals/app.scss',
plugins: [
sass()
]
};
exports.devServer = {
root: 'www',
watchGlob: '**/**'
}
The build will successfully compile the scss to dist/my-component-lib.css.
From the docs: https://stenciljs.com/docs/config/#copy
The copy config is an array of objects that defines any files or
folders that should be copied over to the build directory. Each object
in the array must include a src property which can be either an
absolute path, a relative path or a glob pattern. The config can also
provide an optional dest property which can be either an absolute
path or a path relative to the build directory. Also note that any
files within src/assets are automatically copied to www/assets for
convenience.
In the copy config below, it will copy the entire directory from
src/docs-content over to www/docs-content.
Within stencil.config.ts:
copy: [
{ src: 'docs-content' }
]
For example I am copying my css file from src to the build directory and it's totally standalone, e.g. https://github.com/BlazeUI/blaze/blob/master/packages/atoms/stencil.config.ts#L14

dotnet pack - defining output folders

I'm using dotnet pack to create a nuget package for a .net core project but have 2 issues:
The .nupkg file when inspected always has a lib folder which contains the contents of the project's bin folder. Can you prevent the lib folder from being created in the output?
In the project.json packOptions how do you map an include folder to an output directory? I've tried using the mappings property as detailed below to output the contents of the publish directory into the wwwroot directory below but no luck so far.
"packOptions": {
"files": {
"include": [
"publish"
],
"mappings": {
"wwwroot": "publish"
}
}
},
I was unable to remove the lib folder but the mapping works with slight modifications to the example above as displayed below:
"packOptions": {
"files": {
"include": [
"publish"
],
"mappings": {
"wwwroot/": "publish/"
}
}
}

#import in less file being compiled twice

Here is my problem. In my css directory I have a less directory that holds page.less, and search.less. Inside page.less I am using the import method to render my search styles when grunt complies my less files. I end up with page.css. In page.css the search styles are being added twice even though inside the page.less file I am only importing it in one place
My gruntfile.js is as follows
less: {
options: {
compress: false,
ieCompat: false
},
dev: {
dest: "css/page.css",
src: [
"css/less/*"
]
}
},
The pattern src: ["css/less/*"] is compiling all files.
This pattern should only include files that are not imported into other files, otherwise you will be including file B (which imports file A) and file A itself - again.
In compass-sass the underscore is used to identify files being imported into others, while "main" files (which import others) have no underscore.