Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7a2740b
refactor: 重构
Dec 30, 2024
21c48da
style: 统一代码风格,调整引号和格式
Dec 30, 2024
f1fe3be
chore: 添加 .npmrc 文件以配置 npm 注册表
Dec 30, 2024
867561c
fix: 更新$app类型以包含更多应用名称
Dec 30, 2024
3182f55
feat: 添加对拉取请求的支持,发布预览版本
Dec 30, 2024
a4ccbe1
chore: 移除发布预览作业中的权限设置
Dec 30, 2024
abc5541
chore: 更新发布预览作业的权限设置以支持包写入和内容读取
Dec 30, 2024
1286fdb
fix: 修正发布预览版本的版本号格式
Dec 30, 2024
5515b5f
feat: 添加预览工作流以支持拉取请求的版本发布
Dec 30, 2024
0a00ec4
fix: 更新预览版本命令以禁用 Git 标签版本创建
Dec 30, 2024
e78ab8b
fix: 更新预览工作流以简化 npm 发布标签格式
Dec 30, 2024
9c195f5
chore: 删除 .npmrc 文件以移除不必要的 npm 注册表配置
Dec 30, 2024
6b48c5b
chore: 移除预览工作流中的 npm 注册表配置
Dec 30, 2024
3a49d0e
chore: 在预览工作流中添加 npm 注册表配置
Dec 30, 2024
79f7ed3
fix: 在预览工作流中添加 NPM_TOKEN 环境变量以确保 npm 发布成功
Dec 30, 2024
667eab2
fix: 更新预览工作流以使用 NODE_AUTH_TOKEN 进行 npm 发布
Dec 30, 2024
2c186bb
fix: 更新预览工作流以使用 secrets.NODE_AUTH_TOKEN 进行 npm 发布
Dec 30, 2024
2d8f51b
Merge pull request #2 from baranwang/main
baranwang Dec 30, 2024
e728d1e
fix: 在预览工作流中将 npm 发布的 NODE_AUTH_TOKEN 环境变量移至运行命令中
Dec 30, 2024
111093d
fix: 更新预览工作流中的 npm 版本命令以移除 PR 编号
Dec 30, 2024
2361715
fix: 更新预览工作流以使用 NPM_TOKEN 替代 NODE_AUTH_TOKEN
Dec 30, 2024
29b4322
refactor: 移除 lodash 依赖,使用 type-fest 和自定义 polyfill 实现
Jan 2, 2025
faba88e
refactor: 将 Storage 类中的文件操作改为异步加载和写入
Jan 3, 2025
e3a1dbb
fix: 修改 StorageClass 中的 Node.js 模块导入方式以符合规范
Jan 3, 2025
3805ede
feat: 添加 Node.js 的 fetch polyfill 和 Storage 类定义
baranwang Jan 5, 2025
4322154
fix: 更新预览工作流以允许对拉取请求的写入权限
baranwang Jan 5, 2025
657bea2
fix: 更新预览工作流以包含 npm 安装指令和版本信息
baranwang Jan 5, 2025
7a02d69
fix: 更新预览工作流中的评论格式以正确显示版本信息和安装指令
baranwang Jan 5, 2025
7ca448c
fix: 修复预览工作流中的评论格式以正确显示安装指令
baranwang Jan 5, 2025
f0c4a21
fix: 修复预览工作流中的评论格式以正确显示安装指令
baranwang Jan 5, 2025
496502c
fix: 移除 package.json 中的模块导出配置并更新构建流程以重命名输出文件
baranwang Jan 11, 2025
3ebfb78
feat: 添加等待和时间格式化功能,重构模块导出结构
baranwang Jan 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: preview

on:
pull_request:
types:
- opened
- synchronize # Trigger on every push to the PR

jobs:
preview:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: |
COMMIT_SHA=${{ github.sha }}
npm version 0.0.0-preview-${COMMIT_SHA::7} --no-git-tag-version
- run: npm publish --tag preview-${{ github.event.number }} --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: |
VERSION=$(node -p "require('./package.json').version")
PR_NUMBER=${{ github.event.pull_request.number }}
COMMENT_BODY="Preview version \`$VERSION\` published to npm. To install, run:
\`\`\`bash
npm install @nsnanocat/util@$VERSION
\`\`\`"
gh pr comment $PR_NUMBER --body "$COMMENT_BODY"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40 changes: 0 additions & 40 deletions .github/workflows/release-package-to-github.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Node.js Package to NPM Registry
name: Release

on:
push:
Expand All @@ -7,22 +7,14 @@ on:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- run: npm ci
- run: npm test

publish-gpr:
needs: build
publish:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
strategy:
matrix:
registry: ["https://registry.npmjs.org", "https://npm.pkg.github.com"]
steps:
- uses: actions/checkout@v4
- name: Update local package.json version from release tag
Expand All @@ -33,9 +25,9 @@ jobs:
ignore-semver-check: "false" # If set to "true", will not check if the version number is a valid semver version.
- uses: actions/setup-node@v4
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
node-version: 20
registry-url: ${{ matrix.registry }}
- run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ matrix.registry == 'https://registry.npmjs.org' && secrets.NPM_TOKEN || secrets.GITHUB_TOKEN }}
123 changes: 49 additions & 74 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,78 +1,53 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"files": {
"ignore": [
"**/*.bundle.js"
],
"ignoreUnknown": false
},
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"organizeImports": {
"enabled": true
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"formatter": {
"enabled": true,
"useEditorconfig": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 120,
"attributePosition": "auto",
"bracketSpacing": true
},
"javascript": {
"formatter": {
"enabled": true,
"indentStyle": "tab",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 320
},
"javascript": {
"formatter": {
"arrowParentheses": "asNeeded",
"bracketSameLine": true,
"quoteStyle": "double"
}
},
"json": {
"parser": {
"allowComments": true,
"allowTrailingCommas": true
}
},
"linter": {
"enabled": true,
"rules": {
"complexity": {
"noForEach": "off",
"noStaticOnlyClass": "off",
"noUselessSwitchCase": "off",
"useArrowFunction": "info",
"useFlatMap": "off",
"useLiteralKeys": "info"
},
"correctness": {
"noInnerDeclarations": "info",
"noSelfAssign": "off",
"noSwitchDeclarations": "info",
"noUnsafeOptionalChaining": "info"
},
"performance": {
"noDelete": "info"
},
"recommended": true,
"style": {
"noNegationElse": "off",
"noParameterAssign": "off",
"noUselessElse": "off",
"noVar": "info",
"useDefaultParameterLast": "info",
"useForOf": "error",
"useNodejsImportProtocol": "error",
"useNumberNamespace": "error",
"useSingleVarDeclarator": "off"
},
"suspicious": {
"noAssignInExpressions": "info",
"noDoubleEquals": "info",
"noFallthroughSwitchClause": "info",
"noGlobalIsNan": "off",
"useDefaultSwitchClauseLast": "off"
}
}
},
"organizeImports": {
"enabled": true
},
"vcs": {
"clientKind": "git",
"enabled": true,
"useIgnoreFile": true
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "all",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto",
"bracketSpacing": true
}
},
"css": {
"parser": {
"cssModules": true
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noUselessSwitchCase": "off",
"noForEach": "off"
},
"suspicious": {
"noExplicitAny": "warn"
}
}
}
}
98 changes: 0 additions & 98 deletions getStorage.mjs

This file was deleted.

11 changes: 0 additions & 11 deletions index.js

This file was deleted.

26 changes: 0 additions & 26 deletions lib/app.mjs

This file was deleted.

Loading