How to add Bootstrap's enable-cssgrid Variable in Package.json - node.js

I have a project using Bootstrap and need to enable Bootstrap's cssgrid when the user runs [npm install] so I need to add this in package.json
-- Package.json
{
"name": "PROJECT",
"description": "DESC",
"dependencies": {
"backbone": "^1.4.1",
"bootstrap": "^5.3.0-alpha1", // Need to add enable-cssgrid variable here!!
"jquery": "^3.6.3"
}
}
How to solve that so the client can get the correct Bootstrap module?

Related

Google app scripts autocompletion in vs codium not working

I'm trying to run GAS in vs codium using node.js, npm and clasp.
Everything is synced correctly but the autocompletion is not working (it worked before but no more)
when I look in the directories, I see this in package.json:
"dependencies": {
"#types/google-apps-script": "^1.0.56"
}
and this in package-lock.json:
"dependencies": {
"#types/google-apps-script": "^1.0.56"
}
},
"node_modules/#types/google-apps-script": {
"version": "1.0.56",
"resolved": "https://registry.npmjs.org/#types/google-apps-script/-/google-apps-script-1.0.56.tgz",
"integrity": "sha512-3YGOtRlnWPSARl/n2BKt0qiIA6Y3/5BLC2zH9s/jcu+1rpxR07noLCFxTZ2BQBIfDl6+Vs9iKjLTgdbbL8q/mg=="
}
},
"dependencies": {
"#types/google-apps-script": {
"version": "1.0.56",
"resolved": "https://registry.npmjs.org/#types/google-apps-script/-/google-apps-script-1.0.56.tgz",
"integrity": "sha512-3YGOtRlnWPSARl/n2BKt0qiIA6Y3/5BLC2zH9s/jcu+1rpxR07noLCFxTZ2BQBIfDl6+Vs9iKjLTgdbbL8q/mg=="
}
}
I'm not familiar with node nor npm, is there a possible conflict ? I see two package.json files, one in the main directory and one in nodes_modules#types\google-apps-script, and package-lock.json is also in the main directory and in node_modules.

Which part have to be published to NPM registry

I am trying to create reusable react components that I would like to publish to NPM registry.
The project folder contains the following files and folders:
The dist folder contains the output files and folders from src. As you can recognize, I am using RollupJS as a module bundler.
The question is when I publish the project to NPM registry, it is enough to publish only the dist folder, or do I have to publish all files and folders?
// rollup.config.js
import typescript from 'rollup-plugin-typescript2';
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
import { nodeResolve } from '#rollup/plugin-node-resolve';
import setting from "./package.json";
export default {
input: "./src/index.tsx",
output: {
file: setting.main,
format: "es",
},
plugins: [typescript(), peerDepsExternal(), nodeResolve()]
};
The content of package.json file:
{
"name": "#example/components",
"version": "0.1.0",
"description": "React components",
"main": "./dist/index.js",
"module": "./dist/index.es.js",
"author": "anujit marty",
"license": "MIT",
"scripts": {
"build": "rollup --config"
},
"devDependencies": {
"#rollup/plugin-babel": "^5.3.0",
"#rollup/plugin-node-resolve": "^11.2.1",
"#types/react": "^17.0.3",
"#types/react-dom": "^17.0.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rollup": "^2.44.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-typescript2": "^0.30.0",
"tslib": "^2.1.0",
"typescript": "^4.2.3"
},
"peerDependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
}
Pushing dist to npm is enough. After you run the build command, all the files that are required for the package to run properly, are compiled into the dist folder, thus removing the need to push the entire project.

custom npm package not found in my service

