Skip to content

Commit

Permalink
release 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nonoroazoro committed Jun 20, 2022
2 parents c37eec3 + d702332 commit 3d6f410
Show file tree
Hide file tree
Showing 9 changed files with 639 additions and 625 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelogs

## 3.3.0 - June 20, 2022

- Fixed: Validate minimum supported extension version


## 3.2.1 - June 20, 2022

- Changed: Revert min required VSCode version to 1.37.0
- Changed: Upgrade dependencies and some minor fix.


## 3.2.0 - May 11, 2022

- Changed: Upgrade dependencies and some minor fix.
Expand Down
23 changes: 1 addition & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,6 @@
> *Keep it simple & reliable!*

## Breaking Changes

* From ***version 3.0.0*** onwards:

1. Supports **auto-sync** (finally...), here's a brief guide:

1. ***Disclaimer***, by enabling auto-sync, you may **unintentionally overwrite** your settings ([see the discussion here](https://github.com/nonoroazoro/vscode-syncing/issues/6)), make sure you know what you're doing before you continue!

1. It's **highly recommended** that you perform a `Download Settings` (which will set a baseline) before the following steps.

1. `Open Syncing Settings` ([Don't known how to open?](#auto-sync-settings)) and enable the **auto-sync** like the followings:

```json
"auto_sync": true
```

1. Reload or reopen your VSCode and enjoy!

> BTW, don't forget to fill in the correct `Github Personal Access Token` and `Gist ID`, otherwise auto-sync will not work.


## Features

*Syncing* will `keep the consistency of your VSCode settings between your devices`, it'll let you:
Expand All @@ -56,7 +35,7 @@
* You can download settings from `a public Gist`, such as your friend's VSCode settings, [check out here](#getting-started) for more details.
* You can `exclude some VSCode User Settings and Extensions` from being downloaded, [check out the VSCode User Settings](#vscode-user-settings) for more details.

Besides, you can [set up a proxy](#proxy-settings) to accelerate the synchronization. And of course, you'll have a `progress indicator` during the synchronization :).
Besides, you can [set up a proxy](#proxy-settings) to accelerate the synchronization. And of course, you can turn on the [auto-sync](#auto-sync-settings) to simplify the synchronization :).


## Commands
Expand Down
23 changes: 1 addition & 22 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,6 @@
> *我的目标是始终让它保持**简单可靠**,所以提需求别太过分啊 :)*

## 重要变更

****3.0.0*** 版本开始:

1. 支持**配置自动同步**(终于...),以下是简单步骤:

1. ***免责声明***:启用自动同步后,在某些情况下可能会导致您错误地覆盖配置文件([参考这里的讨论](https://github.com/nonoroazoro/vscode-syncing/issues/6)),因此在继续之前,请务必确认您是否真的需要启用该功能;

1. 在后续操作之前,**强烈推荐**您执行一次`下载配置`以便让自动同步功能更好地工作;

1. 打开 `Syncing` 的配置文件([不知道如何打开?](#配置自动同步))并启用 **auto-sync**,例如:

```json
"auto_sync": true
```

1. 重新加载或重启 VSCode,大功告成!

> 最后,别忘了设置您的 `Github Personal Access Token` 和 `Gist ID`,否则自动同步功能将不会工作。


## 功能

*Syncing* 可以在`本地和云端之间同步您的所有 VSCode 配置`,包括:
Expand All @@ -56,7 +35,7 @@
* 您可以从一个`公开的 Gist` 中下载配置。例如,下载您朋友分享的配置,只要问他要一个 `Gist ID` 就行了,具体请参考[这里](#快速开始)
* 您可以`排除某些 VSCode 配置项和扩展`,以防它们被下载,具体请参考[这里](#vscode-配置项)

另外,如果您访问 GitHub 有困难(万恶的墙),您可以[配置一个代理](#代理设置)来加速同步。当然,同步时的`进度条`肯定有的咯
另外,如果您访问 GitHub 有困难(万恶的墙),您可以[配置一个代理](#代理设置)来加速同步。当然,您也可以开启[自动同步](#配置自动同步)来进一步简化同步过程


## 命令
Expand Down
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "syncing",
"displayName": "%displayName%",
"description": "%description%",
"version": "3.2.0",
"version": "3.3.0",
"publisher": "nonoroazoro",
"author": {
"email": "[email protected]",
Expand All @@ -22,7 +22,7 @@
"email": "[email protected]"
},
"engines": {
"vscode": "^1.67.0"
"vscode": "^1.37.0"
},
"categories": [
"Other"
Expand Down Expand Up @@ -121,6 +121,7 @@
"dependencies": {
"@octokit/rest": "^18.12.0",
"chokidar": "^3.5.3",
"compare-versions": "^4.1.3",
"date-fns": "^2.28.0",
"extract-zip": "^2.0.1",
"fs-extra": "10.1.0",
Expand All @@ -135,32 +136,31 @@
"tslib": "^2.4.0"
},
"devDependencies": {
"@types/extract-zip": "^2.0.0",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.5.0",
"@types/jest": "^28.1.2",
"@types/lodash.debounce": "^4.0.7",
"@types/lodash.pick": "^4.4.7",
"@types/micromatch": "^4.0.2",
"@types/node": "^17.0.32",
"@types/vscode": "^1.67.0",
"@typescript-eslint/eslint-plugin": "^5.23.0",
"@typescript-eslint/parser": "^5.23.0",
"@types/node": "^10.11.0",
"@types/vscode": "^1.37.0",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.28.0",
"cross-env": "^7.0.3",
"eslint": "^8.15.0",
"eslint-config-zoro": "^5.15.5",
"eslint": "^8.18.0",
"eslint-config-zoro": "^5.27.0",
"eslint-plugin-node": "^11.1.0",
"eslint-webpack-plugin": "^3.1.1",
"fork-ts-checker-webpack-plugin": "^7.2.11",
"husky": "^8.0.1",
"jest": "^28.1.0",
"lint-staged": "^12.4.1",
"jest": "^28.1.1",
"lint-staged": "^13.0.2",
"native-ext-loader": "^2.3.0",
"rimraf": "^3.0.2",
"ts-jest": "^28.0.2",
"ts-jest": "^28.0.5",
"ts-loader": "^9.3.0",
"typescript": "^4.6.4",
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2",
"typescript": "^4.7.4",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
"webpackbar": "^5.0.2"
}
}
5 changes: 5 additions & 0 deletions scripts/upgrade_packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -ex

ncu -u -x "@types/node @types/vscode"
8 changes: 4 additions & 4 deletions src/core/Extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import
import { downloadFile } from "../utils/ajax";
import { Environment } from "./Environment";
import { getExtensionById, getVSCodeSetting } from "../utils/vscodeAPI";
import { getLatestVSIXVersion, queryExtensions } from "../utils/vscodeWebAPI";
import { findLatestSupportedVSIXVersion, queryExtensions } from "../utils/vscodeWebAPI";
import { localize } from "../i18n";
import { Syncing } from "./Syncing";
import * as Toast from "./Toast";
Expand Down Expand Up @@ -117,7 +117,7 @@ export class Extension

// Add, update or remove extensions.
const { added, updated, removed, total } = diff;
const result = { extension: {} } as ISyncedItem;
const result = { extension: {} };
const tasks = [
this._addExtensions.bind(this, {
extensions: added,
Expand Down Expand Up @@ -153,7 +153,7 @@ export class Extension
// Added since VSCode v1.20.
await this.updateObsolete(added, updated, removed);

return result;
return result as ISyncedItem;
}

/**
Expand Down Expand Up @@ -323,7 +323,7 @@ export class Extension
const extensionMeta = queriedExtensions.get(ext.id);
if (extensionMeta)
{
const latestVersion = getLatestVSIXVersion(extensionMeta);
const latestVersion = findLatestSupportedVSIXVersion(extensionMeta);
if (latestVersion != null)
{
ext.version = latestVersion;
Expand Down
8 changes: 7 additions & 1 deletion src/types/VSCodeWebAPITypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ export interface IExtensionVersion
files: IExtensionFile[];
flags: string;
lastUpdated: string;
properties: any[];
properties: IExtensionProperty[];
version: string;
}

export interface IExtensionProperty
{
key: string;
value: string;
}

export interface IExtensionFile
{
assetType: ExtensionAssetType;
Expand Down
28 changes: 23 additions & 5 deletions src/utils/vscodeWebAPI.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { satisfies } from "compare-versions";
import * as vscode from "vscode";

import { CaseInsensitiveMap } from "../collections";
import { ExtensionAssetType, QueryFilterType, QueryFlag } from "../types";
import { post } from "./ajax";
import type { IExtensionMeta, IExtensionVersion } from "../types";

/**
* Represents the property key of the extension engine.
*/
export const EXTENSION_ENGINE_PROPERTY_KEY = "Microsoft.VisualStudio.Code.Engine";

/**
* Query the extensions' meta data.
*
Expand Down Expand Up @@ -56,20 +64,19 @@ export async function queryExtensions(
}

/**
* Gets the latest version of the VSIX file.
* Finds the latest supported version of the VSIX file.
*
* @param {IExtensionMeta} extensionMeta The extension's meta object.
*/
export function getLatestVSIXVersion(extensionMeta: IExtensionMeta): string | undefined
export function findLatestSupportedVSIXVersion(extensionMeta: IExtensionMeta): string | undefined
{
const versionMeta = extensionMeta.versions[0];
return versionMeta ? versionMeta.version : undefined;
return extensionMeta.versions.find(v => isVSIXSupported(v))?.version;
}

/**
* Gets the VSIX download URL.
*
* @deprecated The download speed of this URL is too slow.
* @deprecated The download speed of this URL is too low.
*
* @param {IExtensionVersion} version The extension's version object.
*/
Expand All @@ -86,3 +93,14 @@ export function getVSIXDownloadURL(version: IExtensionVersion): string | undefin
}
return;
}

/**
* Checks if the extension version is supported by current VSCode.
*
* @param {IExtensionVersion} version The specified extension version.
*/
export function isVSIXSupported(version: IExtensionVersion)
{
const requiredVersion = version.properties?.find(p => p.key === EXTENSION_ENGINE_PROPERTY_KEY)?.value;
return requiredVersion == null ? true : satisfies(vscode.version, requiredVersion);
}
Loading

0 comments on commit 3d6f410

Please sign in to comment.