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 🙏

© 2025 – Pkg Stats / Ryan Hefner

geostar-map-plugins

v0.3.30

Published

武大吉奥 GEOTSP 2023/5/11 21:16

Downloads

4

Readme

geostar-map-plugins

Table of Contents

To Do

  • [x] 确认 package -> assets 文件夹是否有用
  • [x] 确认 package -> esriMap -> lib -> runtime 文件是否有用
  • [✓] 确认 package -> themes 文件是否有用
  • [✓] 确认 src -> store 是否合理
  • [×] 确认 src -> themes -> css -> iamges | common 文件是否有用
  • [✓] 确认 readme.md 补充使用示例

Publish Address

http://{ip}:{port}/-/web/detail/geostar-map-plugins

Installation

npm install geostar-map-plugins@latest --registry http://{ip}:{port}
npm install geostar-map-plugins@xxx --registry http://{ip}:{port} // 测试版本

Develop

npm install --save-dev
npm run dev

Using

npm

step1:import

//main.js
import { geostar } from "geostar-map-plugins";
let initialize = geostar.initialize;
initialize().then(
  function (isload) {
    if (isload === false) console.log("Modules loaded failed");
    console.log(`System 'initialize()' called.`);
    new Vue({
      render: (h) => h(App),
    }).$mount("#app");
  },
  function (err) {
    console.error(err);
  }
);

Project Construct

├── dist          // mapgis打包文件
├── mock          // 数据
├── node_modules
├── geostar       // 存放mapgis包核心文件, 输出 geostar
│   ├── caps			// 组合能力系列,如空间数据文件上传(包含选文件、加载文件、转换base64、转换geojson等)、绘制(包含激活绘制、失效绘制、清除绘制层等)
│   ├── common
│   ├── components //业务相关能力、对外接口输出
│   └── support 	// 核心能力core
├── package   // 存放gs-plugin地图组件 , 输出 gisvue
│   ├── baseLine
│   ├── business
│   ├── panel
│   └── store
├── public
├── src           // 存放运行时的数据存储、内部路由等文件
│   ├── store			// 输出 geostar.gisstore
│   |     ├── modules    固定的 Manager,用于数据扭转和管理(带命名空间)
│   |     |     ├── app //应用级别的管理对象(如主配置appConfig、layoutManager、viewManager、topicManager等,全局状态maptype、全局字典
|   |     |     |       //library)
│   |     |     ├── interfaces // 提供项目之间对接时所需的能力。
│   |     |     ├── map 地图内对象状态(如map、view、layers等gis对象,还包括components)
│   |     |     ├── setting //静态文件存储和管理
│   |     |     └─  tool //内部常用工具(来自appUtil、register、loader等), 只提供使用
|   |     ├── getters
|   |     └── index 全局状态管理入口
|   │
│   ├── router
│   └── views
└── test          // 测试单例 or 单元测试

关于 versiontag

概念:

 version
 作为开发者,版本号肯定不陌生,发布到npm后,每一个版本号都对应了其资源文件,而且是不可修改的。npm中的版本号类似于git中的tag。
 tag
 npm中也有个tag的概念,真是混乱。一般情况下,我们可以不指定tag,这时默认就会用latest这个tag,所有发布或者安装都是最新的正式版。而指定tag之后,我们可以在这个tag上发布一个更新的版本,用户安装的时候如果也指定这个tag,则会安装这个tag下的最新版。因此,npm中的tag类似于git中的branch。



总结一下:
1. version一旦发布,是不可变的;
2. tag更像一个渠道,只要用户选择了这个渠道,就可以一直更新这个渠道的最新版。tag可用于提供别名而不是版本号。