There is a similar post here:
My custom NPM Package is not found,
but that did not resolve my issue.
Could not find a declaration file for module '#dc_microurb/common'.
'/Users//Projects/ticketing/auth/node_modules/#dc_microurb/common/build/index.js'
implicitly has an 'any' type. Try npm install #types/dc_microurb__common if it exists or add a new declaration
(.d.ts) file containing `declare module '#dc_microurb/common';
There is no #types/dc_microurb__common and I am unclear as to why it is suggesting to create a new .d.ts file, when that happens automatically during the build process.
This is the package.json file inside my published package:
{
"name": "#dc_microurb/common",
"version": "1.0.5",
"description": "",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"files": [
"./build/**/*"
],
"scripts": {
"clean": "del ./build",
"build": "npm run clean && tsc",
"pub": "git add . && git commit -m \"Updates\" && npm version patch && npm run build && npm publish"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"del-cli": "^3.0.1",
"typescript": "^4.0.5"
},
"dependencies": {
"#types/cookie-session": "^2.0.41",
"#types/express": "^4.17.9",
"#types/jsonwebtoken": "^8.5.0",
"cookie-session": "^1.4.0",
"express": "^4.17.1",
"express-validator": "^6.6.1",
"jsonwebtoken": "^8.5.1"
}
}
Anybody with experience in publishing packages on npm where TypeScript is involved? I am unclear as to why this package is not being found by my auth service when it is successfully installed inside that service.
Did I mess up in the way I am exporting inside my common/src/index.ts file?
export * from './errors/bad-request-error';
export * from './errors/custom-errors';
export * from './errors/database-connection-error';
export * from './errors/not-authorized-error';
export * from './errors/not-found-error';
export * from './errors/request-validation-error';
export * from './middlewares/current-user';
export * from './middlewares/error-handler';
export * from './middlewares/require-auth';
export * from './middlewares/validate-request';
Does it all have to be inside a module.exports instead?
So after reviewing a few blogs on Medium on how this is done, I noticed a couple of things.
Inside my tsconfig.js, this was missing:
/* Advanced Options /
"forceConsistentCasingInFileNames": true / Disallow inconsistencies */
So I manually added it in, secondly, I noticed something I meant to remove earlier but forgot. So instead of this:
{
"name": "#dc_microurb/common",
"version": "1.0.5",
"description": "",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"files": [
"./build/**/*"
],
I needed to have it like this:
{
"name": "#dc_microurb/common",
"version": "1.0.6",
"description": "",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"files": [
"build/**/*"
],
After making those couple of corrections, now my package is available to my auth service.

Difference between require and remote.require?

What is the difference between require and remote.require as below
var path = require('path');
const remote =require('remote');
var fsPlus =remote.require('fs-plus');
I have find something for require and remote.require, maybe it is correct:
require is use to get Npm packages
and remote.require is to access remotely defined packages in packages.json file of dependencies part.
for example
{
"name": "Test",
"description": "TestA modern parcel terminal",
"version": "0.1.47",
"main": "main.js",
"dependencies": {
"edge-atom-shell": "^5.0.1",
"finalhandler": "^0.5.0",
"nconf": "^0.8.4",
"fs-plus": "^2.9.2",
"fs-extra": "^0.30.0",
"py-logging": "^0.8.1",
"serve-static": "^1.11.1",
"server-destroy": "^1.0.1"
}
}

Install of jspm to ^0.16.34 has no registry property provided

I am fairly new to front end development and am working through Brian Noyes Aurelia Fundamentals course
I have installed the following;
node-v4.4.4x64
Git-2.8.2-64
Also I ran
npm install jspm --save-dev
and had this result
When I ran
npm install =g jspm gulp http-server
I got messages saying that the following are deprecated.
graceful-fs#3.0.8 and lodash#1.0.2
then when I ran
jsm init
I got an error
The package.json file is
{
"jspm": {},
"devDependencies": {
"jspm": "^0.16.34"
}
}
How do I fix this error?
Credit to user danzinator on github.
The fix:
Adding in the "registry": "npm" line to Package.json (even though the documentation says by default this registry should be used?)
{
"jspm": {
"registry": "npm",
"directories": {
"baseURL": "wwwroot",
"packages": "jspm_packages"
},
"devDependencies": {
"babel": "babel-core#^5.8.22",
"babel-runtime": "^5.8.20",
"browser-sync": "^2.9.3",
"core-js": "^1.1.0",
"gulp": "^3.9.0",
"gulp-tslint": "^3.2.0",
"jspm": "^0.16.2"
}
},
"devDependencies": {
"jspm": "^0.16.2",
"gulp": "^3.9.0",
"gulp-tslint": "^3.2.0",
"browser-sync": "^2.9.3"
}
}

Resources