Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
d2-app-base
Advanced tools
Shared configuration package for DHIS2 apps using Webpack & Babel.
Start by removing Webpack, HtmlWebpackPlugin and D2 Manifest. Since D2 App Base includes these dependencies, it's best
not to include them in your app as well. That way you don't risk ending up with multiple versions of the packages in
your node_modules
.
yarn remove webpack html-webpack-plugin d2-manifest eslint eslint-config-dhis2
Or:
npm remove --save webpack html-webpack-plugin d2-manifest
Then install this package:
yarn add d2-app-base
or
npm install --save d2-app-base
After all dependencies have been installed, the post-install script will create the following NPM scripts:
start
: Starts webpack-dev-server on localhost port 8081 (by default)build
: Packages the app into the build/
folder. This also runs prebuild
and postbuild
which will clean up any
previous builds, validate and lint your code, and copy additional files.deploy
: Deploy a new version of the app to Sonatype. This runs the build
script first.At this point, if you're lucky everything will just work. Start the dev server with yarn start
(or npm start
), bump
the version number with yarn version
, and deploy new versions of your app with yarn deploy
.
More likely you'll have to make some small adjustments to the webpack config (webpack.config.js
), the html template
(index.html
) or the npm scripts (package.json
). For example you may have to adjust the postbuild
script in
package.json
to ensure that all the necessary files are copied to the build/
folder. Note: You shouldn't copy
index.html
since this will be generated by HtmlWebpackPlugin
.
You may also have to fix a ton of eslint errors. Please do fix them rather than disabling the linting, but feel free to
suggest changes to the eslint config if certain rules are causing problems. You may also override the rules in each
repo/folder by changing .eslintrc
By default, webpack will use ./src/index.js
as the entry point of your app, and the name of the output bundle will be
[name]-[hash].js
, where [name]
will be replaced with the name of your entry point (defaults to "main") and [hash]
will be replaced with a unique hash. Since the filename can't be known ahead of time, the HTML Webpack plugin is used
to generate an index.html
that loads the correct file(s).
The default webpack config simply calls makeWebpackConfig()
which is defined in
makeWebpackConfig.js. If you need to make changes to the webpack config, you can simply alter
the object returned by this function. For example you can generate two output bundles by replacing the entry
member:
const makeWebpackConfig = require('d2-app-base/makeWebpackConfig');
const webpackConfig = makeWebpackConfig(__dirname);
webpackConfig.entry = {
'app': './src/app.js',
'map': './src/map.js'
};
module.exports = webpackConfig;
This package includes certain dependencies on behalf of your app. If your app includes different versions of these
dependencies you may end up with multiple versions in your node_modules
folder. This can lead to weird bugs and
unpredictable behavior.
Therefore, it's recommended that you remove the following dependencies from your app:
FAQs
An NPM module that provides a common setup for DHIS 2 web apps
The npm package d2-app-base receives a total of 2 weekly downloads. As such, d2-app-base popularity was classified as not popular.
We found that d2-app-base demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.