Sublime text 3, Package Controll - cant install packages - ssl

I realized like a week ago that I cannot install any new packages via Package Control. I tried everything even reinstalling sublime, while cleaning all files /Library/Application Support/ everything. Still the same problem. Any ideas?
ignored packages updated to: ["Emmet", "Vintage"]
reloading settings Packages/User/Package Control.sublime-settings
reloading settings Packages/User/Preferences.sublime-settings
Package Control: Error downloading package. HTTP exception InvalidCertificateException (Host codeload.github.com returned an invalid certificate ([SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:548))) downloading https://codeload.github.com/sergeche/emmet-sublime/zip/master.
error: Package Control
Unable to download Emmet. Please view the console for more details.
ignored packages updated to: ["Vintage"]
reloading settings Packages/User/Package Control.sublime-settings
reloading settings Packages/User/Preferences.sublime-settings
reloading settings Packages/User/Preferences.sublime-settings

You can change the precedence of the downloader in ~/.config/sublime-text-3/Packages/User/Package Control.sublime-settings.
"downloader_precedence":
{
"linux":
[
"urllib",
"curl",
"wget"
],
"osx":
[
"curl",
"urllib"
],
"windows":
[
"wininet"
]
},
Changing urllib to curl has worked for me.

For OSX:
bhanu's answer is correct but my "Package Control Settings - User" file was not at that exact location. More general instructions:
Open Command Palette (Cmd+Shift+P on Mac)
Type Package Control Settings
Open 'Package Control Settings - Default' and search for downloader_precedence
It probably looks like this - note the default osx downloader is "urllib":
"downloader_precedence": {
"windows": ["wininet"],
"osx": ["urllib"],
"linux": ["urllib", "curl", "wget"]
},
You can't actually edit the Default. Override this setting by going to Command Palette > 'Package Control Settings - User'
Copy-paste the snippet above into the User file (correct indentation and add comma after existing settings if needed) and make "curl" the first osx downloader:
"downloader_precedence": {
"windows": ["wininet"],
"osx": ["curl", "urllib"],
"linux": ["urllib", "curl", "wget"]
},

Related

Change properties in manifest.json file on build

I have a website with 2 domains like Page1.com and Page2.com. In my manifest.json file i have set the name to Page 1, but when the website is build and published to Page1.com and to Page2.com i want to change the name to be the same as the domain name. But how can i do this in my build step? Today i se Page 1 when i visit Page2.com.
I have tried to change the meta, application-name in my code to get the correct name, but this don't work.
My vue.config
const manifestJSON = require('./public/manifest.json')
module.exports = {
pluginOptions: {
i18n: {
locale: 'en',
fallbackLocale: 'en',
localeDir: 'locales',
enableInSFC: true
}
},
runtimeCompiler: true,
pwa: {
themeColor: manifestJSON.theme_color,
name: manifestJSON.short_name,
msTileColor: manifestJSON.background_color,
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'black',
workboxPluginMode: 'InjectManifest',
workboxOptions: {
swSrc: 'service-worker.js',
exclude: [
/_redirects$/
]
}
}
}
This site is build with VueJs and use Netlify as host.
So the manifest file is generated by vue-cli every time you build your app. So you shouldn't be using it to seed the vue-config file.
The one file that you could use the way you have shown here would be your package.json file - but it won't hold the values you are looking for.
Your Vue.config file is where you would enter, manually, the pwa info like theme and background color, etc.
To get back to your initial question, you could create two separate build scripts in your package.json, one for page1 and one for page2, and use environment variables to specify the name you ant to use:
"scripts": {
"page1": "env SITE_NAME='Page 1' npm run prod",
"page2": "env SITE_NAME='Page 2' npm run prod",
...
}
Then in your vue.config file, you can use the variable to build your pwa object:
pwa: {
name: process.env.SITE_NAME,
...
}
Finally, you can build your apps by calling
npm run page1
Be careful though: every build will overwrite your public folder! Depending on your context, how/when you build each app, you may have to take additional steps to generate two separate output folders.
The easiest way is to use process.argv to get a command line argument.
For example if you command to run the file is:
node file.js
Then using:
node file.js env_variable_str
Will have process.argv[process.argv.length - 1] === "env_variable_str"
In my case the manifest had to change not just the value but also add/remove a key depending on the argument. So I made a template (manifest_template.json) and used a "build helper" to create the correct manifest based on my argument in the public/ folder. Then I chained this command with npm run build and had another chaining command which made the zip folder.
My workflow: create manifest.json in public -> npm run build -> make zip with correct name
Let me know if you want to see the code!

"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
}

What steps need to be taken to get autocomplete working for React Native in Visual Studio Code?

