Skip to content

Commit 4af1c35

Browse files
francescoopiccoliFrancesco Piccoli
and
Francesco Piccoli
authored
feat(aws-lsp-codewhisperer-runtimes): add webworker iam bundling (#833)
* feat: add IAM webworker bundling in codewhisperer-runtimes --------- Co-authored-by: Francesco Piccoli <[email protected]>
1 parent aa85848 commit 4af1c35

File tree

4 files changed

+85
-7
lines changed

4 files changed

+85
-7
lines changed

app/aws-lsp-codewhisperer-runtimes/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
"dependencies": {
1313
"@aws/language-server-runtimes": "^0.2.40",
1414
"@aws/lsp-codewhisperer": "*",
15-
"copyfiles": "^2.4.1"
15+
"copyfiles": "^2.4.1",
16+
"https-browserify": "^1.0.0",
17+
"os-browserify": "^0.3.0",
18+
"path-browserify": "^1.0.1",
19+
"stream-http": "^3.2.0"
1620
},
1721
"devDependencies": {
1822
"node-loader": "^2.1.0",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { webworker } from '@aws/language-server-runtimes/runtimes/webworker'
2+
import { RuntimeProps } from '@aws/language-server-runtimes/runtimes/runtime'
3+
import { CodeWhispererServerIAM } from '@aws/lsp-codewhisperer/out/language-server/codeWhispererServer'
4+
5+
const props: RuntimeProps = {
6+
version: '1.0.0',
7+
servers: [CodeWhispererServerIAM],
8+
name: 'AWS CodeWhisperer',
9+
}
10+
11+
webworker(props)

app/aws-lsp-codewhisperer-runtimes/webpack.config.js

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,40 @@ const nodeJsIamBundleConfig = {
5454
target: 'node',
5555
}
5656

57-
module.exports = [nodeJsBearerTokenBundleConfig, nodeJsIamBundleConfig]
57+
const webworkerIamBundleConfig = {
58+
target: 'webworker',
59+
mode: 'production',
60+
output: {
61+
path: path.resolve(__dirname, 'build'),
62+
filename: '[name].js',
63+
},
64+
entry: {
65+
worker: './src/iam-webworker.ts',
66+
},
67+
resolve: {
68+
fallback: {
69+
path: 'path-browserify',
70+
os: 'os-browserify',
71+
https: 'https-browserify',
72+
http: 'stream-http',
73+
process: false,
74+
},
75+
extensions: ['.ts', '.tsx', '.js', '.jsx'],
76+
},
77+
module: {
78+
parser: {
79+
javascript: {
80+
importMeta: false,
81+
},
82+
},
83+
rules: [
84+
{
85+
test: /\.(ts|tsx)$/,
86+
loader: 'ts-loader',
87+
exclude: /node_modules/,
88+
},
89+
],
90+
},
91+
}
92+
93+
module.exports = [nodeJsBearerTokenBundleConfig, nodeJsIamBundleConfig, webworkerIamBundleConfig]

package-lock.json

Lines changed: 32 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)