clickgo 3.1.6-dev15 → 3.1.8-dev17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ClickGo
2
2
 
3
- <p align="center"><img src="dist/icon.png" width="100" height="100" alt="ClickGo"></p>
3
+ <p align="center"><img src="dist/icon.png" width="68" height="68" alt="ClickGo"></p>
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/clickgo.svg?colorB=brightgreen)](https://www.npmjs.com/package/clickgo "Stable Version")
6
6
  [![npm version](https://img.shields.io/npm/v/clickgo/dev.svg)](https://www.npmjs.com/package/clickgo "Development Version")
@@ -19,7 +19,7 @@ Load the module loader first, and then load it using the module loader.
19
19
  **index.html**
20
20
 
21
21
  ```html
22
- <script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.4.6/dist/loader.min.js?path=index&npm={'clickgo':'3.1.6-dev15'}"></script>
22
+ <script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.4.6/dist/loader.min.js?path=index&npm={'clickgo':'3.1.7-dev16'}"></script>
23
23
  ```
24
24
 
25
25
  **index.js**
package/dist/index.js CHANGED
@@ -114,7 +114,6 @@ function launcher(boot) {
114
114
  const files = yield loader.sniffFiles('clickgo.js', {
115
115
  'dir': __dirname + '/',
116
116
  'after': after,
117
- 'afterIgnore': new RegExp('^' + loader.cdn.replace(/\./g, '\\.')),
118
117
  'map': map,
119
118
  'load': (url) => {
120
119
  boot.onRuntimeFileLoad(url);
@@ -128,7 +127,7 @@ function launcher(boot) {
128
127
  'map': map
129
128
  })[0];
130
129
  try {
131
- const style = yield (yield fetch(__dirname + '/global.css' + (!__dirname.startsWith(loader.cdn) ? after : ''))).text();
130
+ const style = yield (yield fetch(__dirname + '/global.css')).text();
132
131
  (_a = document.getElementById('cg-global')) === null || _a === void 0 ? void 0 : _a.insertAdjacentHTML('afterbegin', style);
133
132
  }
134
133
  catch (_b) {
package/dist/index.ts CHANGED
@@ -186,7 +186,6 @@ export function launcher(boot: AbstractBoot): void {
186
186
  const files = await loader.sniffFiles('clickgo.js', {
187
187
  'dir': __dirname + '/',
188
188
  'after': after,
189
- 'afterIgnore': new RegExp('^' + loader.cdn.replace(/\./g, '\\.')),
190
189
  'map': map,
191
190
  'load': (url) => {
192
191
  boot.onRuntimeFileLoad(url) as any;
@@ -201,7 +200,7 @@ export function launcher(boot: AbstractBoot): void {
201
200
  })[0] as typeof import('../dist/clickgo');
202
201
  // --- 加载 clickgo 的 global css ---
203
202
  try {
204
- const style = await (await fetch(__dirname + '/global.css' + (!__dirname.startsWith(loader.cdn) ? after : ''))).text();
203
+ const style = await (await fetch(__dirname + '/global.css')).text();
205
204
  document.getElementById('cg-global')?.insertAdjacentHTML('afterbegin', style);
206
205
  }
207
206
  catch {
package/dist/lib/fs.js CHANGED
@@ -129,14 +129,14 @@ function getContent(path, options, taskId) {
129
129
  headers['range'] = `bytes=${start === undefined ? '0' : start}-${end === undefined ? '' : end}`;
130
130
  }
131
131
  if (options.progress) {
132
- blob = yield tool.request(ourl + '?' + rand, {
132
+ blob = yield tool.request(ourl + (!ourl.startsWith(loader.cdn) ? ('?' + rand) : ''), {
133
133
  'headers': headers,
134
134
  'progress': options.progress,
135
135
  'responseType': 'blob'
136
136
  });
137
137
  }
138
138
  else {
139
- blob = yield (yield fetch(ourl + '?' + rand, {
139
+ blob = yield (yield fetch(ourl + (!ourl.startsWith(loader.cdn) ? ('?' + rand) : ''), {
140
140
  'headers': headers
141
141
  })).blob();
142
142
  }
@@ -412,7 +412,7 @@ function getClickGoStats(path) {
412
412
  }
413
413
  else {
414
414
  try {
415
- const res = yield fetch(tool.urlResolve(__dirname, './').slice(0, -1) + path + '?' + Math.random().toString(), {
415
+ const res = yield fetch(tool.urlResolve(__dirname, './').slice(0, -1) + path, {
416
416
  'headers': {
417
417
  'range': `bytes=0-1`
418
418
  }
package/dist/lib/fs.ts CHANGED
@@ -140,14 +140,14 @@ export async function getContent(path: string, options?: BufferEncoding | {
140
140
  headers['range'] = `bytes=${start === undefined ? '0' : start}-${end === undefined ? '' : end}`;
141
141
  }
142
142
  if (options.progress) {
143
- blob = await tool.request(ourl + '?' + rand, {
143
+ blob = await tool.request(ourl + (!ourl.startsWith(loader.cdn) ? ('?' + rand) : ''), {
144
144
  'headers': headers,
145
145
  'progress': options.progress,
146
146
  'responseType': 'blob'
147
147
  });
148
148
  }
149
149
  else {
150
- blob = await (await fetch(ourl + '?' + rand, {
150
+ blob = await (await fetch(ourl + (!ourl.startsWith(loader.cdn) ? ('?' + rand) : ''), {
151
151
  'headers': headers
152
152
  })).blob();
153
153
  }
@@ -447,7 +447,7 @@ async function getClickGoStats(path: string): Promise<types.IStats | null> {
447
447
  else {
448
448
  // --- 文件 ---
449
449
  try {
450
- const res = await fetch(tool.urlResolve(__dirname, './').slice(0, -1) + path + '?' + Math.random().toString(), {
450
+ const res = await fetch(tool.urlResolve(__dirname, './').slice(0, -1) + path, {
451
451
  'headers': {
452
452
  'range': `bytes=0-1`
453
453
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clickgo",
3
- "version": "3.1.6-dev15",
3
+ "version": "3.1.8-dev17",
4
4
  "description": "Background interface, software interface, mobile phone APP interface operation library.",
5
5
  "keywords": [
6
6
  "deskrt",
@@ -18,8 +18,8 @@
18
18
  "native4": "electron ./dist/test/native/index4"
19
19
  },
20
20
  "devDependencies": {
21
- "@litert/eslint-plugin-rules": "^0.1.0",
22
- "@litert/loader": "^3.4.4",
21
+ "@litert/eslint-plugin-rules": "^0.1.2",
22
+ "@litert/loader": "^3.4.6",
23
23
  "@types/node": "^18.11.14",
24
24
  "electron": "^22.0.2",
25
25
  "jszip": "^3.10.1",