I have followed the steps outlined in the VS Code documentation for getting Intellisense working for React Native by installing typings for React Native. Now, what do I need to do to get autocomplete working? For instance, if I type <Text>, I would like to see an automatic closing of that tag. What am I missing here? This seems like it shuld work out of the box.
To enable IntelliSense (autocomplete) you have to install the official React Native Tools extension.
Installation
Open Command Palette by pressing F1, type ext install and press Enter, then look for React Native Tools extension.
Create a jsconfig.json file
You should create a jsconfig.json file in you root directory. It can be empty but must be present. The presence of such a file in a directory indicates that the directory is the root of a JavaScript project.
(Optional)
The file itself can optionally list the files belonging to the project, the files to be excluded from the project, as well as compiler options.
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules"
]
}
You can find more at https://code.visualstudio.com/docs/languages/javascript#_javascript-projects-jsconfigjson
Create a .babelrc file for ReactNative Packger transformer (optional, if you want to use TypeScript)
You should create a .babelrc file with sourceMaps = true and "presets": [ "react-native" ] for better source-mapping support. (required if you want TypeScript support).
{
"presets": [
"react-native" // this is required for debugging with react-native/packager/transformer
],
"plugins": [],
"sourceMaps": true // must be true react-native/packager/transformer using with node-module-debug
// because of some bugs from vscode-node-debug & vscode-react-native, "sourceMaps" cannot be "inline" or "both"
}
Install typings for React Native (optional)
To get IntelliSense for React Native, run npm install typings -g and then typings install dt~react-native --global in your terminal.
Hope this helps!!
React Native Tools in VSCode can't help you close the Tag after you typed<Text>,you can try to install Auto Close Tag and Auto Rename Tag
In my case, I have to copy jsconfig.json to tsconfig.json, close Visual Code and reopen it. Then it works properly.
jsconfig.json
{
"compilerOptions": {
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules"
]
}
tsconfig.json
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules"
]
}
I am also not getting any IntelliSense and also package auto-import is not working. Since I am not using Typescript, deleting the tsconfig.json helped me.
Take backup of your tsconfig.json file first
In my case, I've already installed many react-native extensions for autoSuggestion and another helper extension, e.g. "React Native Tools", and "React-Native/React/Redux snippets for es6/es7"
Issues:
autoSuggestion keywords not coming while typing.
command(in IOS) + click not letting me to jump on the target files.
Recently I have seen in VS Code editor for new React-native applications autoSuggestion not working.
Steps I have followed to solve:
Go to Extensions
Search for React or React-native
Remove the installed extension
Reload it.

lein-less not running on figwheel start or when a .less file changes

I'm trying to setup a clojurescript project that uses the lein-less plugin to compile .less files. I should say I'm new to clojurescript. The problem is that it doesn't seem to run. It doesn't run when I run "lein figwheel" and neither when I change a .less file.
This is my project.cljs
(defproject fed-repo "0.1.0"
:description "Frontend Repository"
:dependencies [
[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]
[org.omcljs/om "1.0.0-alpha22"]
]
:plugins [
[lein-less "1.7.5"]
[lein-cljsbuild "1.1.2"]
[lein-figwheel "0.5.0-4"]
]
:less {
:source-paths ["src"]
:target-path "resources/public/css"
}
:hooks [
leiningen.less
leiningen.cljsbuild
]
:cljsbuild {
:builds [
{
:id "dev"
:source-paths ["src"]
:figwheel true
:compiler {
:main "fed-repo.core"
:asset-path "js/out"
:output-to "resources/public/js/main.js"
:output-dir "resources/public/js/out"
}
}
]
}
)
What is wrong with this setup?
Under :less the values for the keys :source-paths and :target-path need to go to actual files. You seem to have stopped at the directory.
Here's a working example:
:less {:source-paths ["src/less/"]
:target-path "resources/public/css/"}
Another issue is that you are not telling Figwheel where to hot code reload css from. Example:
:figwheel { :css-dirs ["resources/public/css"] }
With the set up so far there is still no .less -> .css file generation. You could have a terminal open that is dedicated to running lein less once. After changing the .less file run that command. Alternatively automatic generation can be done with the command lein less auto.

Build Haml automatic in sublime 3 doesn't work

I'm trying to let Sublime build haml files automatic on save.
I've installed SublimeOnSaveBuild, added haml extension:
{
"filename_filter": "\\.(css|js|sass|less|scss|haml)$",
"build_on_save": 1
}
and created haml.sublime-build in AppData\Roaming\Sublime Text 3\Packages\User:
{
"cmd": ["haml"],
"working_dir": "${file_path:${folder}}",
"selector": "source.haml",
"file_regex": "(.*\\.ts?)\\s\\(([0-9]+)\\,([0-9]+)\\)\\:\\s(...*?)$",
"windows":
{
"cmd": ["haml", "--trace", "$file", "${file_base_name}.html"],
"shell": "true"
}
}
As a result it works fine if I set build system = haml, but it doesn't if I try to set automatic ddetection of build system.
Can anyone help with this issue?
P.S. I'm using sublime 3 without any additional plugins and extensions, but SublimeOnSaveBuild
P.P.S Also automatic detection works good for scss files
The problem was in line
"selector": "source.haml"
It happens because file's scope for haml looks a bit different - "text.haml" instead of "source.haml". So I've change line above to:
"selector": "text.haml"
and in works for me.
You may find out the file's scope in sublime by pressing Ctrl + Alt + Shift + P on file's tab