也因此,version和tag是相互独立的。
  • 切换 tag 回到我们的问题,如果不小心把 1.0.0-alpha.1 直接 npm publish 了,我们该怎么办?

    命令一:npm dist-tag ls

    查看当前的 tag 和对应的 version。 通过这个命令,我们可以得到这样的结果:

    latest: 1.0.0 next: 1.0.0-alpha.0 如果我们不小心发布了一个 1.0.0-alpha.1 到 latest,那么我们会得到:

    latest: 1.0.0-alpha.1 next: 1.0.0-alpha.0 这个时候我们只要切一下 tag 就可以挽回局面了。

    命令二:npm view versions

    查看 my-package 发布过的所有版本号。 通过这个命令可以得到一个数组:

    [ '0.1.0', '1.0.0', '1.0.0-alpha.0', '1.0.0-alpha.1' ]

    命令三:npm dist-tag add @version tag

    设置 tag,对应到版本 version。 如:把原来的 1.0.0 设置成最新的正式版

    $ npm dist-tag add @1.0.0 latest 把 1.0.0-alpha.1 更新到最新的测试版

    $ npm dist-tag add @1.0.0-alpha.1 next

  • 删除 tag

    命令一:npm dist-tag rm

  • 添加 tag

    命令:npm dist-tag add @ []

关于 esdoc

介绍

ESDoc 是一个根据 javascript 文件中注释信息,生成 JavaScript 应用程序或库、模块的 API 文档的工具。具有文档覆盖率统计、系统手册、一体化测试、详细接口说明等特点。

ESDoc 与 JSDoc 对比

JSDoc 是目前最火的文档生成工具,它存在的时间也比较长,但是功能上还欠缺一些,比如文档覆盖率、自动测试、搜索等,都没有实现。并且它的使用比较复杂,需要严格使用标签,过多依赖备注来实现。它最大的坑是同名接口无法区分。

| - | ESDoc | JSDoc | | :------: | :--------------------- | :----------------------------------------------- | | ES 标准 | ES6 以上 | ES6 | | 模块化 | Class、import & export | Class、import & export、CommonJS、AMD、Prototype | | 注释类型 | 块级注释 | 块级注释 | | 标签 | 少量标签 | 标签完善,需要严格使用 | | 文档内容 | 自动语义化,说明详细 | 注释中提炼 | | 覆盖率 | 支持 | 无 | | 测试 | 支持 | 无 | | 手册 | 支持多个文档 | 支持多个文档 | | 搜索 | 支持 | 无 | | 插件 | 支持 | 支持 | | 同名接口 | 重叠显示 | 分开显示 |

示例

点我: https://try.esdoc.org/

常用标签

@public--对外接口,一般可以省略 @private--内部接口,使用 "_" 可以省略 @protected--受保护接口

/**
* @public
*/
class MyClass {
	/**
	 * @private
	 */
	_method(){...}
	
	/**
	 * @protected
	 */
	add(){...}
}
  • @deprecated--接口废弃,会显示在文档中
/**
 * @deprecated 使用 MyClassEx 替换
 */
class MyClass{...}
  • @ignore--忽略接口,不会显示在文档中
/**
 * @ignore
 */
class MyClass{...}
  • @version--标注版本号
/**
 * @version 0.0.1
 */
class MyClass{...}
  • @todo--后期需要实现功能
/**
 * @todo 支持修改
 */
class MyClass{...}
  • @extends--继承自,一般能自动识别
/**
 * @extends {SuperClass1}
 * @extends {SuperClass2}
 */
class MyClass extends mix(SuperClass1, SuperClass2) {...}
  • @param--参数,支持对象
class App extends MFEComponent {
    /**
     * 初始化
     * @param {Object} props - 传入对象
     * @param {Number} props.foo - 描述
     * @param {String} props.bar - 描述
     */
    constructor(props){...}
}
  • @return--返回值,支持对象
class MyClass {
    /**
     * @return {Object} 描述
     * @property {number} foo - 描述
     * @property {number} bar - 描述
     */
    method(){...}
}
  • @type--类型定义
// 单个属性
class MyClass {
	constructor() {
		/** @type {number} */
		this.p = 123;

		/**
		 * @type {Object}
		 * @property {number} res.foo - 描述
		 * @property {string} res.bar - 描述
		 */
		this.res = {foo: 123, bar: "abc"};
    }
}

// get/set
class MyClass {
  	/** @type {string} */
  	get value() {}

  	/** @type {string} */
  	set value(v){}
}

类型语法

  • 数组
/**
 * @param {number[]} param - 描述
 */
