What do I need in my package.json file in Meteor? - meteor

I think I'm confused as to what to have in my package.json file for my Meteor app. My app was originally built with v1.2 and recently updated Meteor to 1.4.1.1 (bypassing 1.3). I have no npm packages installed; all my packages were installed through atmosphere. Do I need to list the dependencies of atmosphere packages? I deploy to Modulus. Here's my file:
{
"name": "sonatina_database",
"private": true,
"mod-project-name": "SONATINAAPP",
"version": "1.0.0",
"description": "Client database for queries, reports, bulk emails, teaching schedule, etc",
"repository": {
"type": "git",
"url": "git+https://github.com/matt-moon/SonatinaDB.git"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "mj_moon",
"license": "ISC",
"bugs": {
"url": "https://github.com/matt-moon/SonatinaDB/issues"
},
"homepage": "https://github.com/matt-moon/SonatinaDB#readme",
"engines": {
"node": "4.4.7"
}
}
Sorry for the simple question, but it's confusing me.

These aren't a list of dependencies but a list of Meta information for your applications.
It's better to keep this just incase in the future you do decide 'npm' packages later in the future with 'meteor npm install {package name}.
I hope this helps.

Related

How to set dev and prod targets in Parcel

Please can anyone shed some light on how "Targets" work in Parcel, or at least how to separate unminified dev and minified prod files. The sparse documentation just raises further questions and no amount of Googling will find a solution. I am new to Parcel and to the modular nature of newer Javascript syntax.
This all started when I noticed that parcel watch does not minify/uglify the JS, and I don't want that to end up on the prod server. But parcel build WILL minify/uglify the JS. So it would be really swell if my start script could bundle files into build/wp-content/themes/yourproject/assets--dev and the build script could bundle files into build/wp-content/themes/yourproject/assets. That way I can put assets-dev in .gitignore and use those while building the site. Or is that even the proper way to acheive this? In Gulp you can just define different tasks or create one task to do both of these outputs, but I cannot find a way to do this in Parcel.
Description of the project - It's a WordPress site so I can't necessarily feed Parcel source html files to scan. Parcel is really just bundling JS and SCSS files, we are replacing our old Gulp setup. So in package.json, I have this (I'll explain what I have tried in "scripts" and in "targets" further down):
{
"name": "localtesting2",
"version": "1.0.0",
"description": "## Overview",
"browserslist": "> 0.5%, last 2 versions, not dead",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "parcel watch develop/js/index.js develop/styles/style--critical.scss develop/styles/style--noncritical.scss --dist-dir ./build/wp-content/themes/yourproject/assets--dev",
"build": "parcel build develop/js/index.js develop/styles/style--critical.scss develop/styles/style--noncritical.scss --dist-dir ./build/wp-content/themes/yourproject/assets"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"smoothscroll-polyfill": "^0.4.4"
},
"devDependencies": {
"#parcel/transformer-sass": "^2.3.2",
"autoprefixer": "^10.4.2",
"parcel": "latest",
"parcel-bundler": "^1.12.5",
"parcel-resolver-ignore": "^2.0.0",
"postcss": "^8.4.6",
"postcss-modules": "^4.3.0",
"sass": "^1.49.8",
"webfontloader": "^1.6.28"
},
"targets": {
"default": {
"distDir": "build/wp-content/themes/yourproject/assets--dev"
},
"build": {
"distDir": "build/wp-content/themes/yourproject/assets"
}
},
"parcelIgnore": [
"images/*.*",
"webfonts/*.*"
]
}
The root of the project is like this:
build/
-- build/wp-admin
-- build/wp-content
-- etc all the WordPress core/theme files that will ultimately end up on the server
The dev directory looks like this, basically just holding the source code for JS and CSS that get compiled into the theme:
In "scripts" I have tried setting "start" and "build" both with and without the --dist-dir flag. And I remove the "targets" object from package.json when I try --dist-dir.
For "targets", I can't find clear documentation/examples on what exactly goes here so I just tried anything I could think of. I have tried all of the following but nothing works the way I am intending it to. Parcel picks either assets-dev or assets and compiles everything there, it won't separate the code. Sometimes it will just compile files into a dist folder, which I am not using.
"targets": {
"start": {
"distDir": "build/wp-content/themes/yourproject/assets--dev"
},
"build": {
"distDir": "build/wp-content/themes/yourproject/assets"
}
},
"targets": {
"watch": {
"distDir": "build/wp-content/themes/yourproject/assets--dev"
},
"build": {
"distDir": "build/wp-content/themes/yourproject/assets"
}
},
"targets": {
"default": {
"distDir": "build/wp-content/themes/yourproject/assets--dev"
},
"build": {
"distDir": "build/wp-content/themes/yourproject/assets"
}
},
"targets": {
"dev": {
"distDir": "build/wp-content/themes/yourproject/assets--dev"
},
"prod": {
"distDir": "build/wp-content/themes/yourproject/assets"
}
},
Ultimately I am looking for how to get unminified assets into one folder that I can conditionally load, and minified assets into another folder that will get loaded on the prod server.
I figured it out. The CLI commands in the "scripts" portion of package.json can include the --target flag. This way you can name a target and then define it in the "targets" property. This is the working package.json:
{
"name": "localtesting2",
"version": "1.0.0",
"description": "## Overview",
"browserslist": "> 0.5%, last 2 versions, not dead",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "parcel watch develop/js/index.js develop/styles/style--critical.scss develop/styles/style--noncritical.scss develop/styles/editor.scss --target default",
"build": "parcel build develop/js/index.js develop/styles/style--critical.scss develop/styles/style--noncritical.scss develop/styles/editor.scss --target build"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"smoothscroll-polyfill": "^0.4.4"
},
"devDependencies": {
"#parcel/transformer-sass": "^2.3.2",
"autoprefixer": "^10.4.2",
"parcel": "latest",
"parcel-bundler": "^1.12.5",
"parcel-resolver-ignore": "^2.0.0",
"postcss": "^8.4.6",
"postcss-modules": "^4.3.0",
"sass": "^1.49.8",
"webfontloader": "^1.6.28"
},
"targets": {
"default": {
"distDir": "build/wp-content/themes/yourproject/assets--dev"
},
"build": {
"distDir": "build/wp-content/themes/yourproject/assets"
}
},
"parcelIgnore": [
"images/*.*",
"webfonts/*.*"
]
}
Still though there must be a better workflow for this, or maybe a way to get the watch command to minify everything like build does.

