libantosdk: do not includes sdk api to package, API files shall be featched from delivery page

This commit is contained in:
DanyLE 2023-05-30 13:30:05 +02:00
parent d011b004ec
commit 77258bd48b
14 changed files with 101 additions and 72236 deletions

View File

@ -2,6 +2,7 @@
AntOSDK: development API for AntOS based applications/projects AntOSDK: development API for AntOS based applications/projects
## Change logs ## Change logs
- 0.1.0: antOS SDK is no longer delivered in this package, it will be fetched directly from AntOS release site
- 0.0.18: Add some public API on grid view - 0.0.18: Add some public API on grid view
- 0.0.17: Use lastest AntOS d.ts file - 0.0.17: Use lastest AntOS d.ts file
- 0.0.16: Fix jquery encoding error - 0.0.16: Fix jquery encoding error

View File

@ -30,8 +30,10 @@
"data": ["build","build/debug","build/release"] "data": ["build","build/debug","build/release"]
}, },
{ {
"name": "ts-import", "name": "ts-antos-sdk",
"data": ["core/ts/core.d.ts", "core/ts/jquery.d.ts","core/ts/antos.d.ts"] "data": {
"version": "2.0.x"
}
}, },
{ {
"name": "ts-compile", "name": "ts-compile",

View File

@ -2,6 +2,7 @@
AntOSDK: development API for AntOS based applications/projects AntOSDK: development API for AntOS based applications/projects
## Change logs ## Change logs
- 0.1.0: antOS SDK is no longer delivered in this package, it will be fetched directly from AntOS release site
- 0.0.18: Add some public API on grid view - 0.0.18: Add some public API on grid view
- 0.0.17: Use lastest AntOS d.ts file - 0.0.17: Use lastest AntOS d.ts file
- 0.0.16: Fix jquery encoding error - 0.0.16: Fix jquery encoding error

View File

@ -1,7 +1,7 @@
importScripts('typescript.min.js'); importScripts('typescript.min.js');
const tslib = {}; const tslib = {};
const SDK_URL = "https://ci.iohub.dev/public/antos-release/sdk";
class TSJob extends AntOSDKBaseJob { class TSJob extends AntOSDKBaseJob {
constructor(data) constructor(data)
@ -22,6 +22,9 @@ class TSJob extends AntOSDKBaseJob {
case 'ts-compile': case 'ts-compile':
this.compile(); this.compile();
break; break;
case 'ts-antos-sdk':
this.load_sdk();
break;
default: default:
const err_msg = `Unkown job ${this.job.cmd}`; const err_msg = `Unkown job ${this.job.cmd}`;
this.log_error(err_msg); this.log_error(err_msg);
@ -54,6 +57,44 @@ class TSJob extends AntOSDKBaseJob {
this.error(e); this.error(e);
}); });
} }
async load_sdk()
{
let version = "master";
if(this.job.data && this.job.data.version)
{
version = this.job.data.version;
}
const files = [
`${SDK_URL}/${version}/core.d.ts`,
`${SDK_URL}/${version}/jquery.d.ts`,
`${SDK_URL}/${version}/antos.d.ts`,
];
try{
const promises = [];
const load = [];
for(let file of files)
{
if(!tslib[file])
{
load.push(file);
this.log_info(`Loading library ${file}`);
promises.push(this.get(file, undefined));
}
}
const results = await Promise.all(promises);
for(let i in load)
{
const lib = load[i];
tslib[lib] = ts.createSourceFile(lib, results[i], ts.ScriptTarget.Latest);
this.log_info(`Typescript library ${lib} loaded`);
}
this.result("Typescript libraries loaded");
}
catch(e)
{
this.log_error(e.toString());
}
}
compile() compile()
{ {
let files = []; let files = [];
@ -140,3 +181,4 @@ class TSJob extends AntOSDKBaseJob {
API.jobhandle["ts-import"] = TSJob; API.jobhandle["ts-import"] = TSJob;
API.jobhandle["ts-compile"] = TSJob; API.jobhandle["ts-compile"] = TSJob;
API.jobhandle["ts-antos-sdk"] = TSJob;

View File

@ -7,7 +7,7 @@
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"email": "mrsang@iohub.dev" "email": "mrsang@iohub.dev"
}, },
"version": "0.0.18-a", "version": "0.1.0-b",
"category": "Development", "category": "Development",
"iconclass": "fa fa-cog", "iconclass": "fa fa-cog",
"mimes": [ "mimes": [

View File

@ -1,12 +1,12 @@
<afx-app-window apptitle="__(AntOSDK Builder)" width="600" height="500" data-id="SDKBuilder"> <afx-app-window apptitle="__(AntOSDK Builder)" width="600" height="500" data-id="SDKBuilder">
<afx-hbox> <afx-hbox padding="10">
<afx-vbox data-width="150"> <afx-vbox data-width="150">
<div data-height="10"></div> <div data-height="10"></div>
<afx-list-view data-id="target-list"></afx-list-view> <afx-list-view data-id="target-list"></afx-list-view>
<div data-height="5"></div> <div data-height="5"></div>
<afx-hbox data-height="23" style="text-align: left;"> <afx-hbox data-height="23" style="text-align: left;">
<afx-button data-id="btnopen" data-width="25" iconclass ="bi bi-file-arrow-up-fill"></afx-button> <afx-button data-id="btnopen" data-width="content" iconclass ="bi bi-file-arrow-up-fill"></afx-button>
<afx-button data-id="btnrefresh" data-width="25" iconclass ="fa fa-refresh"></afx-button> <afx-button data-id="btnrefresh" data-width="content" iconclass ="fa fa-refresh"></afx-button>
<afx-button data-id="btnbuild" text="__(Run)"></afx-button> <afx-button data-id="btnbuild" text="__(Run)"></afx-button>
<div data-width="5"></div> <div data-width="5"></div>
</afx-hbox> </afx-hbox>

View File

@ -1,7 +1,7 @@
importScripts('typescript.min.js'); importScripts('typescript.min.js');
const tslib = {}; const tslib = {};
const SDK_URL = "https://ci.iohub.dev/public/antos-release/sdk";
class TSJob extends AntOSDKBaseJob { class TSJob extends AntOSDKBaseJob {
constructor(data) constructor(data)
@ -22,6 +22,9 @@ class TSJob extends AntOSDKBaseJob {
case 'ts-compile': case 'ts-compile':
this.compile(); this.compile();
break; break;
case 'ts-antos-sdk':
this.load_sdk();
break;
default: default:
const err_msg = `Unkown job ${this.job.cmd}`; const err_msg = `Unkown job ${this.job.cmd}`;
this.log_error(err_msg); this.log_error(err_msg);
@ -54,6 +57,44 @@ class TSJob extends AntOSDKBaseJob {
this.error(e); this.error(e);
}); });
} }
async load_sdk()
{
let version = "master";
if(this.job.data && this.job.data.version)
{
version = this.job.data.version;
}
const files = [
`${SDK_URL}/${version}/core.d.ts`,
`${SDK_URL}/${version}/jquery.d.ts`,
`${SDK_URL}/${version}/antos.d.ts`,
];
try{
const promises = [];
const load = [];
for(let file of files)
{
if(!tslib[file])
{
load.push(file);
this.log_info(`Loading library ${file}`);
promises.push(this.get(file, undefined));
}
}
const results = await Promise.all(promises);
for(let i in load)
{
const lib = load[i];
tslib[lib] = ts.createSourceFile(lib, results[i], ts.ScriptTarget.Latest);
this.log_info(`Typescript library ${lib} loaded`);
}
this.result("Typescript libraries loaded");
}
catch(e)
{
this.log_error(e.toString());
}
}
compile() compile()
{ {
let files = []; let files = [];
@ -140,3 +181,4 @@ class TSJob extends AntOSDKBaseJob {
API.jobhandle["ts-import"] = TSJob; API.jobhandle["ts-import"] = TSJob;
API.jobhandle["ts-compile"] = TSJob; API.jobhandle["ts-compile"] = TSJob;
API.jobhandle["ts-antos-sdk"] = TSJob;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"email": "mrsang@iohub.dev" "email": "mrsang@iohub.dev"
}, },
"version": "0.0.18-a", "version": "0.1.0-b",
"category": "Development", "category": "Development",
"iconclass": "fa fa-cog", "iconclass": "fa fa-cog",
"mimes": [ "mimes": [

View File

@ -1,12 +1,12 @@
<afx-app-window apptitle="__(AntOSDK Builder)" width="600" height="500" data-id="SDKBuilder"> <afx-app-window apptitle="__(AntOSDK Builder)" width="600" height="500" data-id="SDKBuilder">
<afx-hbox> <afx-hbox padding="10">
<afx-vbox data-width="150"> <afx-vbox data-width="150">
<div data-height="10"></div> <div data-height="10"></div>
<afx-list-view data-id="target-list"></afx-list-view> <afx-list-view data-id="target-list"></afx-list-view>
<div data-height="5"></div> <div data-height="5"></div>
<afx-hbox data-height="23" style="text-align: left;"> <afx-hbox data-height="23" style="text-align: left;">
<afx-button data-id="btnopen" data-width="25" iconclass ="bi bi-file-arrow-up-fill"></afx-button> <afx-button data-id="btnopen" data-width="content" iconclass ="bi bi-file-arrow-up-fill"></afx-button>
<afx-button data-id="btnrefresh" data-width="25" iconclass ="fa fa-refresh"></afx-button> <afx-button data-id="btnrefresh" data-width="content" iconclass ="fa fa-refresh"></afx-button>
<afx-button data-id="btnbuild" text="__(Run)"></afx-button> <afx-button data-id="btnbuild" text="__(Run)"></afx-button>
<div data-width="5"></div> <div data-width="5"></div>
</afx-hbox> </afx-hbox>

View File

@ -225,7 +225,7 @@
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/2.0.x/libantosdk/README.md", "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/2.0.x/libantosdk/README.md",
"category": "Development", "category": "Development",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.0.18-a", "version": "0.1.0-b",
"dependencies": [], "dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/2.0.x/libantosdk/build/release/libantosdk.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/2.0.x/libantosdk/build/release/libantosdk.zip"
}, },