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

@ohos/hpm-cli-x2h

v1.0.4

Published

generate bundle.json by pom.xml|package.json, then publish to hpm

Downloads

105

Readme

x2h (hpm cli plugin)

HPM CLI 插件X2H,转换Maven/Gradle/NPM包为hpm包并发布到HPM仓库.

如何安装?(独立使用)

npm install -g @ohos/hpm-cli-x2h

如何使用x2h命令?

x2h  <类型> [选项]

选项

  • -p 或 preview ---只预览生成的包,不发布

类型

  • gradle ---从通过maven插件先根据gradle.build生成pom4hpm.xml,再转换为bundle.json
  • maven ---从pom.xml转换为bundle.json
  • npm ---从package.json转换为bundle.json

集成在HPM-CLI使用(hpm-cli 1.1.0以上版本)

从Gradle转换

在build.gradle编译脚本中添加如下脚本,执行publish2hpm任务(或者将publish2hpm发布后操作)

plugins {
    id 'maven'
}

task publish2hpm {
    pom {
        project {
            url "https://www.your.site"
            properties = [
                "hpm.bundle.name":'@your_organizaition/bunle_name',
                "hpm.bundle.tags":"foo,bar",
                "hpm.bundle.keywords":"foo,bar",
                "hpm.bundle.dirs":'{"lib":["build/outputs/*ar/release/*.*ar"]}'
            ]
        }
    }.writeTo("pom4hpm.xml")
    doLast{
        if (System.properties['os.name'].toString().startsWith('Windows'))
            ['cmd', '/c', 'hpm','x2h','gradle'].execute()
        else
            "hpm x2h gradle".execute()
    }
}

从Maven转换

在pom.xml文件中project下增加如下信息

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>hpm-publish</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>deploy</phase>
                        <configuration>
                            <executable>hpm</executable>
                            <arguments>
                                <argument>x2h</argument>
                                <argument>maven</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <properties>
        <hpm.bundle.name>@your_organizaition/bunle_name</hpm.bundle.name>
        <hpm.bundle.tags>ui,image</hpm.bundle.tags>
        <hpm.bundle.keywords>foo,bar</hpm.bundle.keywords>
        <hpm.bundle.dirs>{"lib":["build/outputs/*ar/release/*.*ar"]}</hpm.bundle.dirs>
    </properties>

从npm转换

在package.json文件中增加如下信息

  "scripts":{
    "postpublish":"hpm x2h npm"
  },
  "hpm":{
    "bundle.name":"@your_organizaition/bundle"
  }

注意

| hpm 的组件命名规则 为 @organization/bundle_name格式,organization为hpm平台注册的组织名,bundle_name只能由小写字母、数字、_构成,不超过200,故不能直接使用Maven、NPM的包名。