function myFunc(param){...}
  • 并存类型
/**
 * @param {number|string} param - 描述
 */

关于 terser-webpack-plugin 配置

defaults(默认值:true)——传递false以禁用大多数默认启用的压缩转换。当您只想启用几个压缩选项而禁用其余选项时,这很有用。 arrows (默认值:true)--如果生成的代码更短,则类和对象文本方法也将转换为箭头表达式:m(){return x}变为m:()=>x。要对不使用this或参数的常规ES5函数执行此操作,请参见unsaferarrows。 arguments(默认值:false)——尽可能用函数参数名称替换arguments[index]。 booleans(默认值:true)——例如,布尔上下文的各种优化!!一乙:丙→ 一乙:丙 booleans_as_intgers(默认值:false)--将布尔值转换为0和1,并使用==和!=与布尔值进行比较而不是==和!==。 collapse_vars(默认值:true)——折叠一次性使用的非常量变量,副作用允许。

comparisons(默认值:true)——对二进制节点应用某些优化,例如!(a<=b)→ a>b(仅当unsafecomps时),尝试否定二进制节点,例如a=!b&&!c&&!d&&!e→ a=!(b||c||d||e)等。

computed_props(默认值:true)--将常量计算属性转换为常规属性:{[“computed”]:1}转换为{computed:1}。

conditionals(默认值:true)--对if-s和条件表达式应用优化

dead_code(默认值:true)--删除无法访问的代码

directives(默认值:true)--删除冗余或非标准指令

drop_console(默认值:false)——传递true以放弃对console.*函数的调用。如果您希望在删除函数调用后删除特定的函数调用(如console.info)和/或保留函数参数的副作用,请改用pure_funcs。

drop_debug(默认值:true)——删除调试器;声明

ecma(默认值:5)--通过2015或更高版本,以启用将ES5代码转换为更小的ES6+等效形式的压缩选项。

evaluate(默认值:true)--尝试计算常量表达式

expression(默认值:false)——传递true以保留终端语句的完成值而不返回,例如在bookmarklets中。

global_defs(默认值:{})--请参阅条件编译

  • 提升功能声明

holl_props(默认值:true)——将属性从常量对象和数组文字提升为受一组约束约束的常规变量。例如:var o={p:1,q:2};f(o.p,o.q);转换为f(1,2);。注意:如果启用了mangle,压缩选项passs设置为2或更高,并且压缩选项toplevel已启用,那么holy_pops的工作效果最好。

jull_vars(默认值:false)——提升变量声明(默认情况下为false,因为它通常会增加输出的大小)

if_return(默认值:true)--if/return和if/recontinue的优化

inline(默认值:true)--对带有simple/return语句的函数的内联调用:

false--与0相同

0—禁用内联

1——内联简单函数

2—带参数的内联函数

3——带参数和变量的内联函数

true--与3相同

join_vars(默认值:true)—连接连续的var语句

keep_classnames(默认值:false)——传递true以防止压缩器丢弃类名。传递正则表达式以仅保持类名与正则表达式匹配。另请参见:keep_classnames mangle选项。

keep_args(默认值:true)--防止压缩器丢弃未使用的函数参数。依赖Function.length的代码需要这个。

keep_fnames(默认值:false)——传递true以防止压缩器丢弃函数名。传递正则表达式以仅保持函数名与正则表达式匹配。对于依赖Function.prototype.name的代码很有用。另请参阅:keep_fnames mangle选项。

keep_inity(默认值:false)——传递true以防止infinity压缩为1/0,这可能会导致Chrome上的性能问题。

loops(默认值:true)——当我们可以静态确定条件时,对do、while和循环进行优化。

module(默认为false)——压缩ES6模块时传递true。严格模式是隐含的,也是顶层选项。

negat_iife(默认值:true)——否定“立即调用的函数表达式”,其中返回值被丢弃,以避免代码生成器将插入的括号。

passs(默认值:1)--运行压缩的最大次数。在某些情况下,多次传递会导致进一步的压缩代码。记住,更多的传球需要更多的时间。

