Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
grunt-shimney-sweeper
Advanced tools
Housekeep your shimney with grunt.
If you haven't used grunt before, be sure to check out the Getting Started guide.
From the same directory as your project's Gruntfile and package.json, install this plugin with the following command:
npm install grunt-shimney-sweeper --save-dev
Once that's done, add this line to your project's Gruntfile:
grunt.loadNpmTasks('grunt-shimney-sweeper');
If the plugin has been installed correctly, running grunt --help
at the command line should list the newly-installed plugin's task or tasks. In addition, the plugin should be listed in package.json as a devDependency
, which ensures that it will be installed whenever the npm install
command is run.
grunt sweepout
reads all your installed shimney packages exports them and writes a config for them.
grunt sweep-config
reads all your installed shimney packages from npm and writes your config to www/js/config.js
.
grunt merge-configs
merges serval requirejs configuration together, into a new config file. The config file might be a module as a template and the merge of all configs can be adjusted
use
grunt.initConfig({
"sweep-config": {
www: {
options: {
configFile: "www/js/config.js",
nodeModulesUrl: "../../" // with trailing slash, without node_modules/ appended
}
}
},
"sweepout": {
test: {
options: {
//configFile: "build/js/config.js", // where to write the config to. Uses ${dir}/config.js as default
// packageRoot: "tmp" // change this if your node_modules directory is not sibling to the gruntfile root
//dir: "build/js" or specifiy the output-dir on commandline with --dir
}
}
},
"merge-configs": {
rjsboot: {
options: {
targetFile: 'build/js/boot.js',
configFiles: [
'www/js/mylibrary/config.js',
'www/js/config.js'
]
modify: function(mergedConfig) { // can return or modify the mergedConfig that is written
return { paths: {'user': 'overriden'} };
}
template: 'resources/config-template.js', // use this to inject the config in this file (will not be modified)
}
}
}
});
in your Gruntfile.js
to configure the sweeper.
your config-template.js
used in merge-configs could be like this:
var require = {
}
if (typeof(requirejs) === "function") {
requirejs.config(require);
}
This allows you to use the merged config before loading requirejs (recommended if you change the baseUrl) or as a data-main attribute in requirejs.
config
option into configFile
FAQs
The sweeper housekeeps your shimney with grunt.
We found that grunt-shimney-sweeper 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.