Skip to content

Commit

Permalink
fix: revert build target to es6
Browse files Browse the repository at this point in the history
  • Loading branch information
HaaLeo committed Feb 2, 2024
1 parent f6ebc5a commit 5a88c65
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 69 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Expand Up @@ -6,7 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

[All Changes](https://github.com/HaaLeo/publish-vscode-extension/compare/v1.6.0...master)
[All Changes](https://github.com/HaaLeo/publish-vscode-extension/compare/v1.6.1...master)

## [1.6.1](https://github.com/HaaLeo/publish-vscode-extension/tree/1.6.1) 2024-02-02

### Changed

* Reverted build target back to `es6` ([#51](https://github.com/HaaLeo/publish-vscode-extension/issues/51))

[All Changes](https://github.com/HaaLeo/publish-vscode-extension/compare/v1.6.0...v1.6.1)

## [1.6.0](https://github.com/HaaLeo/publish-vscode-extension/tree/1.6.0) 2024-02-01

Expand Down
163 changes: 99 additions & 64 deletions dist/index.js
Expand Up @@ -134803,80 +134803,104 @@ function bufferIncludes(buffer, content) {
/***/ }),

/***/ 85325:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.createPackage = void 0;
const fs = __nccwpck_require__(57147);
const path = __nccwpck_require__(71017);
const core = __nccwpck_require__(42186);
const vsce_1 = __nccwpck_require__(79295);
async function createPackage(ovsxOptions) {
let vsixPath;
if (ovsxOptions.extensionFile) {
vsixPath = ovsxOptions.extensionFile;
core.info('The extension was already packaged. Skip packaging.');
}
else if (ovsxOptions.packagePath) {
const packageName = await _getPackageName(ovsxOptions.packagePath);
vsixPath = path.join(ovsxOptions.packagePath, packageName);
const options = _convertToVSCECreateVSIXOptions(ovsxOptions, vsixPath);
core.info('Start packaging the extension.');
await (0, vsce_1.createVSIX)(options);
}
else {
throw new Error('Either option "packagePath" or "extensionFile" must be set.');
}
return vsixPath;
function createPackage(ovsxOptions) {
return __awaiter(this, void 0, void 0, function* () {
let vsixPath;
if (ovsxOptions.extensionFile) {
vsixPath = ovsxOptions.extensionFile;
core.info('The extension was already packaged. Skip packaging.');
}
else if (ovsxOptions.packagePath) {
const packageName = yield _getPackageName(ovsxOptions.packagePath);
vsixPath = path.join(ovsxOptions.packagePath, packageName);
const options = _convertToVSCECreateVSIXOptions(ovsxOptions, vsixPath);
core.info('Start packaging the extension.');
yield (0, vsce_1.createVSIX)(options);
}
else {
throw new Error('Either option "packagePath" or "extensionFile" must be set.');
}
return vsixPath;
});
}
exports.createPackage = createPackage;
function _convertToVSCECreateVSIXOptions(options, targetVSIXPath) {
// Shallow copy of options
const { baseContentUrl, baseImagesUrl, yarn: useYarn, packagePath: cwd, preRelease, dependencies } = { ...options };
const { baseContentUrl, baseImagesUrl, yarn: useYarn, packagePath: cwd, preRelease, dependencies } = Object.assign({}, options);
const result = { baseContentUrl, useYarn, baseImagesUrl, cwd, packagePath: targetVSIXPath, preRelease, dependencies };
return result;
}
async function _getPackageName(packagePath) {
const rawJson = await fs.promises.readFile(path.join(packagePath, 'package.json'), 'utf8');
const json = JSON.parse(rawJson);
if (!json.name || !json.version) {
throw new Error('The extension\'s package.json must contain a "name" and "version" field.');
}
return `${json.name}-${json.version}.vsix`;
function _getPackageName(packagePath) {
return __awaiter(this, void 0, void 0, function* () {
const rawJson = yield fs.promises.readFile(path.join(packagePath, 'package.json'), 'utf8');
const json = JSON.parse(rawJson);
if (!json.name || !json.version) {
throw new Error('The extension\'s package.json must contain a "name" and "version" field.');
}
return `${json.name}-${json.version}.vsix`;
});
}


/***/ }),

/***/ 70399:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.main = void 0;
const core = __nccwpck_require__(42186);
const packageJSON = __nccwpck_require__(4147);
const createPackage_1 = __nccwpck_require__(85325);
const publish_1 = __nccwpck_require__(19334);
async function main() {
process.on('uncaughtException', _errorHandler);
process.on('unhandledRejection', _errorHandler);
const actionInfo = packageJSON;
core.info(`Specifically, running GitHub Action ${typeof actionInfo.author === 'string' ? actionInfo.author : actionInfo.author.name}/${actionInfo.name}@v${actionInfo.version}.`);
const options = _getInputs();
core.debug(`Start action with options="${JSON.stringify(options)}".`);
const vsixPath = await core.group('Package the Extension', () => (0, createPackage_1.createPackage)(options));
core.setOutput('vsixPath', vsixPath);
if (options.dryRun) {
core.info('"dryRun" option is set. Skip publishing.');
}
else {
options.extensionFile = vsixPath;
await core.group('Publish the Extension', () => (0, publish_1.publish)(options));
}
function main() {
return __awaiter(this, void 0, void 0, function* () {
process.on('uncaughtException', _errorHandler);
process.on('unhandledRejection', _errorHandler);
const actionInfo = packageJSON;
core.info(`Specifically, running GitHub Action ${typeof actionInfo.author === 'string' ? actionInfo.author : actionInfo.author.name}/${actionInfo.name}@v${actionInfo.version}.`);
const options = _getInputs();
core.debug(`Start action with options="${JSON.stringify(options)}".`);
const vsixPath = yield core.group('Package the Extension', () => (0, createPackage_1.createPackage)(options));
core.setOutput('vsixPath', vsixPath);
if (options.dryRun) {
core.info('"dryRun" option is set. Skip publishing.');
}
else {
options.extensionFile = vsixPath;
yield core.group('Publish the Extension', () => (0, publish_1.publish)(options));
}
});
}
exports.main = main;
function _errorHandler(error) {
Expand Down Expand Up @@ -134911,40 +134935,51 @@ function _getInputs() {
/***/ }),

/***/ 19334:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.publish = void 0;
const ovsx_1 = __nccwpck_require__(69333);
const vsce_1 = __nccwpck_require__(79295);
async function publish(ovsxOptions) {
if (ovsxOptions.registryUrl === 'https://marketplace.visualstudio.com') {
const vsceOptions = _convertToVSCEPublishOptions(ovsxOptions);
await (0, vsce_1.publishVSIX)(ovsxOptions.extensionFile, vsceOptions);
}
else {
let options;
if (ovsxOptions.target) {
const targets = ovsxOptions.target.split(' ');
options = { ...ovsxOptions, targets, packagePath: [ovsxOptions.packagePath] };
function publish(ovsxOptions) {
return __awaiter(this, void 0, void 0, function* () {
if (ovsxOptions.registryUrl === 'https://marketplace.visualstudio.com') {
const vsceOptions = _convertToVSCEPublishOptions(ovsxOptions);
yield (0, vsce_1.publishVSIX)(ovsxOptions.extensionFile, vsceOptions);
}
else {
options = { ...ovsxOptions, packagePath: [ovsxOptions.packagePath] };
}
const results = await (0, ovsx_1.publish)(options);
results?.forEach(result => {
if (result.status === 'rejected') {
throw result.reason;
let options;
if (ovsxOptions.target) {
const targets = ovsxOptions.target.split(' ');
options = Object.assign(Object.assign({}, ovsxOptions), { targets, packagePath: [ovsxOptions.packagePath] });
}
});
}
else {
options = Object.assign(Object.assign({}, ovsxOptions), { packagePath: [ovsxOptions.packagePath] });
}
const results = yield (0, ovsx_1.publish)(options);
results === null || results === void 0 ? void 0 : results.forEach(result => {
if (result.status === 'rejected') {
throw result.reason;
}
});
}
});
}
exports.publish = publish;
function _convertToVSCEPublishOptions(options) {
// Shallow copy of options
const { baseContentUrl, baseImagesUrl, pat, yarn: useYarn, noVerify, dependencies, skipDuplicate, preRelease, target } = { ...options };
const { baseContentUrl, baseImagesUrl, pat, yarn: useYarn, noVerify, dependencies, skipDuplicate, preRelease, target } = Object.assign({}, options);
const result = {
baseContentUrl,
useYarn,
Expand Down Expand Up @@ -147548,7 +147583,7 @@ module.exports = JSON.parse('{"application/andrew-inset":["ez"],"application/app
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"name":"publish-vscode-extension","version":"1.5.0","description":"GitHub action to publish your VS Code Extension to the Open VSX Registry.","main":"dist/index.js","scripts":{"test":"nyc mocha \'out/test/**/*.test.js\'","coverage":"nyc report --reporter=lcov","build":"npm run build:ncc && npm run build:test","build:ncc":"ncc build src/index.ts --source-map --no-source-map-register","build:test":"tsc -p tsconfig.json","lint":"eslint . --ext .ts"},"repository":{"type":"git","url":"git+https://github.com/HaaLeo/publish-vscode-extension.git"},"keywords":["github","action","open","vsx","vscode","publish","Visual Studio Code"],"author":{"name":"HaaLeo","url":"https://github.com/HaaLeo"},"license":"SEE LICENSE IN LICENSE.txt","bugs":{"url":"https://github.com/HaaLeo/publish-vscode-extension/issues"},"homepage":"https://github.com/HaaLeo/publish-vscode-extension#readme","dependencies":{"@actions/core":"^1.10.0","@vscode/vsce":"^2.19.0","ovsx":"^0.8.3"},"devDependencies":{"@types/chai":"^4.3.0","@types/chai-as-promised":"^7.1.4","@types/mocha":"^10.0.0","@types/node":"^16.11.26","@types/sinon":"^10.0.6","@types/sinon-chai":"^3.2.6","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/parser":"^5.7.0","@vercel/ncc":"^0.38.0","chai":"^4.3.4","chai-as-promised":"^7.1.1","eslint":"^8.4.1","eslint-plugin-import":"^2.25.3","eslint-plugin-prefer-arrow":"^1.2.3","mocha":"^10.2.0","nyc":"^15.1.0","sinon":"^16.0.0","sinon-chai":"^3.7.0","typescript":"^5.0.3"}}');
module.exports = JSON.parse('{"name":"publish-vscode-extension","version":"1.6.1","description":"GitHub action to publish your VS Code Extension to the Open VSX Registry.","main":"dist/index.js","scripts":{"test":"nyc mocha \'out/test/**/*.test.js\'","coverage":"nyc report --reporter=lcov","build":"npm run build:ncc && npm run build:test","build:ncc":"ncc build src/index.ts --source-map --no-source-map-register","build:test":"tsc -p tsconfig.json","lint":"eslint . --ext .ts"},"repository":{"type":"git","url":"git+https://github.com/HaaLeo/publish-vscode-extension.git"},"keywords":["github","action","open","vsx","vscode","publish","Visual Studio Code"],"author":{"name":"HaaLeo","url":"https://github.com/HaaLeo"},"license":"SEE LICENSE IN LICENSE.txt","bugs":{"url":"https://github.com/HaaLeo/publish-vscode-extension/issues"},"homepage":"https://github.com/HaaLeo/publish-vscode-extension#readme","dependencies":{"@actions/core":"^1.10.0","@vscode/vsce":"^2.19.0","ovsx":"^0.8.3"},"devDependencies":{"@types/chai":"^4.3.0","@types/chai-as-promised":"^7.1.4","@types/mocha":"^10.0.0","@types/node":"^16.11.26","@types/sinon":"^10.0.6","@types/sinon-chai":"^3.2.6","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/parser":"^5.7.0","@vercel/ncc":"^0.38.0","chai":"^4.3.4","chai-as-promised":"^7.1.1","eslint":"^8.4.1","eslint-plugin-import":"^2.25.3","eslint-plugin-prefer-arrow":"^1.2.3","mocha":"^10.2.0","nyc":"^15.1.0","sinon":"^16.0.0","sinon-chai":"^3.7.0","typescript":"^5.0.3"}}');

/***/ })

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "publish-vscode-extension",
"version": "1.6.0",
"version": "1.6.1",
"description": "GitHub action to publish your VS Code Extension to the Open VSX Registry.",
"main": "dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "ES2022",
"target": "es6",
"sourceMap": true,
"strictPropertyInitialization": false,
"noUnusedLocals": true,
Expand Down

0 comments on commit 5a88c65

Please sign in to comment.