Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@planetscale/vtadmin
Advanced tools
Planetscale's internal version of vtadmin-web, packaged as an npm module. For use with vtadmin-api.
VTAdmin Web is a user interface that allows Vitess users to easily manage and view state of their Vitess components. VTAdmin Web should be used with VTAdmin API (shipped within the Vitess monorepo).
You can directly import the .js files and .css files necessary to use in a Rails-Webpacker asset pipeline, like so:
// app/javascript/vtadmin.js
const importAll = (r) => r.keys().map(r)
// imports all media files for use
importAll(require.context('vtadmin/static/media', false, /\.(png|jpe?g|svg)$/));
// imports all css files for use
importAll(require.context('vtadmin/static/css', false, /\.(js|css)$/));
// imports all javascript files for use
importAll(require.context('vtadmin/static/js', false, /\.(js|css)$/));
Then in your .erb file, import the styles and js as a pack:
<%= javascript_pack_tag "vtadmin", "data-turbolinks-track": "reload" %>
<%= stylesheet_pack_tag "vtadmin", media: "all", "data-turbolinks-track": "reload" %>
Primarily, @planetscale/vtadmin
exports two variables: defaultFilePath
and directoryPath
. Server side, you can serve the entire app easily like so (express.js example):
import express from 'express'
import * as ui from 'vtadmin'
const app = express()
app.use(express.static(ui.directoryPath))
app.get('/', function (req, res) {
console.log("FILE PATH ", ui.defaultFilePath)
res.sendFile(ui.defaultFilePath)
})
app.listen(9000, () => {
console.log(`Server started on http://localhost:9000`)
})
File structure
- vtadmin
- planetscale-vtadmin-scripts
- index.ts // Index file that is copied into package directory as the entrypoint of npm package
- README.md // README for @planetscale/vtadmin npm package
- package.json // Base package.json for @planetscale/vtadmin npm package
- scripts
- createPlanetscaleVTAdmin.ts // Script to copy vtadmin's package.json and build folder into package folder
- planetscale-vtadmin // Directory containing npm module @planetscale/vtadmin
web/vtadmin/package.json
includes a build script run by npm run build:planetscale-vtadmin
that:
web/vtadmin/planetscale-vtadmin-scripts
to a new directory web/vtadmin/planetscale-vtadmin
To release new versions of the vtadmin npm package:
web/vtadmin/package.json
npm run build
to compile vtadmin-web into a minified build
foldernpm run build:planetscale-vtadmin
to create package directory for @planetscale/vtadmin
npm modulecd planetscale-vtadmin
to navigate into the folder for module @planetscale/vtadmin
npm publish --access public
to publish new version to npmFAQs
Planetscale's internal version of vtadmin-web, packaged as an npm module. For use with vtadmin-api.
The npm package @planetscale/vtadmin receives a total of 0 weekly downloads. As such, @planetscale/vtadmin popularity was classified as not popular.
We found that @planetscale/vtadmin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.