npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@thingjs/xplugin-bundle

v0.2.7

Published

xplugin-bundle ThingJS-X 插件描述文件

Downloads

5

Readme

@thingjs/xplugin-bundle

xplugin-bundle

xplugin-bundle is the Core Component for ThingJS-X Plug-in Development

Install

Using npm:

$ npm i -g npm
$ npm install --save @thingjs/xplugin-bundle

Usage

插件引用


    //方式一,提供了目前所支持的插件类型
    import BundlePluginCore 
        from "@thingjs/xplugin-bundle/dist/plugin/BundlePluginCore";
    import BundlePluginExpand 
        from "@thingjs/xplugin-bundle/dist/plugin/BundlePluginExpand";
    import BundlePluginPanel 
        from "@thingjs/xplugin-bundle/dist/plugin/BundlePluginPanel";       
    import BundlePluginLayer 
        from "@thingjs/xplugin-bundle/dist/plugin/BundlePluginLayer";
    import BundlePluginControl 
        from "@thingjs/xplugin-bundle/dist/plugin/BundlePluginControl";    
    
    //或方式二有选择性方式引入
    import {
        BundlePluginCore,
        BundlePluginExpand, BundlePluginPanel,
        BundlePluginLayer, BundlePluginControl,
    } from "@thingjs/xplugin-bundle";
 

插件使用

    //以系统插件为例
    //系统插件开发中必须生成插件描述文件
    //该文件的配置需要引入 BundlePluginCore
    import BundlePluginCore 
        from "@thingjs/xplugin-bundle/dist/plugin/BundlePluginCore";
    
    export default class extends BundlePluginCore {

        constructor() {
            super();
            //可调用相关API 进行描述文件扩展
            //例如添加作者可以进行API调用
            this.bundle.setAuthor("uino");
        }

    }

bundle.json 结构示例

    {
        "name": "楼层展开插件",
        "type": "plugin",
        "id": "hzksiucj98kauj",
        "version": "1.0.0",
        "author": "uino",
        "description": "楼层展开场景控制插件,主要用于演示3D场景内建筑楼层展开,可进行结构观察",
        "main": "frame.js",
        "dependencies": {
            "thingjs": "1.2.7.17",
            "dpdVersion": ">1.0.2 <=2.3.4"
        },
        "external": {
            "use-standard": "0",
            "encrypt-files": ["frame.js"],
            "standard": "Revision",
            "preview": "./resources/preview.png",
            "thingjs-x": {
                "plugin-type": "layer",
                "license": "北京优锘科技有限公司 版权所有",
                "date": "2022/8/21 14:43:54",
                "extend": {
                    "rTypeGroup": "",
                    "rType": ""
                }
            }
        }
    };

BundlePlugin api

        // BundlePluginCore,
        // BundlePluginExpand, BundlePluginPanel,
        // BundlePluginLayer, BundlePluginControl,
        以上实现都集成于 BundlePlugin

BundlePlugin

    import BundlePlugin 
        from "@thingjs/xplugin-bundle/dist/bundle/BundlePlugin";

    let bundlePluginInstance = new BundlePlugin("hxzhajkxjajasd", "楼层展开");

    // bundlePluginInstance.toJSON();
    // bundlePluginInstance.setAuthor("uino")
    ...
//@property readonly
- id:string -获取插件唯一标识
- name:string -获取插件名称
- type:string -获取插件类型,plugin
- version:string -version:string;
- external -获取 External 节点实例(External 实例)
- author - 获取插件作者: uino
- main - 获取插件入口文件,default-> frame.js
- description:string -获取插件描述
- dependencies:Map - 获取资源依赖信息
//@method
- toJSON() -获取bundle节点 JSON
- addDependencies(libraryName:string,version:string) -添加依赖信息
- setName(name:string) -设置插件插件名称
- setType(type:string) -设置插件插件类型,default:plugin
- setVersion(version:string) - 设置插件版本号,版本号: e.g. 1.0.3
- setDescription(description:string) -设置插件描述信息

External 实例

//@property readonly
- standard: string - 获取插件开发规范标准
- useStandard:string -获取购买状态
- encryptFiles:Array -获取资源加密文件数组
- thingjsX:ThingJSX -获取ThingJSX 节点实例

ThingJSX 实例

//@property readonly
- pluginType:string - 获取插件类型
- theme:string - 获取插件主题
- license:string - 获取插件版权信息
- themePath:string -获取插件主题路径
- date:string -获取插件创建时间
- extend -扩展信息节点

//@method
- setPluginType(pluginType: string) -设置插件类型 :core、expand、layer、panel、contorl
- setTheme(theme: string)  -设置插件主题
- setLicense(license: string) -设置版权信息:北京优锘科技有限公司 版权所有