@rife/cli 0.0.6-beta.2 → 0.0.6-beta.21

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.
Files changed (71) hide show
  1. package/dist/cjs/cli.cjs +25 -0
  2. package/dist/cjs/index.cjs +79 -0
  3. package/dist/cjs/logger.cjs +48 -0
  4. package/dist/cjs/plugin/commander.cjs +66 -0
  5. package/dist/cjs/plugin/config.cjs +109 -0
  6. package/dist/cjs/plugin/index.cjs +79 -0
  7. package/dist/cjs/plugin/package.cjs +71 -0
  8. package/dist/cjs/plugin/release.cjs +129 -0
  9. package/dist/cjs/runner.cjs +141 -0
  10. package/dist/{sync.js → cjs/sync.cjs} +12 -23
  11. package/dist/cjs/util.cjs +67 -0
  12. package/dist/esm/cli.mjs +21 -0
  13. package/dist/esm/index.mjs +6 -0
  14. package/dist/esm/logger.mjs +16 -0
  15. package/dist/esm/plugin/commander.mjs +34 -0
  16. package/dist/esm/plugin/config.mjs +67 -0
  17. package/dist/esm/plugin/index.mjs +6 -0
  18. package/dist/{plugin/package.js → esm/plugin/package.mjs} +10 -13
  19. package/dist/esm/plugin/release.mjs +97 -0
  20. package/dist/esm/runner.mjs +96 -0
  21. package/dist/esm/sync.mjs +46 -0
  22. package/dist/esm/util.mjs +12 -0
  23. package/package.json +29 -27
  24. package/src/cli.ts +23 -19
  25. package/src/index.ts +4 -3
  26. package/src/logger.ts +17 -34
  27. package/src/plugin/commander.ts +51 -44
  28. package/src/plugin/config.ts +26 -9
  29. package/src/plugin/index.ts +1 -1
  30. package/src/plugin/package.ts +0 -3
  31. package/src/plugin/release.ts +113 -32
  32. package/src/runner.ts +134 -88
  33. package/src/sync.ts +63 -63
  34. package/src/util.ts +14 -0
  35. package/dist/build.js +0 -3
  36. package/dist/build.js.map +0 -1
  37. package/dist/cli.js +0 -18
  38. package/dist/cli.js.map +0 -1
  39. package/dist/index.js +0 -7
  40. package/dist/index.js.map +0 -1
  41. package/dist/logger.js +0 -26
  42. package/dist/logger.js.map +0 -1
  43. package/dist/plugin/commander.js +0 -42
  44. package/dist/plugin/commander.js.map +0 -1
  45. package/dist/plugin/compiler/compiler.js +0 -166
  46. package/dist/plugin/compiler/compiler.js.map +0 -1
  47. package/dist/plugin/compiler/index.js +0 -83
  48. package/dist/plugin/compiler/index.js.map +0 -1
  49. package/dist/plugin/compiler/swc.js +0 -47
  50. package/dist/plugin/compiler/swc.js.map +0 -1
  51. package/dist/plugin/compiler/tsc.js +0 -75
  52. package/dist/plugin/compiler/tsc.js.map +0 -1
  53. package/dist/plugin/config.js +0 -61
  54. package/dist/plugin/config.js.map +0 -1
  55. package/dist/plugin/index.js +0 -8
  56. package/dist/plugin/index.js.map +0 -1
  57. package/dist/plugin/package.js.map +0 -1
  58. package/dist/plugin/release.js +0 -32
  59. package/dist/plugin/release.js.map +0 -1
  60. package/dist/pnpmfile.js +0 -153
  61. package/dist/runner.js +0 -53
  62. package/dist/runner.js.map +0 -1
  63. package/dist/sync.js.map +0 -1
  64. package/dist/tsconfig.tsbuildinfo +0 -1
  65. package/src/build.ts +0 -0
  66. package/src/plugin/compiler/compiler.ts +0 -198
  67. package/src/plugin/compiler/index.ts +0 -109
  68. package/src/plugin/compiler/swc.ts +0 -55
  69. package/src/plugin/compiler/tsc.ts +0 -101
  70. package/src/pnpmfile.ts +0 -147
  71. package/src/test/pnpmfile.test.ts +0 -223