properties(默认值:true)--使用点符号重写属性访问,例如foo[“bar”]→ foo.bar(foo.bar)

pure_funcs(默认值:null)——您可以传递一个名称数组,Terser将假设这些函数不会产生副作用。危险:不会检查名称是否在范围内重新定义。这里有一个示例,例如var q=Math.floor(a/b)。如果变量q未在其他地方使用,Terser将删除它,但仍保留Math。地板(a/b),不知道它做什么。您可以传递pure_funcs:['Math.floor'],让它知道该函数不会产生任何副作用,在这种情况下,整个语句将被丢弃。当前的实现增加了一些开销(压缩将更慢)。

pure_getters(默认值:“strict”)——如果为此传递true,Terser将假设对象属性访问(例如foo.bar或foo[“bar”])没有任何副作用。指定“strict”来处理foo。仅当foo确定不抛出(即不为null或未定义)时,才将bar作为无副作用。

reduce_vars(默认值:true)——改进变量赋值和用作常量值的优化。

reduce_funcs(默认值:true)——尽可能内联单用函数。取决于是否启用reduce_vars。禁用此选项有时会提高输出代码的性能。

sequences(默认值:true)——使用逗号运算符连接连续的简单语句。可以设置为正整数,以指定将生成的连续逗号序列的最大数量。如果此选项设置为true,则默认序列限制为200。将选项设置为false或0将禁用。最小序列长度为2。序列值1被认为等于真,因此意味着200。在极少数情况下,默认序列限制导致压缩时间非常慢,在这种情况下,建议值为20或更小。

side_effects(默认值:true)--删除没有副作用且结果未被使用的表达式。

switchs(默认值:true)--消除重复并删除无法访问的交换机分支

toplevel(默认值:false)--在顶层作用域中删除未引用的函数(“funcs”)和/或变量(“vars”)(默认值为false,true将删除未引用函数和变量)

top_retain(默认值:null)--防止未使用的删除特定顶层函数和变量(可以是数组、逗号分隔、RegExp或函数。表示顶层)

typeofs(默认值:true)--将foo==“undefined”的类型转换为foo==void 0。注意:由于已知问题,建议将IE10和早期版本的此值设置为false。

unsafe(默认值:false)——应用“不安全”转换(详细信息)。

unsaferarrows(默认值:false)——如果函数体未引用此函数,则将ES5样式的匿名函数表达式转换为箭头函数。注意:如果代码依赖于具有原型的函数,执行这种转换并不总是安全的,而箭头函数缺少原型。此转换要求将ecma压缩选项设置为2015或更高。

unsafecomps(默认值:false)--反转<和<=to>和>=以允许改进压缩。当两个操作数中至少有一个是具有计算值的对象时,这可能是不安全的,因为使用了get或valueOf等方法。这可能会导致比较中的操作数切换后执行顺序发生变化。只有当比较和unsafecomp都设置为true时,压缩才有效。

unsafeFunction(默认值:false)——当参数和代码都是字符串文字时,压缩和修改函数(参数,代码)。

unsafemath(默认值:false)——将数值表达式(如2x3)优化为6*x,这可能会产生不精确的浮点结果。

unsafe_symbols(默认值:false)--从本机Symbol声明中删除键,例如Symbol(“kDog”)变为Symbol()。

unsaf_methods(默认值:false)--将{m:function(){}转换为{m(){}}。ecma必须设置为6或更大才能启用此转换。如果unsaf_methods是RegExp,那么具有与RegExp匹配的键的键/值对将转换为简洁的方法。注意:如果启用,如果任何代码尝试新建前一个函数,则会有获得“<method name>is not a constructor”TypeError的风险。

unsafeproto(默认值:false)--优化Array.prototype.slice等表达式。调用(a)到[].slice.call(a)

unsaf_regexp(默认值:false)——启用使用regexp值替换变量的方式与常量相同。

unsafefined(默认值:false)--如果作用域中有一个名为undefined的变量,则替换void 0(变量名将被损坏,通常会缩减为单个字符)

unused(默认值:true)--删除未引用的函数和变量(除非设置为“keep_assign”,否则简单的直接变量赋值不会算作引用