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

uos-bundle-script

v0.1.5

Published

## 介绍

Downloads

22

Readme

项目名称

介绍

本项目旨在提供一种简便、高效的方式,将 Electron 应用构建为适用于 UOS 系统的可执行文件。目标是丰富和优化国产操作系统的应用生态。详细的打包方法,参考提供的教程

脚本说明

该脚本用于将 Electron 应用构建为 UOS 平台可执行文件。 (代码量很少,有必要时候可以查看,创建对应需要的目录和文件,执行deb构建的系列指令,对文件修改。)

配置说明:

ALL Field

| 字段名 | 类型 | 描述 | | ------ | ---- | ---- | | output | string | 输出路径 | | appId | string | 应用ID | | svgPath | string | SVG图标路径,不建议使用png,需要管理各种尺寸的资源 | | unpackedDir | string | 未打包目录路径,electron builder 构建deb的unpacked目录 | | DesktopInfo | DesktopInfoType | 桌面信息类型 | | DesktopEntry | DesktopEntryType | 桌面条目类型 | | controlFile | controlFileType | 控制文件类型 | | beforeGenerateTemplateDir | 函数 (可选) | 在生成模板目录之前执行的函数 | | afterGenerateTemplateDir | 函数 (可选) | 在生成模板目录之后执行的函数,参数为模板路径 | | beforePack | 函数 (可选) | 在打包之前执行的函数 | | afterPack | 函数 (可选) | 在打包之后执行的函数 | | removeTemplateDir | boolean (可选) | 是否移除模板目录 | | beforeRemoveTemplateDir | 函数 (可选) | 在移除模板目录之前执行的函数 | | afterRemoveTemplateDir | 函数 (可选) | 在移除模板目录之后执行的函数 |

DesktopInfoType

| 字段名 | 类型 | 描述 | | ------ | ---- | ---- | | appId | string | 应用ID | | name | string | 应用名称 | | version | string | 应用版本 | | description | string | 应用描述 | | permissions | DesktopInfoPermissionType (可选) | 应用权限信息 |

DesktopEntryType

| 字段名 | 类型 | 描述 | | ------ | ---- | ---- | | Categories | string | 应用分类 | | Name | string | 应用名称 | | GenericName | string | 通用名称 | | Type | string | 类型 | | Exec | string | 执行命令 | | Icon | string | 图标 | | MimeTypes | string (可选) | MIME 类型 | | Comment | string (可选) | 注释 | | Terminal | string (可选) | 是否在终端中运行 | | StartupNotify | string (可选) | 是否在启动时通知 | | [key: string] | string 或 undefined | 其他任意字段 |

controlFileType

| 字段名 | 类型 | 描述 | | ------ | ---- | ---- | | Source | string | 源代码信息 | | Section | string | 包的分类 | | Priority | string | 包的优先级 | | Maintainer | string | 维护者信息 | | StandardsVersion | string | 标准版本 | | Homepage | string | 主页链接 | | VcsBrowser | string | 版本控制系统浏览器链接 | | VcsGit | string | Git 版本控制系统链接 | | Package | string | 包名 | | Architecture | string | 架构信息 | | Description | string | 包的描述 | | [key: string] | string 或 undefined | 其他任意字段 |

使用方式

const appId = 'com.electron.builduos';
const name = 'buildUos';
const execFileName = 'electron-godan';
const version = '1.0.0';
const output = join(currentDir, 'output');

await buildUOS({
  output, appId,
  svgPath: join(currentDir, 'static', 'icon.svg'),
  unpackedDir: join(currentDir, 'static', 'linux-arm64-unpacked'),
  removeTemplateDir: false,
  DesktopInfo: {
    appId, name, version,
    description: 'desc',
  },
  DesktopEntry: {
    Categories: 'dev', //
    Name: name,
    GenericName: name,
    Type: 'Application',
    Exec: `/opt/apps/${appId}/files/${execFileName} %U --no-sandbox`,
    Icon: `${appId}`,
  // MimeType=x-scheme-handler/[URL Scheme];x-scheme-handler/[URL Scheme];
  },
  controlFile: {
    Source: appId,
    Section: 'dev',
    Priority: 'optional',
    Maintainer: 'godaner<[email protected]>',
    // BuildDepends: 'debhelper (>= 11)',
    StandardsVersion: '4.1.3',
    Homepage: 'https://github.com/690591397',
    VcsBrowser: 'https://salsa.debian.org/debian/com.electron.builduos',
    VcsGit: 'https://salsa.debian.org/debian/com.electron.builduos.git',
    Package: appId,
    Architecture: 'any',
    Description: 'desc',
  }
});

项目开发

  1. 克隆项目到本地
  2. 安装依赖:npm install
  3. 搭建构建环境,目前使用 Ubuntu:latest(docker 启动将当前项目共享既可)
  4. 使用 electron 构建 Linux,产出的 unpacked 移动到 static 下(当前执行文件是hello world)
  5. 修改 test 文件的入参
  6. npm run test

贡献

欢迎提交问题和改进的请求。

许可证

该项目基于 MIT 许可证


项目和文档中使用了部分统信UOS官网、技术支持人员提供的内容。