@@ -0,0 +1,46 @@
1
+ import "node:module";
2
+ /*#__PURE__*/ import.meta.url;
3
+ async function sync(name) {
4
+ const res = await fetch(`https://registry-direct.npmmirror.com/-/package/${name}/syncs`, {
5
+ headers: {
6
+ accept: '*/*',
7
+ 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8',
8
+ 'sec-ch-ua': '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"',
9
+ 'sec-ch-ua-mobile': '?0',
10
+ 'sec-ch-ua-platform': '"Windows"',
11
+ 'sec-fetch-dest': 'empty',
12
+ 'sec-fetch-mode': 'cors',
13
+ 'sec-fetch-site': 'same-site',
14
+ Referer: 'https://npmmirror.com/',
15
+ 'Referrer-Policy': 'strict-origin-when-cross-origin'
16
+ },
17
+ body: null,
18
+ method: 'PUT'
19
+ });
20
+ const body = await res.json();
21
+ if (true === body.ok) console.log(`同步 ${name} 成功`);
22
+ return body;
23
+ }
24
+ const list = [
25
+ '@rife/config',
26
+ '@rife/cli'
27
+ ];
28
+ async function main() {
29
+ for (const item of list)await sync(item);
30
+ poll();
31
+ }
32
+ main();
33
+ async function get(name) {
34
+ try {
35
+ const res = await fetch(`https://r.cnpmjs.org/${name}?t=${Date.now()}&cache=0`);
36
+ const data = await res.json();
37
+ return `${name} ${data?.['dist-tags']?.['latest']}`;
38
+ } catch (e) {
39
+ return `${name} error`;
40
+ }
41
+ }
42
+ async function poll() {
43
+ const res = await Promise.all(list.map(get));
44
+ console.log(`${res.join('\n')}\n`);
45
+ setTimeout(poll, 1000);
46
+ }
@@ -0,0 +1,12 @@
1
+ import "node:module";
2
+ /*#__PURE__*/ import.meta.url;
3
+ import { fileURLToPath } from "node:url";
4
+ import path from "path";
5
+ import fs_extra from "fs-extra";
6
+ import * as __rspack_external_glob from "glob";
7
+ const getDuration = (perfStart)=>{
8
+ const duration = ((performance.now() - perfStart) / 1000).toFixed(3);
9
+ return `耗时 ${duration} s`;
10
+ };
11
+ const resolve = (...args)=>path.resolve(path.dirname(fileURLToPath(import.meta.url)), ...args);
12
+ export { fs_extra as fs, getDuration, __rspack_external_glob as glob, resolve };
package/package.json CHANGED
@@ -1,49 +1,51 @@
1
1
  {
2
2
  "name": "@rife/cli",
3
- "version": "0.0.6-beta.2",
3
+ "version": "0.0.6-beta.21",
4
4
  "description": "",
5
- "main": "./dist/index.js",
6
- "types": "./src/index.ts",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "require": "./dist/cjs/index.cjs",
9
+ "import": "./dist/esm/index.mjs",
10
+ "types": "./src/index.ts"
11
+ }
12
+ },
7
13
  "bin": {
8
- "rife": "./dist/cli.js"
14
+ "rife": "./dist/esm/cli.mjs"
9
15
  },
10
16
  "files": [
11
17
  "dist/**/*",
12
18
  "src/**/*"
13
19
  ],
14
- "keywords": [],
15
- "author": "",
16
- "license": "ISC",
17
20
  "dependencies": {
21
+ "commander": "^14.0.2",
22
+ "consola": "^3.4.2",
23
+ "fs-extra": "^11.3.3",
24
+ "glob": "^13.0.0",
25
+ "tapable": "^2.3.0",
26
+ "zod": "^4.3.6"
27
+ },
28
+ "devDependencies": {
29
+ "@rslib/core": "^0.19.3",
18
30
  "@types/fs-extra": "^11.0.4",
19
- "@types/node": "^22.13.1",
20
- "typescript": "^5.7.3",
21
- "tslib": "^2.8.1",
22
- "@swc/cli": "^0.6.0",
23
- "@swc/helpers": "^0.5.15",
24
- "chokidar": "^4.0.3",
25
- "commander": "^10.0.1",
26
- "consola": "^3.4.0",
27
- "esbuild": "^0.25.0",
28
- "fs-extra": "^11.1.1",
29
- "tapable": "^2.2.1",
30
- "vitest": "^3.0.2",
31
- "zod": "^3.24.1",
32
- "@rife/config": "0.0.6-beta.5"
31
+ "@types/node": "^25.1.0",
32
+ "vitest": "^4.0.18",
33
+ "@rsbuild/plugin-type-check": "^1.3.3",
34
+ "@rife/config": "0.0.6-beta.12"
33
35
  },
