@prairielearn/compiled-assets 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/package.json +7 -7
- package/src/cli.ts +2 -2
- package/src/index.test.ts +1 -1
- package/src/index.ts +3 -3
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prairielearn/compiled-assets",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"bin": "dist/cli.js",
|
|
6
6
|
"repository": {
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"test": "mocha --no-config --require ts-node/register src/index.test.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@prairielearn/html": "^3.0.
|
|
18
|
-
"commander": "^
|
|
19
|
-
"esbuild": "^0.
|
|
17
|
+
"@prairielearn/html": "^3.0.3",
|
|
18
|
+
"commander": "^11.0.0",
|
|
19
|
+
"esbuild": "^0.18.11",
|
|
20
20
|
"express": "^4.18.2",
|
|
21
21
|
"express-static-gzip": "^2.1.7",
|
|
22
22
|
"fs-extra": "^11.1.1",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@prairielearn/tsconfig": "^0.0.0",
|
|
29
|
-
"@types/node": "^18.16.
|
|
29
|
+
"@types/node": "^18.16.19",
|
|
30
30
|
"chai": "^4.3.7",
|
|
31
31
|
"get-port": "^5.1.1",
|
|
32
32
|
"mocha": "^10.2.0",
|
|
33
|
-
"node-fetch": "^2.6.
|
|
33
|
+
"node-fetch": "^2.6.12",
|
|
34
34
|
"ts-node": "^10.9.1",
|
|
35
|
-
"typescript": "^5.1.
|
|
35
|
+
"typescript": "^5.1.6"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/src/cli.ts
CHANGED
|
@@ -15,7 +15,7 @@ type CompressedSizes = Record<string, Record<string, number>>;
|
|
|
15
15
|
|
|
16
16
|
async function writeCompressedAssets(
|
|
17
17
|
destination: string,
|
|
18
|
-
manifest: Record<string, string
|
|
18
|
+
manifest: Record<string, string>,
|
|
19
19
|
): Promise<CompressedSizes> {
|
|
20
20
|
const compressedSizes: CompressedSizes = {};
|
|
21
21
|
await Promise.all(
|
|
@@ -31,7 +31,7 @@ async function writeCompressedAssets(
|
|
|
31
31
|
gzip: gzipCompressed.length,
|
|
32
32
|
brotli: brotliCompressed.length,
|
|
33
33
|
};
|
|
34
|
-
})
|
|
34
|
+
}),
|
|
35
35
|
);
|
|
36
36
|
return compressedSizes;
|
|
37
37
|
}
|
package/src/index.test.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -123,7 +123,7 @@ export function handler(): RequestHandler {
|
|
|
123
123
|
(proxyRes) => {
|
|
124
124
|
res.writeHead(proxyRes.statusCode ?? 500, proxyRes.headers);
|
|
125
125
|
proxyRes.pipe(res, { end: true });
|
|
126
|
-
}
|
|
126
|
+
},
|
|
127
127
|
);
|
|
128
128
|
req.pipe(proxyReq, { end: true });
|
|
129
129
|
};
|
|
@@ -201,7 +201,7 @@ async function buildAssets(sourceDirectory: string, buildDirectory: string) {
|
|
|
201
201
|
function makeManifest(
|
|
202
202
|
metafile: Metafile,
|
|
203
203
|
sourceDirectory: string,
|
|
204
|
-
buildDirectory: string
|
|
204
|
+
buildDirectory: string,
|
|
205
205
|
): Record<string, string> {
|
|
206
206
|
const manifest: Record<string, string> = {};
|
|
207
207
|
Object.entries(metafile.outputs).forEach(([outputPath, meta]) => {
|
|
@@ -216,7 +216,7 @@ function makeManifest(
|
|
|
216
216
|
|
|
217
217
|
export async function build(
|
|
218
218
|
sourceDirectory: string,
|
|
219
|
-
buildDirectory: string
|
|
219
|
+
buildDirectory: string,
|
|
220
220
|
): Promise<AssetsManifest> {
|
|
221
221
|
// Remove existing assets to ensure that no stale assets are left behind.
|
|
222
222
|
await fs.remove(buildDirectory);
|