
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
@sunmao-ui/vite-plugin-fs
Advanced tools
The vite plugin for reading and writing the sunmao schema files through the server
The vite plutin for sunmao to read and write the applications and modules schema files.
You should enable the plugin in the vite.config.js first.
import * as path from 'path';
import { defineConfig } from 'vite';
import sunmaoFsVitePlugin from '@sunmao-ui/vite-plugin-fs';
import routes from './src/routes';
export default defineConfig({
plugins: [
sunmaoFsVitePlugin({
schemas: routes
.filter(route => 'name' in route)
.map(route => ({
name: route.name,
path: path.resolve(__dirname, `./src/applications/${route.name}.json`),
})),
modulesDir: path.resolve(__dirname, './src/modules'),
}),
],
});
Read the schemas of the applications and the modules:
const PREFIX = '/sunmao-fs';
export async function fetchApp(name: string): Promise<Application> {
const application = await (await fetch(`${PREFIX}/${name}`)).json();
if (application.kind === 'Application') {
return application;
}
throw new Error('failed to load schema');
}
export async function fetchModules(): Promise<Module[]> {
const response = await (await fetch(`${PREFIX}/modules`)).json();
if (Array.isArray(response)) {
return response;
}
throw new Error('failed to load schema');
}
const [app, modules] = await Promise.all([fetchApp(name), fetchModules()]);
Modify the schemas:
export function saveApp(name: string, app: Application) {
return fetch(`${PREFIX}/${name}`, {
method: 'put',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({
value: app,
}),
});
}
export function saveModules(modules: Module[]) {
return fetch(`${PREFIX}/modules`, {
method: 'put',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({
value: modules,
}),
});
}
initSunmaoUIEditor({
defaultApplication: app,
defaultModules: modules,
runtimeProps: config,
storageHandler: {
onSaveApp: function (app) {
return saveApp(name, app);
},
onSaveModules: function (modules) {
return saveModules(modules);
},
},
});
FAQs
The vite plugin for reading and writing the sunmao schema files through the server
We found that @sunmao-ui/vite-plugin-fs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.