RStudio install packages from Azure DevOps

I'm creating some internal packages with R in RStudio. My repositories are hosted in Azure DevOps. I saw the renv.lock and there is a section for repositories.
{
"R": {
"Version": "3.6.1",
"Repositories": [
{
"Name": "CRAN",
"URL": "https://cran.rstudio.com"
}
]
},
"Packages": {
"BH": {
"Package": "BH",
"Version": "1.69.0-1",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "0fde015f5153e51df44981da0767f522"
},
"KernSmooth": {
"Package": "KernSmooth",
"Version": "2.23-16",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "a531dc333440009ee13bbb507232476d"
}
}
My components are in a url like
https://dev.azure.com/mycompany/RComponents/_git/mycomponent
Is there a way to add my private repositories in here? How can I install R packages from Azure DevOps?
I got it to work using the remotes package!
remotes::install_git("<clone url>", git = "external")
#AKA
remotes::install_git("https://ORG#dev.azure.com/USER/PROJECT/_git/NAME", git = "external")
You are then directed to a sign in handled via RStudio popups.
renv is able to install and restore packages from a variety of sources, including:
CRAN,
Bioconductor,
GitHub
Gitlab
Bitbucket
However, it does not include Azure DevOps. Please refer to this document. In addition, there is also no information about using Azure DevOps repositories or packages in the RStudio Documentation.

Metor + Semantic UI : variable #googleProtocol is undefined

I've created a fresh project with Meteor and I'm trying to integrate Semantic UI, I've walked through the steps here
https://semantic-ui.com/introduction/integrations.html
but I'm getting this problem after installing the sematicui and postcss packages :
While processing files with less (for target web.browser):
client/lib/semantic-ui/definitions/globals/site.import.less:29: variable
#googleProtocol is undefined
error: variable #googleProtocol is undefined
The Meteor version is 1.10.2, the packages.json looks like this;
{
"name": "test",
"private": true,
"scripts": {
"start": "meteor run",
"test": "meteor test --once --driver-package meteortesting:mocha"
},
"dependencies": {
"#babel/runtime": "^7.8.3",
"jquery": "^3.4.1",
"meteor-node-stubs": "^1.0.0"
},
"devDependencies": {
"autoprefixer": "^6.3.1",
"postcss": "^6.0.22",
"postcss-load-config": "^1.2.0"
},
"postcss": {
"plugins": {
"autoprefixer": {
"browsers": [
"last 2 versions"
]
}
}
}
}
I had this problem and it was painful. Apparently the problem is the version of less and some incompatibility with juliancwirko:postcss package and meteor (2.0 in my case). The solution I found was the following:
meteor npm install --save-dev postcss#6.0.22 postcss-load-config#1.2.0
npm install less#2.7.3 --save-dev
After these considerations, it finally worked.
Same error here, for me this worked:
meteor install semantic:ui
meteor install less#2.8.0

Google Cloud Functions Node 8 not working – "hidden" dependencies expecting Node 6?

I've been using Google Cloud Functions with the regular Node 6 runtime for about 18 months, and it's all mostly fine and dandy. However, I've unsuccessfully tried to get it working with Node 8.
Package.json (server/functions folder) below:
{
"engines": {
"node": "8"
},
"name": "project",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"#google-cloud/firestore": "^0.17.0",
"cors": "^2.8.4",
"firebase-admin": "^6.0.0",
"firebase-functions": "^2.0.5"
},
"scripts": {
"deploy": "firebase deploy --only functions"
}
Specifically, the error I get is on running a function, where it will error out on "semver" expecting a different Node version (6?).
Is there something I can do, or some workaround, for this to work at all? I can't even install firebase-tools v4+ here, although I can do so in my root directory where it's already installed.

Application not loading when deployed to Firebase

i'm new to web development and i've created an application that i would like to deploy to firebase. i referred to the online resources and carried out the necessary steps (as shown below) to get my application online. now when i got to my site i don't see the data loading. I recieve the foll error. Now even if i remove the 'scroll to top' script referenced in the error, there is no data loading.
GET https://arrow.scrolltotop.com/arrow88.js net::ERR_INSECURE_RESPONSE
I am walking you through my workflow if that's all right. Any help would be appreciated.
The foll is my package.json:
{
"name": "xxx",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"angular-animate": "^1.5.0",
"angular": "^1.5.0",
"angular-aria": "^1.5.0",
"angular-ui-router": "^0.2.18",
"mdi": "^1.4.57",
"angular-material": "^1.0.5"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
the foll is my firebase.json
{
"firebase": "xxx",
"public": ".",
"ignore": [
"firebase.json",
"**/.*"
]
}
It think it may be worthwhile to mention that i don't recieve a blank page When i run the application on a local http-server. the application loads and i get all the data from firebase without any errors.
Thanks

Resources