Skip to content

Commit

Permalink
chore: add new cdn support
Browse files Browse the repository at this point in the history
  • Loading branch information
JackLian committed Dec 21, 2022
1 parent 5fcb958 commit 65ace4c
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 7 deletions.
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
#### @alilc/lowcode-engine-ext
### @alilc/lowcode-engine-ext

#### 简介
lowcode-engine-ext 是阿里低代码引擎官方提供的setter和setter必须依赖的插件集合
### 简介
lowcode-engine-ext 是阿里低代码引擎官方提供的 setter 和 setter 必须依赖的插件集合

setter(设置器)是用来展示每个物料的属性,[setter使用说明手册](https://www.yuque.com/lce/doc/cl03wo_nmhznb) [官方setter列表说明](https://www.yuque.com/lce/doc/oc220p#fl46)
setter(设置器) 是用来展示每个物料的属性,[setter使用说明手册](https://www.yuque.com/lce/doc/cl03wo_nmhznb) [官方setter列表说明](https://www.yuque.com/lce/doc/oc220p#fl46)

### 使用方式

使用 CDN 方式引用,下方是官方提供的两个稳定 CDN

#### 方式 1:alifd cdn
1: alifd cdn
```html
https://alifd.alicdn.com/npm/@alilc/[email protected]/dist/css/engine-ext.css

https://alifd.alicdn.com/npm/@alilc/[email protected]/dist/js/engine-ext.js
```

#### 方式 2: uipaas cdn
```html
https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.5/dist/css/engine-ext.css

https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.5/dist/js/engine-ext.js
```
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"stylelint": "stylelint \"**/*.{css,scss,less}\"",
"lint": "npm run eslint && npm run stylelint",
"f2elint-scan": "f2elint scan -q",
"f2elint-fix": "f2elint fix"
"f2elint-fix": "f2elint fix",
"syncOss": "node ./scripts/sync-oss.js"
},
"keywords": [
"ice",
Expand Down Expand Up @@ -70,5 +71,6 @@
"registry": "https://registry.npmjs.org/"
},
"license": "MIT",
"homepage": "https://unpkg.com/@alilc/[email protected]/build/index.html"
}
"homepage": "https://unpkg.com/@alilc/[email protected]/build/index.html",
"repository": "[email protected]:alibaba/lowcode-engine-ext.git"
}
48 changes: 48 additions & 0 deletions scripts/sync-oss.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env node
const http = require('http');
const package = require('../package.json');
const { version, name } = package;
const options = {
method: 'PUT',
// 暂时使用 日常环境的 uipaas-node,上线后可切换成线上环境 https://uipaas-node.alibaba-inc.com
hostname: 'uipaas-node.alibaba.net',
path: '/staticAssets/cdn/packages',
headers: {
'Content-Type': 'application/json',
Cookie: 'locale=en-us',
},
maxRedirects: 20,
};

const onResponse = function (res) {
const chunks = [];
res.on('data', (chunk) => {
chunks.push(chunk);
});

res.on('end', (chunk) => {
const body = Buffer.concat(chunks);
console.table(JSON.stringify(JSON.parse(body.toString()), null, 2));
});

res.on('error', (error) => {
console.error(error);
});
};

const req = http.request(options, onResponse);

const postData = JSON.stringify({
packages: [
{
packageName: name,
version,
},
],
// 可以发布指定源的 npm 包,默认公网 npm
useTnpm: false,
});

req.write(postData);

req.end();

0 comments on commit 65ace4c

Please sign in to comment.