GeezerVison is showing github.com — chore: add new cdn support · LACERBA/lowcode-engine@b3938b6
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: docs/README.md +3-4Lines changed: 3 additions & 4 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -27,8 +27,8 @@ $ yarn build | 27 | 27 | 1. npm run build | 28 | 28 | 2. npm publish # 记得改下版本号,比如 1.0.1 | 29 | 29 |
| 30 | | -# 发布完后执行 tnpm sync | 31 | | -3. tnpm sync | | 30 | +# 发布完后执行 tnpm syncOss 同步到 uipaas CDN | | 31 | +3. tnpm syncOss | 32 | 32 |
| 33 | 33 | 4. 更新 diamond 版本 1.0.1 | 34 | 34 | 5. lowcode-engine.cn 站点生效 | @@ -37,10 +37,9 @@ $ yarn build | 37 | 37 |
| 38 | 38 | ## 功能 | 39 | 39 | - [x] 支持本地离线搜搜 | 40 | | -- [x] 版本化文档管理 | | 40 | +- [x] 版本化文档管理 | 41 | 41 | - [x] 离线静态部署 | 42 | 42 | - [x] 主题(fork 宜搭开发者中心) | 43 | 43 |
| 44 | 44 | ## 使用文档 | 45 | 45 | https://docusaurus.io/zh-CN/docs/docs-introduction | 46 | | - |
Collapse file Copy file name to clipboardExpand all lines: docs/docs/guide/create/useEditor.md +3-1Lines changed: 3 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -80,7 +80,9 @@ sidebar_position: 0 | 80 | 80 | <!-- 低代码引擎官方扩展的主包 --> | 81 | 81 | <script crossorigin="anonymous" src="https://alifd.alicdn.com/npm/@alilc/lowcode-engine-ext@latest/dist/js/engine-ext.js"></script> | 82 | 82 | ``` | 83 | | -> 注:如果 unpkg 的服务比较缓慢,您可以使用 alicdn 来获得确定版本的低代码引擎,如对于引擎的 1.0.1 版本,可用 [https://alifd.alicdn.com/npm/@alilc/[email protected]/dist/js/engine-core.js](https://alifd.alicdn.com/npm/@alilc/[email protected]/dist/js/engine-core.js) | | 83 | +> 注:如果 unpkg 的服务比较缓慢,您可以使用 alicdn 来获得确定版本的低代码引擎,如对于引擎的 1.0.18 版本,可用以下官方 cdn 替代 | | 84 | + | | 85 | +> - [https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.0.18/dist/js/engine-core.js](https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.0.18/dist/js/engine-core.js) | 84 | 86 |
| 85 | 87 |
| 86 | 88 | ### 配置打包 | |
Collapse file Copy file name to clipboardExpand all lines: docs/docs/participate/flow.md +10-5Lines changed: 10 additions & 5 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -70,9 +70,10 @@ sidebar_position: 2 | 70 | 70 | ```bash | 71 | 71 | npm run pub | 72 | 72 | ``` | 73 | | -5. 同步到 tnpm 源 & alifd CDN(此步骤将发布在 npm 源的包同步到阿里内网源,因为 alifd cdn 将依赖内网 npm 源) | | 73 | +5. 同步到 tnpm 源 & alifd CDN & uipaas CDN(此步骤将发布在 npm 源的包同步到阿里内网源,因为 alifd cdn 将依赖内网 npm 源) | 74 | 74 | ```bash | 75 | 75 | tnpm run sync | | 76 | + tnpm run syncOss | 76 | 77 | ``` | 77 | 78 | 6. 更新[发布日志](https://github.com/alibaba/lowcode-engine/releases) | 78 | 79 | 7. 合并 release/x.x.x 到 main 分支 | @@ -102,9 +103,10 @@ sidebar_position: 2 | 102 | 103 | ```bash | 103 | 104 | npm run pub:preminor | 104 | 105 | ``` | 105 | | -5. 同步到 tnpm 源 & alifd CDN | | 106 | +5. 同步到 tnpm 源 & alifd CDN & uipaas CDN | 106 | 107 | ```bash | 107 | 108 | tnpm run sync | | 109 | + tnpm run syncOss | 108 | 110 | ``` | 109 | 111 |
| 110 | 112 | #### 发某 z 位版本首个 beta,如 1.0.1-beta.0 | @@ -129,9 +131,10 @@ sidebar_position: 2 | 129 | 131 | ```bash | 130 | 132 | npm run pub:prepatch | 131 | 133 | ``` | 132 | | -5. 同步到 tnpm 源 & alifd CDN | | 134 | +5. 同步到 tnpm 源 & alifd CDN & uipaas CDN | 133 | 135 | ```bash | 134 | 136 | tnpm run sync | | 137 | + tnpm run syncOss | 135 | 138 | ``` | 136 | 139 |
| 137 | 140 | #### 发某版本非首个 beta,如 1.0.1-beta.0 -> 1.0.1-beta.1 | @@ -151,9 +154,10 @@ sidebar_position: 2 | 151 | 154 | ```bash | 152 | 155 | npm run pub:prerelease | 153 | 156 | ``` | 154 | | -5. 同步到 tnpm 源 & alifd CDN | | 157 | +5. 同步到 tnpm 源 & alifd CDN & uipaas CDN | 155 | 158 | ```bash | 156 | 159 | tnpm run sync | | 160 | + tnpm run syncOss | 157 | 161 | ``` | 158 | 162 |
| 159 | 163 |
| @@ -173,9 +177,10 @@ sidebar_position: 2 | 173 | 177 | ```bash | 174 | 178 | npm publish --tag beta | 175 | 179 | ``` | 176 | | -4. 同步到 tnpm 源 & alifd CDN | | 180 | +4. 同步到 tnpm 源 & alifd CDN & uipaas CDN | 177 | 181 | ```bash | 178 | 182 | tnpm run sync | | 183 | + tnpm run syncOss | 179 | 184 | ``` | 180 | 185 |
| 181 | 186 | **官网生效** | |
Collapse file Copy file name to clipboardExpand all lines: docs/package.json +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 16 | 16 | "serve": "docusaurus serve", | 17 | 17 | "write-translations": "docusaurus write-translations", | 18 | 18 | "write-heading-ids": "docusaurus write-heading-ids", | 19 | | - "typecheck": "tsc" | | 19 | + "typecheck": "tsc", | | 20 | + "syncOss": "node ./scripts/sync-oss.js" | 20 | 21 | }, | 21 | 22 | "dependencies": { | 22 | 23 | "@docusaurus/core": "^2.2.0", | |
Collapse file Copy file name to clipboard +48Lines changed: 48 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +#!/usr/bin/env node | | 2 | +const http = require('http'); | | 3 | +const package = require('../package.json'); | | 4 | +const { version, name } = package; | | 5 | +const options = { | | 6 | + method: 'PUT', | | 7 | + // 暂时使用 日常环境的 uipaas-node,上线后可切换成线上环境 https://uipaas-node.alibaba-inc.com | | 8 | + hostname: 'uipaas-node.alibaba.net', | | 9 | + path: '/staticAssets/cdn/packages', | | 10 | + headers: { | | 11 | + 'Content-Type': 'application/json', | | 12 | + Cookie: 'locale=en-us', | | 13 | + }, | | 14 | + maxRedirects: 20, | | 15 | +}; | | 16 | + | | 17 | +const onResponse = function (res) { | | 18 | + const chunks = []; | | 19 | + res.on('data', (chunk) => { | | 20 | + chunks.push(chunk); | | 21 | + }); | | 22 | + | | 23 | + res.on('end', (chunk) => { | | 24 | + const body = Buffer.concat(chunks); | | 25 | + console.table(JSON.stringify(JSON.parse(body.toString()), null, 2)); | | 26 | + }); | | 27 | + | | 28 | + res.on('error', (error) => { | | 29 | + console.error(error); | | 30 | + }); | | 31 | +}; | | 32 | + | | 33 | +const req = http.request(options, onResponse); | | 34 | + | | 35 | +const postData = JSON.stringify({ | | 36 | + packages: [ | | 37 | + { | | 38 | + packageName: name, | | 39 | + version, | | 40 | + }, | | 41 | + ], | | 42 | + // 可以发布指定源的 npm 包,默认公网 npm | | 43 | + useTnpm: false, | | 44 | +}); | | 45 | + | | 46 | +req.write(postData); | | 47 | + | | 48 | +req.end(); |
Collapse file Copy file name to clipboardExpand all lines: package.json +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 32 | 32 | "test": "lerna run test --stream", | 33 | 33 | "test:snapshot": "lerna run test:snapshot", | 34 | 34 | "watchdog:build": "node ./scripts/watchdog.js", | 35 | | - "sync": "./scripts/sync.sh" | | 35 | + "sync": "./scripts/sync.sh", | | 36 | + "syncOss": "node ./scripts/sync-oss.js" | 36 | 37 | }, | 37 | 38 | "husky": { | 38 | 39 | "hooks": { | |
Collapse file Copy file name to clipboardExpand all lines: packages/engine/README-zh_CN.md +16-9Lines changed: 16 additions & 9 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -97,26 +97,33 @@ init(document.getElementById('lce')); | 97 | 97 | ### cdn 可选方式: | 98 | 98 | #### 方式 1(推荐):alifd cdn | 99 | 99 | ```html | 100 | | - | | 100 | + | 101 | 101 |
| 102 | | -https://alifd.alicdn.com/npm/@alilc/ [email protected]. 0/dist/js/react-simulator-renderer.js | | 102 | +https://alifd.alicdn.com/npm/@alilc/ [email protected]. 18/dist/js/react-simulator-renderer.js | 103 | 103 | ``` | 104 | 104 |
| 105 | | -#### 方式 2:unpkg | | 105 | +#### 方式 2(推荐):uipaas cdn | 106 | 106 | ```html | 107 | | -https://unpkg.com/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js | | 107 | +https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.0.18/dist/js/engine-core.js | 108 | 108 |
| 109 | | -https://unpkg.com/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js | | 109 | +https://uipaas-assets.com/prod/npm/@alilc/lowcode-react-simulator-renderer/1.0.18/dist/js/react-simulator-renderer.js | 110 | 110 | ``` | 111 | 111 |
| 112 | | -#### 方式 3:jsdelivr | | 112 | +#### 方式 3:unpkg | 113 | 113 | ```html | 114 | | - | | 114 | + | 115 | 115 |
| 116 | | -https:// cdn.jsdelivr.net/npm/@alilc/ [email protected]. 0/dist/js/react-simulator-renderer.js | | 116 | + | 117 | 117 | ``` | 118 | 118 |
| 119 | | -#### 方式 4:使用自有 cdn | | 119 | +#### 方式 4:jsdelivr | | 120 | +```html | | 121 | + | | 122 | + | | 123 | +https://cdn.jsdelivr.net/npm/@alilc/ [email protected]/dist/js/react-simulator-renderer.js | | 124 | +``` | | 125 | + | | 126 | +#### 方式 5:使用自有 cdn | 120 | 127 | 将源码中 packages/engine/dist 和 packages/(react|rax)-simulator-renderer/dist 下的文件传至你的 cdn 提供商 | 121 | 128 |
| 122 | 129 | ## 🔗 相关链接 | |
Collapse file Copy file name to clipboardExpand all lines: packages/engine/README.md +16-9Lines changed: 16 additions & 9 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -97,26 +97,33 @@ init(document.getElementById('lce')); | 97 | 97 | ### cdn optional method: | 98 | 98 | #### Method 1: alifd cdn | 99 | 99 | ```html | 100 | | - | | 100 | + | 101 | 101 |
| 102 | | -https://alifd.alicdn.com/npm/@alilc/ [email protected]. 0/dist/js/react-simulator-renderer.js | | 102 | +https://alifd.alicdn.com/npm/@alilc/ [email protected]. 18/dist/js/react-simulator-renderer.js | 103 | 103 | ``` | 104 | 104 |
| 105 | | -#### Method 2: unpkg | | 105 | +#### Method 2: uipaas cdn | 106 | 106 | ```html | 107 | | -https://unpkg.com/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js | | 107 | +https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.0.18/dist/js/engine-core.js | 108 | 108 |
| 109 | | -https://unpkg.com/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js | | 109 | +https://uipaas-assets.com/prod/npm/@alilc/lowcode-react-simulator-renderer/1.0.18/dist/js/react-simulator-renderer.js | 110 | 110 | ``` | 111 | 111 |
| 112 | | -#### Method 3: jsdelivr | | 112 | +#### Method 3: unpkg | 113 | 113 | ```html | 114 | | - | | 114 | + | 115 | 115 |
| 116 | | -https:// cdn.jsdelivr.net/npm/@alilc/ [email protected]. 0/dist/js/react-simulator-renderer.js | | 116 | + | 117 | 117 | ``` | 118 | 118 |
| 119 | | -#### Method 4: Use your own cdn | | 119 | +#### Method 4: jsdelivr | | 120 | +```html | | 121 | + | | 122 | + | | 123 | +https://cdn.jsdelivr.net/npm/@alilc/ [email protected]/dist/js/react-simulator-renderer.js | | 124 | +``` | | 125 | + | | 126 | +#### Method 5: Use your own cdn | 120 | 127 | Pass the files under packages/engine/dist and packages/(react|rax)-simulator-renderer/dist in the source code to your cdn provider | 121 | 128 |
| 122 | 129 | ## 🔗 Related Links | |
Collapse file Copy file name to clipboard +48Lines changed: 48 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +#!/usr/bin/env node | | 2 | +const http = require('http'); | | 3 | +const package = require('../packages/engine/package.json'); | | 4 | +const { version, name } = package; | | 5 | +const options = { | | 6 | + method: 'PUT', | | 7 | + // 暂时使用 日常环境的 uipaas-node,上线后可切换成线上环境 https://uipaas-node.alibaba-inc.com | | 8 | + hostname: 'uipaas-node.alibaba.net', | | 9 | + path: '/staticAssets/cdn/packages', | | 10 | + headers: { | | 11 | + 'Content-Type': 'application/json', | | 12 | + Cookie: 'locale=en-us', | | 13 | + }, | | 14 | + maxRedirects: 20, | | 15 | +}; | | 16 | + | | 17 | +const onResponse = function (res) { | | 18 | + const chunks = []; | | 19 | + res.on('data', (chunk) => { | | 20 | + chunks.push(chunk); | | 21 | + }); | | 22 | + | | 23 | + res.on('end', (chunk) => { | | 24 | + const body = Buffer.concat(chunks); | | 25 | + console.table(JSON.stringify(JSON.parse(body.toString()), null, 2)); | | 26 | + }); | | 27 | + | | 28 | + res.on('error', (error) => { | | 29 | + console.error(error); | | 30 | + }); | | 31 | +}; | | 32 | + | | 33 | +const req = http.request(options, onResponse); | | 34 | + | | 35 | +const postData = JSON.stringify({ | | 36 | + packages: [ | | 37 | + { | | 38 | + packageName: name, | | 39 | + version, | | 40 | + }, | | 41 | + ], | | 42 | + // 可以发布指定源的 npm 包,默认公网 npm | | 43 | + useTnpm: false, | | 44 | +}); | | 45 | + | | 46 | +req.write(postData); | | 47 | + | | 48 | +req.end(); |
|