New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@serwist/webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@serwist/webpack-plugin - npm Package Compare versions

Comparing version 9.0.0-preview.12 to 9.0.0-preview.13

dist/chunks/schema.js

5

dist/index.d.ts
import { InjectManifest } from "./inject-manifest.js";
export { InjectManifest };
import type { InjectManifestOptions, InjectManifestOptionsComplete, WebpackPartial, WebpackResolved } from "./lib/types.js";
import { validateInjectManifestOptions } from "./lib/validator.js";
export { InjectManifest, validateInjectManifestOptions };
export type { InjectManifestOptions, InjectManifestOptionsComplete, WebpackPartial, WebpackResolved };
//# sourceMappingURL=index.d.ts.map

21

dist/index.js

@@ -1,8 +0,21 @@

import { transformManifest, getSourceMapURL, validateWebpackInjectManifestOptions, escapeRegExp, replaceAndUpdateSourceMap } from '@serwist/build';
import stringify from 'fast-json-stable-stringify';
import { transformManifest, getSourceMapURL, stringify, escapeRegExp, replaceAndUpdateSourceMap } from '@serwist/build';
import prettyBytes from 'pretty-bytes';
import upath from 'upath';
import { validationErrorMap, SerwistConfigError } from '@serwist/build/schema';
import crypto from 'crypto';
import { r as relativeToOutputPath } from './chunks/relative-to-output-path.js';
const validateInjectManifestOptions = async (input)=>{
const result = await (await import('./chunks/schema.js')).injectManifestOptions.spa(input, {
errorMap: validationErrorMap
});
if (!result.success) {
throw new SerwistConfigError({
moduleName: "@serwist/webpack-plugin",
message: JSON.stringify(result.error.format(), null, 2)
});
}
return result.data;
};
const getAssetHash = (asset)=>{

@@ -241,3 +254,3 @@ if (asset.info?.immutable) {

async handleMake(compilation, parentCompiler) {
this.config = await validateWebpackInjectManifestOptions(this.config);
this.config = await validateInjectManifestOptions(this.config);
this.config.swDest = relativeToOutputPath(compilation, this.config.swDest);

@@ -292,2 +305,2 @@ _generatedAssetNames.add(this.config.swDest);

export { InjectManifest };
export { InjectManifest, validateInjectManifestOptions };

@@ -1,3 +0,3 @@

import type { WebpackInjectManifestOptions } from "@serwist/build";
import type { Compiler } from "webpack";
import type { InjectManifestOptions } from "./lib/types.js";
/**

@@ -26,3 +26,3 @@ * This class supports compiling a service worker file provided via `swSrc`,

export declare class InjectManifest {
protected config: WebpackInjectManifestOptions;
protected config: InjectManifestOptions;
private alreadyCalled;

@@ -33,3 +33,3 @@ private webpack;

*/
constructor(config: WebpackInjectManifestOptions);
constructor(config: InjectManifestOptions);
/**

@@ -36,0 +36,0 @@ * @param compiler default compiler object passed from webpack

@@ -1,4 +0,5 @@

import type { ManifestEntry, WebpackInjectManifestOptions } from "@serwist/build";
import type { ManifestEntry } from "@serwist/build";
import type { Compilation } from "webpack";
export declare const getManifestEntriesFromCompilation: (compilation: Compilation, config: WebpackInjectManifestOptions) => Promise<{
import type { InjectManifestOptions } from "./types.js";
export declare const getManifestEntriesFromCompilation: (compilation: Compilation, config: InjectManifestOptions) => Promise<{
size: number;

@@ -5,0 +6,0 @@ sortedEntries: ManifestEntry[] | undefined;

{
"name": "@serwist/webpack-plugin",
"version": "9.0.0-preview.12",
"version": "9.0.0-preview.13",
"type": "module",
"description": "A plugin for your Webpack build process, helping you generate a manifest of local files that should be precached.",
"description": "A plugin for your webpack build process, helping you generate a manifest of local files that should be precached.",
"files": [

@@ -34,2 +34,5 @@ "src",

"./dist/index.internal.d.ts"
],
"schema": [
"./dist/index.schema.d.ts"
]

@@ -47,17 +50,22 @@ }

},
"./schema": {
"types": "./dist/index.schema.d.ts",
"default": "./dist/index.schema.js"
},
"./package.json": "./package.json"
},
"dependencies": {
"fast-json-stable-stringify": "2.1.0",
"pretty-bytes": "6.1.1",
"upath": "2.0.1",
"@serwist/build": "9.0.0-preview.12"
"zod": "3.22.4",
"@serwist/build": "9.0.0-preview.13"
},
"devDependencies": {
"@types/node": "20.11.16",
"@types/node": "20.11.24",
"@types/webpack": "5.28.5",
"rollup": "4.9.6",
"typescript": "5.4.0-dev.20240206",
"webpack": "5.90.1",
"@serwist/constants": "9.0.0-preview.12"
"rollup": "4.12.0",
"typescript": "5.5.0-dev.20240304",
"webpack": "5.90.3",
"@serwist/utils": "9.0.0-preview.13",
"@serwist/constants": "9.0.0-preview.13"
},

@@ -64,0 +72,0 @@ "peerDependencies": {

@@ -10,3 +10,6 @@ /*

import { InjectManifest } from "./inject-manifest.js";
import type { InjectManifestOptions, InjectManifestOptionsComplete, WebpackPartial, WebpackResolved } from "./lib/types.js";
import { validateInjectManifestOptions } from "./lib/validator.js";
export { InjectManifest };
export { InjectManifest, validateInjectManifestOptions };
export type { InjectManifestOptions, InjectManifestOptionsComplete, WebpackPartial, WebpackResolved };

@@ -1,14 +0,7 @@

/*
Copyright 2018 Google LLC
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
import type { WebpackInjectManifestOptions } from "@serwist/build";
import { escapeRegExp, replaceAndUpdateSourceMap, validateWebpackInjectManifestOptions } from "@serwist/build";
import stringify from "fast-json-stable-stringify";
import { escapeRegExp, replaceAndUpdateSourceMap, stringify } from "@serwist/build";
import prettyBytes from "pretty-bytes";
import upath from "upath";
import type { Compilation, Compiler, WebpackError, default as Webpack } from "webpack";
import type { InjectManifestOptions } from "./lib/types.js";
import { validateInjectManifestOptions } from "./lib/validator.js";

@@ -46,3 +39,3 @@ import { getManifestEntriesFromCompilation } from "./lib/get-manifest-entries-from-compilation.js";

export class InjectManifest {
protected config: WebpackInjectManifestOptions;
protected config: InjectManifestOptions;
private alreadyCalled: boolean;

@@ -54,3 +47,3 @@ private webpack: typeof Webpack;

*/
constructor(config: WebpackInjectManifestOptions) {
constructor(config: InjectManifestOptions) {
this.config = config;

@@ -84,3 +77,3 @@ this.alreadyCalled = false;

*/
private async getManifestEntries(compilation: Compilation, config: WebpackInjectManifestOptions) {
private async getManifestEntries(compilation: Compilation, config: InjectManifestOptions) {
if (config.disablePrecacheManifest) {

@@ -216,3 +209,3 @@ return {

private async handleMake(compilation: Compilation, parentCompiler: Compiler): Promise<void> {
this.config = await validateWebpackInjectManifestOptions(this.config);
this.config = await validateInjectManifestOptions(this.config);
this.config.swDest = relativeToOutputPath(compilation, this.config.swDest!);

@@ -219,0 +212,0 @@ _generatedAssetNames.add(this.config.swDest);

@@ -9,3 +9,3 @@ /*

import type { FileDetails, ManifestEntry, WebpackInjectManifestOptions } from "@serwist/build";
import type { FileDetails, ManifestEntry } from "@serwist/build";
import { transformManifest } from "@serwist/build";

@@ -16,2 +16,3 @@ import type { Asset, Chunk, Compilation, WebpackError } from "webpack";

import { resolveWebpackURL } from "./resolve-webpack-url.js";
import type { InjectManifestOptions } from "./types.js";

@@ -109,3 +110,3 @@ /**

*/
const filterAssets = (compilation: Compilation, config: WebpackInjectManifestOptions): Set<Asset> => {
const filterAssets = (compilation: Compilation, config: InjectManifestOptions): Set<Asset> => {
const filteredAssets = new Set<Asset>();

@@ -183,3 +184,3 @@ const assets = compilation.getAssets();

compilation: Compilation,
config: WebpackInjectManifestOptions,
config: InjectManifestOptions,
): Promise<{ size: number; sortedEntries: ManifestEntry[] | undefined }> => {

@@ -186,0 +187,0 @@ const filteredAssets = filterAssets(compilation, config);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc