Skip to content

Commit

Permalink
fix: webpack bundle and goodbye node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthHater committed Jan 14, 2021
1 parent 674d019 commit 55287f1
Show file tree
Hide file tree
Showing 16 changed files with 4,302 additions and 11,777 deletions.
20 changes: 7 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Install npm dependencies...weeeeee
command: yarn
command: npm i
- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- run:
name: build
command: yarn run build
command: npm run webpack
release:
working_directory: ~/vscode-iq-plugin
docker:
Expand All @@ -29,22 +29,16 @@ jobs:
command: sudo chown -R circleci:circleci /usr/local/lib && sudo chown -R circleci:circleci /usr/local/bin
- run:
name: Install dependencies
command: yarn
- run:
name: Build extension
command: yarn run build
command: npm i
- run:
name: Install publishing packages
command: yarn global add vsce semantic-release @semantic-release/changelog @semantic-release/[email protected] @semantic-release/npm
command: npm i -g semantic-release @semantic-release/changelog @semantic-release/[email protected] @semantic-release/npm
- run:
name: Attempt publish to GitHub
command: npx semantic-release -b master
- run:
name: Package for Visual Studio Code Extension Marketplace
command: vsce package --yarn
- run:
name: Publish to Visual Studio Code Extension Marketplace
command: vsce publish --yarn -p $VSCODE_TOKEN
command: vsce publish -p $VSCODE_TOKEN
- run:
name: Publish to Open VSX
command: npx ovsx publish -p $VSX_TOKEN
Expand Down
7 changes: 7 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ out/
src/
public/
tsconfig.json
tsconfig.extension.json
tsconfig.prod.json
tsconfig.test.json
tslint.json
ext-src/
.circleci/
.github/
.vscode/
types/
node_modules/
18 changes: 2 additions & 16 deletions ext-src/ComponentInfoPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,24 +318,11 @@ export class ComponentInfoPanel {
);
const resourceSrc = onDiskPath.with({ scheme: "vscode-resource" });

const manifest = require(path.join(
this._extensionPath,
"build",
"asset-manifest.json"
));
const mainScript = manifest["main.js"];
const mainStyle = manifest["main.css"];

const scriptPathOnDisk = vscode.Uri.file(
path.join(this._extensionPath, "build", mainScript)
path.join(this._extensionPath, "build", 'index.js')
);
const scriptUri = scriptPathOnDisk.with({ scheme: "vscode-resource" });

const stylePathOnDisk = vscode.Uri.file(
path.join(this._extensionPath, "build", mainStyle)
);
const styleUri = stylePathOnDisk.with({ scheme: "vscode-resource" });

// Use a nonce to whitelist which scripts can be run
const nonce = this.getNonce();

Expand All @@ -345,10 +332,9 @@ export class ComponentInfoPanel {
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Security-Policy" content="default-src * vscode-resource:; script-src * vscode-resource:; connect-src 'self'; style-src * vscode-resource:; media-src * vscode-resource:">
<meta http-equiv="Content-Security-Policy" content="default-src * vscode-resource:; script-src * vscode-resource:; connect-src 'self'; style-src 'self' 'unsafe-inline' * vscode-resource:; media-src * vscode-resource:">
<link rel="stylesheet" href="${resourceSrc}/css/react-tabs.css">
<link rel="stylesheet" href="${resourceSrc}/css/styles.css">
<link rel="stylesheet" href="${styleUri}">
<title>Component Info</title>
</head>
<body>
Expand Down
5 changes: 3 additions & 2 deletions ext-src/packages/golang/GolangUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ export class GolangUtils {
let { stdout, stderr } = await exec(`go list -m all`, {
cwd: PackageDependenciesHelper.getWorkspaceRoot(),
env: {
PATH: process.env.PATH,
HOME: this.getGoCacheDirectory()
"NODE_ENV": "production",
"PATH": process.env["PATH"],
"HOME": this.getGoCacheDirectory()
}
});

Expand Down
5 changes: 1 addition & 4 deletions ext-src/packages/maven/MavenUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ export class MavenUtils {
mvnCommand = `mvn dependency:tree -Dverbose -DappendOutput=true -DoutputFile="${tmpFile.path}" -f "${pomFile}"`;

await exec(mvnCommand, {
cwd: PackageDependenciesHelper.getWorkspaceRoot(),
env: {
PATH: process.env.PATH
}
cwd: PackageDependenciesHelper.getWorkspaceRoot()
});

if (!fs.existsSync(tmpFile.path)) {
Expand Down
5 changes: 1 addition & 4 deletions ext-src/packages/r/RUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ export class RUtils {
try {
let {stdout, stderr } = await exec(`RScript ` + PackageDependenciesHelper.getExtensionPath() + `/scripts/installed.r`
, {
cwd: PackageDependenciesHelper.getWorkspaceRoot(),
env: {
PATH: process.env.PATH
}
cwd: PackageDependenciesHelper.getWorkspaceRoot()
});

if (stdout != "" && stderr === "") {
Expand Down
4 changes: 2 additions & 2 deletions ext-src/utils/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export class Logger implements ILogger {

let path: string = join(filePath, '.sonatypeIQExtension.combined.log');

log4js.addLayout('json', (config) => {
return function(logEvent) {
log4js.addLayout('json', (config: any) => {
return function(logEvent: any) {
return JSON.stringify(logEvent) + ',';
}
});
Expand Down
Loading

0 comments on commit 55287f1

Please sign in to comment.