Skip to content

Commit 99578c9

Browse files
authored
Merge pull request #357 from karthik2804/v4_template_update
V4 template update
2 parents 07a03aa + 12d3972 commit 99578c9

File tree

126 files changed

+1226
-1164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+1226
-1164
lines changed

examples/aws/s3/.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/aws/s3/config/knitwit.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

examples/aws/s3/package-lock.json

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

examples/aws/s3/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"build": "knitwit --out-dir build/wit/knitwit --out-world combined && npx webpack --mode=production && npx mkdirp dist && npx j2w -i build/bundle.js -d build/wit/knitwit -n combined -o dist/s3.wasm",
7+
"build": "npx webpack && mkdirp dist && j2w -i build/bundle.js -o dist/s3.wasm",
88
"test": "echo \"Error: no test specified\" && exit 1"
99
},
1010
"keywords": [],
@@ -19,7 +19,8 @@
1919
"@fermyon/knitwit": "0.3.0"
2020
},
2121
"dependencies": {
22-
"@fermyon/spin-sdk": "^3.0.0",
22+
"@spinframework/build-tools": "1.0.0",
23+
"@spinframework/wasi-http-proxy": "1.0.0",
2324
"itty-router": "^5.0.18",
2425
"@aws-sdk/client-s3": "^3.600.0"
2526
}

examples/aws/s3/webpack.config.js

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,44 @@
1-
const path = require('path');
2-
const SpinSdkPlugin = require("@fermyon/spin-sdk/plugins/webpack")
1+
import path from 'path';
2+
import SpinSdkPlugin from "@spinframework/build-tools/plugins/webpack/index.js";
33

4-
module.exports = {
5-
entry: './src/index.ts',
6-
experiments: {
7-
outputModule: true,
8-
},
9-
module: {
10-
rules: [
11-
{
12-
test: /\.tsx?$/,
13-
use: 'ts-loader',
14-
exclude: /node_modules/,
15-
},
4+
const config = async () => {
5+
let SpinPlugin = await SpinSdkPlugin.init()
6+
return {
7+
mode: 'production',
8+
stats: 'errors-only',
9+
entry: './src/index.ts',
10+
experiments: {
11+
outputModule: true,
12+
},
13+
module: {
14+
rules: [
15+
{
16+
test: /\.tsx?$/,
17+
use: 'ts-loader',
18+
exclude: /node_modules/,
19+
},
20+
],
21+
},
22+
resolve: {
23+
extensions: ['.tsx', '.ts', '.js'],
24+
},
25+
output: {
26+
path: path.resolve(process.cwd(), './build'),
27+
filename: 'bundle.js',
28+
module: true,
29+
library: {
30+
type: "module",
31+
}
32+
},
33+
plugins: [
34+
SpinPlugin
1635
],
17-
},
18-
resolve: {
19-
extensions: ['.tsx', '.ts', '.js'],
20-
},
21-
output: {
22-
path: path.resolve(__dirname, './build'),
23-
filename: 'bundle.js',
24-
module: true,
25-
library: {
26-
type: "module",
36+
optimization: {
37+
minimize: false
38+
},
39+
performance: {
40+
hints: false,
2741
}
28-
},
29-
plugins: [
30-
new SpinSdkPlugin()
31-
],
32-
optimization: {
33-
minimize: false
34-
},
35-
};
42+
};
43+
}
44+
export default config

examples/aws/sqs/.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/aws/sqs/config/knitwit.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

examples/aws/sqs/package-lock.json

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

examples/aws/sqs/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"build": "knitwit --out-dir build/wit/knitwit --out-world combined && npx webpack --mode=production && npx mkdirp dist && npx j2w -i build/bundle.js -d build/wit/knitwit -n combined -o dist/sqs.wasm",
7+
"build": "npx webpack && mkdirp dist && j2w -i build/bundle.js -o dist/sqs.wasm",
88
"test": "echo \"Error: no test specified\" && exit 1"
99
},
1010
"keywords": [],
@@ -19,7 +19,8 @@
1919
"@fermyon/knitwit": "0.3.0"
2020
},
2121
"dependencies": {
22-
"@fermyon/spin-sdk": "^3.0.0",
22+
"@spinframework/build-tools": "1.0.0",
23+
"@spinframework/wasi-http-proxy": "1.0.0",
2324
"itty-router": "^5.0.18",
2425
"@aws-sdk/client-sqs": "^3.600.0"
2526
}

examples/aws/sqs/webpack.config.js

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,44 @@
1-
const path = require('path');
2-
const SpinSdkPlugin = require("@fermyon/spin-sdk/plugins/webpack")
1+
import path from 'path';
2+
import SpinSdkPlugin from "@spinframework/build-tools/plugins/webpack/index.js";
33

4-
module.exports = {
5-
entry: './src/index.ts',
6-
experiments: {
7-
outputModule: true,
8-
},
9-
module: {
10-
rules: [
11-
{
12-
test: /\.tsx?$/,
13-
use: 'ts-loader',
14-
exclude: /node_modules/,
15-
},
4+
const config = async () => {
5+
let SpinPlugin = await SpinSdkPlugin.init()
6+
return {
7+
mode: 'production',
8+
stats: 'errors-only',
9+
entry: './src/index.ts',
10+
experiments: {
11+
outputModule: true,
12+
},
13+
module: {
14+
rules: [
15+
{
16+
test: /\.tsx?$/,
17+
use: 'ts-loader',
18+
exclude: /node_modules/,
19+
},
20+
],
21+
},
22+
resolve: {
23+
extensions: ['.tsx', '.ts', '.js'],
24+
},
25+
output: {
26+
path: path.resolve(process.cwd(), './build'),
27+
filename: 'bundle.js',
28+
module: true,
29+
library: {
30+
type: "module",
31+
}
32+
},
33+
plugins: [
34+
SpinPlugin
1635
],
17-
},
18-
resolve: {
19-
extensions: ['.tsx', '.ts', '.js'],
20-
},
21-
output: {
22-
path: path.resolve(__dirname, './build'),
23-
filename: 'bundle.js',
24-
module: true,
25-
library: {
26-
type: "module",
36+
optimization: {
37+
minimize: false
38+
},
39+
performance: {
40+
hints: false,
2741
}
28-
},
29-
plugins: [
30-
new SpinSdkPlugin()
31-
],
32-
optimization: {
33-
minimize: false
34-
},
35-
};
42+
};
43+
}
44+
export default config

0 commit comments

Comments
 (0)