Skip to content

Commit b329ea8

Browse files
committed
merge qiniu/master
1 parent 5c7686f commit b329ea8

File tree

132 files changed

+59180
-62281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+59180
-62281
lines changed

.eslintignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/src/__mock__
22
/src/__tests__
3-
/test/*
3+
/test/
4+
node_modules
45
dist
5-
site
6+
esm
7+
umd
68
*.js
9+
*.d.ts
10+
*.test.ts

.eslintrc.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
module.exports = {
2-
extends: [
3-
'@qiniu'
4-
],
5-
settings: {
6-
"import/resolver": {
7-
node: {
8-
extensions: ['.js', '.ts'],
9-
moduleDirectory: ['node_modules', 'src/']
10-
}
11-
}
2+
root: true,
3+
extends: ['@qiniu'],
4+
parserOptions: {
5+
tsconfigRootDir: __dirname,
6+
project: ['./packages/*/tsconfig.json'],
127
}
138
}

.github/workflows/dev-check.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ jobs:
1010
- uses: actions/setup-node@v3
1111
with:
1212
cache: 'npm'
13-
node-version: 12
13+
node-version: 16
1414
- run: npm install
15+
- run: npm run boot
1516
- run: npm run lint
1617
test:
1718
runs-on: ubuntu-latest
@@ -20,8 +21,9 @@ jobs:
2021
- uses: actions/setup-node@v3
2122
with:
2223
cache: 'npm'
23-
node-version: 12
24+
node-version: 16
2425
- run: npm install
26+
- run: npm run boot
2527
- run: npm run test
2628
build:
2729
runs-on: ubuntu-latest
@@ -30,6 +32,7 @@ jobs:
3032
- uses: actions/setup-node@v3
3133
with:
3234
cache: 'npm'
33-
node-version: 12
35+
node-version: 16
3436
- run: npm install
37+
- run: npm run boot
3538
- run: npm run build

.github/workflows/npm-publish.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ jobs:
1111
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3
1313
with:
14-
node-version: 12
14+
node-version: 16
1515
registry-url: https://registry.npmjs.org/
1616
- run: npm install
17+
- run: npm run boot
1718
- run: npm run build
19+
- run: cd packages/qiniu-js/
1820
- run: npm publish
1921
env:
2022
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.gitignore

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
.DS_Store
22
.vscode
33
node_modules
4-
bower_components
5-
demo/config.js
6-
deploy.sh
7-
npm-debug.log
8-
dist
9-
test/config.json
104
coverage
11-
lib
12-
esm

.npmignore

Lines changed: 0 additions & 9 deletions
This file was deleted.

README.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -463,25 +463,17 @@ qiniu.compressImage(file, options).then(data => {
463463

464464
<a id="demo"></a>
465465

466-
### 运行示例
467-
468-
1. 进入 test 目录,按照目录下的 `config.json.example` 示例,创建 `config.json` 文件,其中,`Access Key``Secret Key` 按如下方式获取
469-
470-
* [开通七牛开发者帐号](https://portal.qiniu.com/signup)
471-
* [登录七牛开发者自助平台,查看 AccessKey 和 SecretKey](https://portal.qiniu.com/user/key) 。
472-
473-
```javascript
474-
{
475-
"AccessKey": "<Your Access Key>",
476-
"SecretKey": "<Your Secret Key>",
477-
"Bucket": "<Your Bucket Name>",
478-
"Port": 9000,
479-
"UptokenUrl": "<Your Uptoken_Url>", // demo 启动后会在本地 /uptoken 上提供获取 uptoken 的接口,所以这里可以填 'token'
480-
"Domain": "<Your Bucket Domain>" // Bucket 的外链默认域名,在 Bucket 的内容管理里查看,如:'http://xxx.bkt.clouddn.com/'
481-
}
482-
```
466+
### 本地开发
467+
468+
```bash
469+
$ git clone [email protected]:qiniu/js-sdk.git
470+
$ cd js-sdk/
471+
$ npm install
472+
$ npm run boot
473+
$ npm run dev
474+
```
483475

484-
2. 进入项目根目录,执行 `npm install` 安装依赖库,然后打开两个终端,一个执行 `npm run serve` 跑 server, 一个执行 `npm run dev` 运行服务;demo1:`http://0.0.0.0:8080/test/demo1`;demo3:`http://0.0.0.0:8080/test/demo3`;demo1为测试上传功能的示例,demo3为测试图片压缩功能的示例;demo2 为测试 es6 语法的示例,进入 demo2 目录,执行 `npm install`,然后 `npm start` 运行 demo2;demo1、demo2 和 demo3 都共用一个 server,请注意 server 文件里的 `region` 设置跟 `config` 里的`region` 设置要保持一致
476+
打开您的浏览器并访问终端中提示的地址即可访问开发调试页面
485477

486478
<a id="note"></a>
487479

jest.config.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
function getProjectConfig(name) {
2+
return {
3+
displayName: name,
4+
testEnvironment: 'jsdom',
5+
transform: {
6+
".ts": 'ts-jest'
7+
},
8+
testMatch: [`<rootDir>/packages/${name}/src/**/*.test.ts`],
9+
}
10+
}
11+
112
module.exports = {
2-
transform: {
3-
".ts": 'ts-jest'
4-
},
5-
testRegex: '.+\\.test\\.ts$',
6-
testPathIgnorePatterns: [
7-
"esm",
8-
"lib",
9-
"examples",
10-
"node_modules"
13+
projects: [
14+
getProjectConfig('qiniu-js'),
15+
getProjectConfig('doc-site')
1116
]
12-
};
17+
}

js-sdk.code-workspace

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"folders": [
3+
{
4+
"name": "✨ root",
5+
"path": "."
6+
},
7+
{
8+
"name": "📦 qiniu-js",
9+
"path": "packages/qiniu-js"
10+
},
11+
{
12+
"name": "📦 doc-site",
13+
"path": "packages/doc-site"
14+
},
15+
],
16+
"settings": {
17+
"cSpell.words": [
18+
"cacheable",
19+
"dumi",
20+
"exif",
21+
"iife",
22+
"Mogr",
23+
"umijs",
24+
"Uphost"
25+
],
26+
"typescript.tsdk": "✨ root/node_modules/typescript/lib"
27+
}
28+
}

lerna.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"packages": [
3+
"packages/*"
4+
],
5+
"useNx": false,
6+
"npmClient": "npm",
7+
"version": "independent"
8+
}

0 commit comments

Comments
 (0)