Skip to content

fix: package issue. #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
.vscode
node_modules
out/
src/
tsconfig.json
webpack.config.js
webviews/
.gitignore
.editorconfig
.prettierignore
.prettierrc.js
yarn.lock
*
*/**
**/*/.DS_Store

!node_modules/**/*

!out/**/*
!assets/**/*

!package.json
!README.md
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "coding-plugin",
"displayName": "CODING Merge Requests & Releases",
"description": "Coding plugin for VS Code.",
"version": "0.2.0",
"version": "0.2.1",
"publisher": "coding-net",
"license": "MIT",
"engines": {
Expand Down Expand Up @@ -120,14 +121,15 @@
"postinstall": "cd src/typings && npx vscode-dts master && npx vscode-dts dev master",
"vscode:prepublish": "npm run compile",
"compile": "npm-run-all -p compile:*",
"#compile:extension": "webpack --mode production --config webpack.config.extension.js",
"compile:extension": "tsc -p ./src",
"compile:webviews": "webpack --config webpack.config.js",
"compile:webviews": "webpack --config webpack.config.webview.js",
"watch": "npm-run-all -p watch:*",
"watch:extension": "tsc -watch -p ./src",
"watch:webviews": "webpack --watch --mode development",
"lint": "eslint . --ext .ts,.tsx",
"package": "npx vsce package",
"release": "npx vsce publish"
"package": "npx vsce package --yarn",
"release": "npx vsce publish --yarn"
},
"babel": {
"plugins": [
Expand All @@ -140,7 +142,7 @@
"dependencies": {
"@risingstack/react-easy-state": "^6.3.0",
"dayjs": "^1.9.6",
"got": "^11.7.0",
"got": "^11.8.1",
"keytar": "^7.0.0",
"module-alias": "^2.2.2",
"nanoid": "^3.1.16",
Expand Down
5 changes: 4 additions & 1 deletion src/codingServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import { IRepoInfo, ISessionData, TokenType } from 'src/typings/commonTypes';
import { keychain } from 'src/common/keychain';
import Logger from 'src/common/logger';

// @ts-ignore
import * as pkgInfo from '../package.json';

const AUTH_SERVER = `https://x5p7m.csb.app`;
const ClientId = `ff768664c96d04235b1cc4af1e3b37a8`;
const ClientSecret = `d29ebb32cab8b5f0a643b5da7dcad8d1469312c7`;
Expand Down Expand Up @@ -113,7 +116,7 @@ export class CodingServer {

public async startOAuth(team: string, scopes: string) {
const state = nanoid();
const { name, publisher } = require('../package.json');
const { name, publisher } = pkgInfo;
const callbackUri = await vscode.env.asExternalUri(
vscode.Uri.parse(`${vscode.env.uriScheme}://${publisher}.${name}/on-did-authenticate`),
);
Expand Down
2 changes: 2 additions & 0 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"compilerOptions": {
"module": "commonjs",
"target": "es2019",
"moduleResolution": "Node",
"resolveJsonModule": true,
"lib": ["es2019", "dom", "es2020"],
"outDir": "../out",
"sourceMap": true,
Expand Down
57 changes: 57 additions & 0 deletions webpack.config.extension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

//@ts-check

'use strict';

const path = require('path');

/**@type {import('webpack').Configuration}*/
const config = {
target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/

entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
output: {
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
path: path.resolve(__dirname, 'out'),
filename: 'extension.js',
libraryTarget: 'commonjs2',
devtoolModuleFilenameTemplate: '../[resource-path]',
},
devtool: 'source-map',
externals: {
vscode: 'commonjs vscode', // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
got: 'got',
keytar: 'keytar',
},
resolve: {
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
extensions: ['.ts', '.js'],
alias: {
src: path.resolve(__dirname, 'src'),
},
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader',
options: {
compilerOptions: {
module: 'es6', // override `tsconfig.json` so that TypeScript emits native JavaScript modules.
},
},
},
],
},
],
},
};

module.exports = config;
File renamed without changes.
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1238,10 +1238,10 @@
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-2.1.1.tgz#ceff6a28a5b4867c2dd4a1ba513de278ccbe8bb1"
integrity sha512-/aPsuoj/1Dw/kzhkgz+ES6TxG0zfTMGLwuK2ZG00k/iJzYHTLCE8mVU8EPqEOp/lmxPoq1C1C9RYToRKb2KEfg==

"@sindresorhus/is@^3.1.1":
version "3.1.2"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-3.1.2.tgz#548650de521b344e3781fbdb0ece4aa6f729afb8"
integrity sha512-JiX9vxoKMmu8Y3Zr2RVathBL1Cdu4Nt4MuNWemt1Nc06A0RAin9c5FArkhGsyMBWfCu4zj+9b+GxtjAnE4qqLQ==
"@sindresorhus/is@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.0.0.tgz#2ff674e9611b45b528896d820d3d7a812de2f0e4"
integrity sha512-FyD2meJpDPjyNQejSjvnhpgI/azsQkA4lGbuu5BQZfjvJ9cbRZXzeWL2HceCekW4lixO9JPesIIQkSoLjeJHNQ==

"@svgr/babel-plugin-add-jsx-attribute@^5.4.0":
version "5.4.0"
Expand Down Expand Up @@ -4023,12 +4023,12 @@ got@^10.7.0:
to-readable-stream "^2.0.0"
type-fest "^0.10.0"

got@^11.7.0:
version "11.7.0"
resolved "https://registry.yarnpkg.com/got/-/got-11.7.0.tgz#a386360305571a74548872e674932b4ef70d3b24"
integrity sha512-7en2XwH2MEqOsrK0xaKhbWibBoZqy+f1RSUoIeF1BLcnf+pyQdDsljWMfmOh+QKJwuvDIiKx38GtPh5wFdGGjg==
got@^11.8.1:
version "11.8.1"
resolved "https://registry.yarnpkg.com/got/-/got-11.8.1.tgz#df04adfaf2e782babb3daabc79139feec2f7e85d"
integrity sha512-9aYdZL+6nHmvJwHALLwKSUZ0hMwGaJGYv3hoPLPgnT8BoBXm1SjnZeky+91tfwJaDzun2s4RsBRy48IEYv2q2Q==
dependencies:
"@sindresorhus/is" "^3.1.1"
"@sindresorhus/is" "^4.0.0"
"@szmarczak/http-timer" "^4.0.5"
"@types/cacheable-request" "^6.0.1"
"@types/responselike" "^1.0.0"
Expand Down