34
36
  "rife": {
35
37
  "hostDependencies": {
36
38
  "@types/node": true,
37
39
  "@rife/config": true,
38
- "tslib": true,
39
- "@swc/helpers": true,
40
- "vitest": true
40
+ "fs-extra": true,
41
+ "@types/fs-extra": true
41
42
  }
42
43
  },
43
44
  "scripts": {
44
- "dev": "tsc --watch",
45
- "build": "esbuild src/pnpmfile.ts --bundle --platform=node --outfile=D:/work/traver/pnpmfile.js --watch",
45
+ "dev": "rslib build --watch",
46
+ "build": "rslib build",
46
47
  "test": "vitest",
47
- "release": "pnpm publish --registry https://registry.npmjs.org --no-git-checks"
48
+ "release": "rslib build && pnpm publish --registry https://registry.npmjs.org --no-git-checks --access public --tag beta",
49
+ "lint": "eslint"
48
50
  }
49
51
  }
package/src/cli.ts CHANGED
@@ -1,19 +1,23 @@
1
- import { pluginCommander, pluginConfig, pluginPackage } from './plugin';
2
- import { Plugin, createRunner } from './runner';
3
-
4
- const plugins: Plugin[] = [
5
- pluginPackage(), //
6
- pluginConfig(),
7
- pluginCommander(),
8
- ];
9
-
10
- const runner = createRunner();
11
-
12
- plugins.forEach(plugin => plugin.apply(runner));
13
-
14
- (async () => {
15
- await runner.hook.loadPackage.promise();
16
- await runner.hook.loadConfig.promise();
17
- await runner.hook.validateConfig.promise();
18
- await runner.hook.startCommand.promise();
19
- })();
1
+ import { pluginCommander, pluginConfig, pluginPackage, pluginRelease } from './plugin';
2
+ import { Plugin, createRunner } from './runner';
3
+
4
+ const plugins: Plugin[] = [
5
+ pluginPackage(), //
6
+ pluginConfig(),
7
+ pluginCommander(),
8
+ pluginRelease(),
9
+ ];
10
+
11
+ const runner = createRunner();
12
+
13
+ plugins.forEach(plugin => plugin.apply(runner));
14
+
15
+ (async () => {
16
+ await runner.hook.loadPackage.promise();
17
+ await runner.hook.loadConfig.promise();
18
+ await runner.hook.validateConfig.promise();
19
+ await runner.hook.applyConfig.promise();
20
+ await runner.hook.validatePlugin.promise();
21
+ await runner.hook.registerCommand.promise();
22
+ await runner.hook.startCommand.promise();
23
+ })();
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
- export * from './runner';
2
- export * from './plugin';
3
- export * from './logger';
1
+ export * from './runner';
2
+ export * from './plugin';
3
+ export * from './logger';
4
+ export * from './util';
package/src/logger.ts CHANGED
@@ -1,34 +1,17 @@
1
- import { createConsola } from 'consola';
2
-
3
- export interface Logger {
4
- debug: (message: string, ...args: any[]) => any;
5
- info: (message: string, ...args: any[]) => any;
6
- error: (message: string, ...args: any[]) => any;
7
- success: (message: string, ...args: any[]) => any;
8
- fail: (message: string, ...args: any[]) => any;
9
- withTag: (tag: string) => Logger;
10
- }
11
-
12
- export function createLogger() {
13
- const instance = createConsola({
14
- level: 4,
15
- // fancy: false,
16
- formatOptions: {
17
- // columns: 80,
18
- // colors: false,
19
- compact: false,
20
- date: false,
21
- },
22
- });
23
-
24
- const logger: Logger = {
25
- debug: (message, ...args) => instance.info(message, ...args),
26
- info: (message, ...args) => instance.info(message, ...args),
27
- error: (message, ...args) => instance.error(message, ...args),
28
- success: (message, ...args) => instance.success(message, ...args),
29
- fail: (message, ...args) => instance.fail(message, ...args),
30
- withTag: tag => instance.withTag(tag),
31
- };
32
-
33
- return logger;
34
- }
1
+ import { createConsola } from 'consola';
2
+
3
+ export function createLogger(options?: { debug?: boolean }) {
4
+ const instance = createConsola({
5
+ level: options?.debug ? 4 : 3,
6
+ throttle: 10,
7
+ throttleMin: 500,
8
+ formatOptions: {
9
+ // columns: 80,
10
+ // colors: false,
11
+ compact: false,
12
+ date: false,
13
+ },
14
+ });
15
+
16
+ return instance;
17
+ }
@@ -1,44 +1,51 @@
1
- import type { Plugin } from '../runner';
2
-
3
- export function pluginCommander() {
4
- const plugin: Plugin = {
5
- name: pluginCommander.name,
6
- apply: runner => {
7
- const { hook, config, z } = runner;
8
-
9
- hook.startCommand.tapPromise(pluginCommander.name, async () => {
10
- const { Command } = require('commander') as typeof import('commander');
11
- const program = new Command();
12
- program
13
- .command('dev')
14
- .option('-n, --name <string>', '', '')
15
- .description('启动开发')
16
- .action(async options => {
17
- await hook.applyConfig.promise(options);
18
- await hook.dev.promise();
19
- });
20
-
21
- program
22
- .command('build')
23
- .option('-n, --name <string>', '', '')
24
- .description('构建项目')
25
- .action(async options => {
26
- await hook.applyConfig.promise(options);
27
- await hook.build.promise();
28
- });
29
-
30
- program
31
- .command('release')
32
- .option('-n, --name <string>', '', '')
33
- .description('发布包')
34
- .action(async options => {
35
- await hook.applyConfig.promise(options);
36
- await hook.release.promise();
37
- });
38
-
39
- program.parseAsync(process.argv);
40
- });
41
- },
42
- };
43
- return plugin;
44
- }
1
+ import type { Plugin } from '../runner';
2
+
3
+ export function pluginCommander() {
4
+ const plugin: Plugin = {
5
+ name: pluginCommander.name,
6
+ apply: runner => {
7
+ const { hook, command, config, z, logger } = runner;
8
+ const log = logger.withTag(pluginCommander.name);
9
+
10
+ hook.registerCommand.tapPromise(pluginCommander.name, async () => {
11
+ command
12
+ .command('dev')
13
+ .description('启动开发')
14
+ .action(async () => {
15
+ process.env.NODE_ENV = 'development';
16
+
17
+ await hook.dev.promise();
18
+ });
19
+
20
+ command
21
+ .command('build')
22
+ .description('构建项目')
23
+ .action(async () => {
24
+ process.env.NODE_ENV = 'production';
25
+ await hook.build.promise();
26
+ });
27
+
28
+ command
29
+ .command('release')
30
+ .description('发布包')
31
+ .action(async () => {
32
+ await hook.release.promise();
33
+ });
34
+
35
+ command
36
+ .command('deploy')
37
+ .description('部署项目')
38
+ .action(async () => {
39
+ await hook.deploy.promise().catch(e => {
40
+ log.fail(`部署失败,${runner.duration},${e.message}`);
41
+ });
42
+ });
43
+ });
44
+
45
+ hook.startCommand.tapPromise(pluginCommander.name, async () => {
46
+ await command.parseAsync(process.argv);
47
+ });
48
+ },
49
+ };
50
+ return plugin;
51
+ }
@@ -6,18 +6,32 @@ export function pluginConfig() {
6
6
  const plugin: Plugin = {
7
7
  name: pluginConfig.name,
8
8
  apply: runner => {
9
- const { logger, hook, config, fs, z } = runner;
9
+ const { logger, hook, config, command, fs, z } = runner;
10
10
  const log = logger.withTag(pluginConfig.name);
11
11
 
12
12
  hook.loadConfig.tapPromise(pluginConfig.name, async () => {
13
- const fileName = '.app.js';
14
- const filePath = path.posix.resolve(fileName);
13
+ let filePath = '';
14
+ const mjs = 'app.mjs';
15
+ const fileNames = ['app.js', 'app.cjs', mjs];
16
+ let isEsm = false;
17
+ for (const fileName of fileNames) {
18
+ if (await fs.exists(fileName)) {
19
+ filePath = path.posix.resolve(fileName);
20
+ isEsm = fileName === mjs;
21
+ break;
22
+ }
23
+ }
15
24
  log.debug(`filePath %s`, filePath);
16
- if (!fs.existsSync(filePath)) {
17
- log.error(`找不到配置文件 ${fileName}`);
25
+ if (!filePath) {
26
+ log.error(`找不到配置文件 app.(c|m)?js`);
18
27
  process.exit(1);
19
28
  }
20
- const all: Config[] = require(filePath);
29
+ let all: Config[] = [];
30
+ if (isEsm) {
31
+ all = (await import(filePath)).default;
32
+ } else {
33
+ all = require(filePath);
34
+ }
21
35
  runner.config.all = all;
22
36
  });
23
37
 
@@ -36,12 +50,15 @@ export function pluginConfig() {
36
50
  }
37
51
  });
38
52
 
39
- hook.applyConfig.tapPromise(pluginConfig.name, async options => {
53
+ hook.applyConfig.tapPromise(pluginConfig.name, async () => {
40
54
  const result = z
41
55
  .object({
42
- name: z.string().trim().optional(),
56
+ name: z.string().trim(),
57
+ })
58
+ .default({
59
+ name: '',
43
60
  })
44
- .safeParse(options);
61
+ .safeParse(command.opts());
45
62
  const name = result.data?.name;
46
63
  if (!name) {
47
64
  log.debug('没有指定 --name,默认使用列表第一个');
@@ -1,4 +1,4 @@
1
1
  export * from './config';
2
2
  export * from './package';
3
3
  export * from './commander';
4
- export * from './compiler';
4
+ export * from './release';
@@ -1,8 +1,5 @@
1
- import type { ChildProcess } from 'child_process';
2
1
  import path from 'path';
3
2
 
4
- import { AsyncSeriesHook } from 'tapable';
5
-
6
3
  import type { Plugin } from '../runner';
7
4
 
8
5
  export function pluginPackage() {
@@ -1,32 +1,113 @@
1
- import type { ChildProcess } from 'child_process';
2
- import path from 'path';
3
-
4
- import { AsyncSeriesHook } from 'tapable';
5
-
6
- import type { Plugin } from '../runner';
7
-
8
- export function pluginRelease() {
9
- const plugin: Plugin = {
10
- name: pluginRelease.name,
11
- apply: runner => {
12
- const { logger, hook, fs } = runner;
13
- const log = logger.withTag(pluginRelease.name);
14
- hook.loadPackage.tapPromise(pluginRelease.name, async () => {
15
- const fileName = 'package.json';
16
- const filePath = path.resolve(fileName);
17
- if (!fs.existsSync(filePath)) {
18
- log.error(`找不到文件 ${fileName}`);
19
- process.exit(1);
20
- }
21
- try {
22
- const data = require(filePath);
23
- runner.package = data;
24
- } catch (e) {
25
- log.error(`读取文件失败`, e.message);
26
- process.exit(1);
27
- }
28
- });
29
- },
30
- };
31
- return plugin;
32
- }
1
+ import { execSync } from 'child_process';
2
+
3
+ import type { Plugin } from '../runner';
4
+
5
+ export function pluginRelease() {
6
+ const plugin: Plugin = {
7
+ name: pluginRelease.name,
8
+ apply: runner => {
9
+ const { logger, hook, fs } = runner;
10
+ const log = logger.withTag(pluginRelease.name);
11
+ hook.release.tapPromise(pluginRelease.name, async () => {
12
+ runner.clear();
13
+ await hook.build.promise();
14
+
15
+ log.start('开始发布');
16
+ const packageVersion = runner.package.version;
17
+ const packageName = runner.package.name;
18
+ const url = `https://registry.npmjs.org/${packageName}`;
19
+ let nextVersion = packageVersion;
20
+ log.debug(`查询版本号 ${packageVersion} 是否存在`);
21
+ const res = await (await fetch(url)).json();
22
+ const exist = res?.versions?.[packageVersion];
23
+ if (exist) {
24
+ const split = packageVersion.split('.');
25
+ split[split.length - 1] = Number(split[split.length - 1]) + 1;
26
+ nextVersion = split.join('.');
27
+ log.debug(`版本号 ${packageVersion} 存在,更新版本号为 ${nextVersion}`);
28
+ const text = fs.readFileSync('./package.json').toString();
29
+ const nextText = text.replace(new RegExp(`"version":\\s*"${packageVersion}"`), `"version": "${nextVersion}"`);
30
+ fs.writeFileSync('./package.json', nextText);
31
+ }
32
+ log.debug(`版本号 ${packageVersion} 不存在`);
33
+ log.info(`版本号为 ${nextVersion}`);
34
+
35
+ const tempDir = `./node_modules/.rife/release/`;
36
+ log.info(`清空目录 ${tempDir}`);
37
+ fs.emptyDirSync(tempDir);
38
+
39
+ const pack = `pnpm pack --pack-destination ${tempDir} --json`;
40
+ log.info(`打包文件 ${pack}`);
41
+ const packOutput = JSON.parse(execSync(pack).toString());
42
+ const filename = packOutput.filename;
43
+ for (const item of packOutput.files) {
44
+ log.debug(item.path);
45
+ }
46
+
47
+ const debug = false;
48
+ const publish = `pnpm publish ${filename} --registry https://registry.npmjs.org --no-git-checks --tag beta ${
49
+ debug ? '--dry-run' : ''
50
+ }`;
51
+ log.info(`发布文件 ${publish}`);
52
+ execSync(publish, { stdio: 'inherit' });
53
+ log.success(`发布成功,${runner.duration}`);
54
+
55
+ log.info('同步版本');
56
+ let hasSync = false;
57
+ while (true) {
58
+ const res = await queryVersion(packageName);
59
+ const nextManifest = res?.versions?.[nextVersion];
60
+ const exist = Boolean(nextManifest);
61
+ const latest = res?.['dist-tags']?.latest;
62
+ if (exist) {
63
+ log.debug(`同步版本存在`);
64
+ break;
65
+ }
66
+ log.info(`检查版本 ${nextVersion} 不存在,最新版本为 ${latest}`);
67
+ if (!hasSync) {
68
+ hasSync = true;
69
+ log.start(`开始同步`);
70
+ const sync = await syncVersion(packageName);
71
+ if (sync.ok === true) {
72
+ log.info(
73
+ `调用同步接口成功,日志 https://registry.npmmirror.com/-/package/${packageName}/syncs/${sync.id}/log`,
74
+ );
75
+ } else {
76
+ log.debug(`调用同步接口失败,%j`, sync);
77
+ }
78
+ }
79
+ await new Promise(resolve => setTimeout(resolve, 2000));
80
+ }
81
+ log.success(`同步成功,最新版本为 ${nextVersion},${runner.duration}`);
82
+ });
83
+ },
84
+ };
85
+ return plugin;
86
+ }
87
+
88
+ async function queryVersion(packageName: string) {
89
+ const res = await (await fetch(`https://registry.npmmirror.com/${packageName}?t=${Math.random()}`)).json();
90
+ return res;
91
+ }
92
+
93
+ async function syncVersion(packageName: string) {
94
+ const sync = await (
95
+ await fetch(`https://registry-direct.npmmirror.com/-/package/${packageName}/syncs`, {
96
+ headers: {
97
+ accept: '*/*',
98
+ 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8',
99
+ 'sec-ch-ua': '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"',
100
+ 'sec-ch-ua-mobile': '?0',
101
+ 'sec-ch-ua-platform': '"Windows"',
102
+ 'sec-fetch-dest': 'empty',
103
+ 'sec-fetch-mode': 'cors',
104
+ 'sec-fetch-site': 'same-site',
105
+ Referer: 'https://npmmirror.com/',
106
+ 'Referrer-Policy': 'strict-origin-when-cross-origin',
107
+ },
108
+ body: null,
109
+ method: 'PUT',
110
+ })
111
+ ).json();
112
+ return sync;
113
+ }