Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
Pushing latest changes - testing localhost content compat
Browse files Browse the repository at this point in the history
  • Loading branch information
keithrcagney committed Dec 21, 2019
1 parent 5298a02 commit 9b30c78
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
},
Expand All @@ -26,12 +26,12 @@
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
"--extensionTestsPath=${workspaceFolder}/out/test/"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
"preLaunchTask": "npm: test-compile"
}
]
}
14 changes: 7 additions & 7 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.vscode/**
.vscode-test/**
out/test/**
src/**
.vscode
node_modules
out/
src/
tsconfig.json
webpack.config.js
.gitignore
vsc-extension-quickstart.md
**/tsconfig.json
**/tslint.json
**/*.map
**/*.ts
**/tslint.json
Binary file added aesop-0.0.1.vsix
Binary file not shown.
2 changes: 2 additions & 0 deletions dist/extension.js

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

1 change: 1 addition & 0 deletions dist/extension.js.map

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

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"onCommand:extension.tollTheHour",
"onCommand:extension.getStories"
],
"main": "./out/extension.js",
"main": "./dist/extension",
"contributes": {
"commands": [
{
Expand All @@ -34,7 +34,10 @@
]
},
"scripts": {
"vscode:prepublish": "npm run compile",
"vscode:prepublish": "webpack --mode production",
"webpack": "webpack --mode development",
"webpack-dev": "webpack --mode development --watch",
"test-compile": "tsc -p ./",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile",
Expand Down
21 changes: 10 additions & 11 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import * as vscode from 'vscode';
import * as express from 'express';
// import * as express from 'express';

//port should be variable to listen for action in the user's active terminal
const PORT = 8509;
const server = express();
const PORT = 6006;
// const server = express();

// import MainUI from './toolbars/main_ui.ts';
// import {server, PORT} from './server/server';

export function activate(context: vscode.ExtensionContext) {
server.get('/', (req : Object, res : Object) => {
vscode.window.showInformationMessage('Aesop server online');
res.end();
});

server.listen(PORT);
// server.get('/', (req : Object, res : Object) => {
// vscode.window.showInformationMessage('Aesop server online');
// res.end();
// });
// server.listen(PORT);

//create disposable variable type, registers awaken command & opens webview
let disposable = vscode.commands.registerCommand('extension.aesopAwaken', () => {
Expand Down Expand Up @@ -43,7 +42,7 @@ export function activate(context: vscode.ExtensionContext) {

//access the first opened folder of the workspace array
//a potentially problematic assumption in multi-folder workspaces
const rootPath = vscode.workspace.workspaceFolders[0];
const rootPath : any = vscode.workspace.workspaceFolders[0];

//define a path to SB webpack bundle outputs (in user workspace /node_modules/ folder)
const distGlob = new vscode.RelativePattern(rootPath, "*/node_modules/@storybook/core/dist/public/");
Expand Down Expand Up @@ -85,7 +84,7 @@ export function activate(context: vscode.ExtensionContext) {
<style>
html { width: 100%, height: 100%, min-height: 100%; display: flex; padding: 0, margin: 0}
body { flex: 1; display: inline-flex; width: 100%, justify-content: center}
iframe { flex-fl: 1; border: none; background: white; width: 50%}
iframe { flex: 1; border: none; background: white; min-width: 50%; max-height: 80%; vertical-align: center;}
</style>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"sourceMap": true,
"rootDir": "src",
"strict": true /* enable all strict type-checking options */
"strict": false /* enable all strict type-checking options */
/* Additional Checks */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
Expand Down
39 changes: 39 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//@ts-check

'use strict';

const path = require('path');

/**@type {import('webpack').Configuration}*/
const config = {
target: 'node',
entry: './src/extension.ts',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'extension.js',
libraryTarget: 'commonjs2',
devtoolModuleFilenameTemplate: '../[resource-path]'
},
devtool: 'source-map',
externals: {
vscode: 'commonjs vscode'
},
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader'
}
]
}
]
}
};

module.exports = config;

0 comments on commit 9b30c78

Please sign in to comment.