How to use the userscript-metadata.DEFAULT_ITEMS function in userscript-metadata

To help you get started, we’ve selected a few userscript-metadata examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SimonAlling / userscripter / src / build / internal / webpack.ts View on Github external
hostedAt: null,
    mainFile: "main.ts",
    mode: Mode.development,
    nightly: false,
    now: x.now,
    outDir: "dist",
    rootDir: x.rootDir,
    sassVariableGetter: "getGlobal",
    sassVariables: {},
    sourceDir: "src",
    verbose: false,
});

export const DEFAULT_METADATA_SCHEMA: Metadata.ValidateOptions = {
    items: {
        ...Metadata.DEFAULT_ITEMS,
        version: Metadata.DEFAULT_ITEMS.version.butRequired(), // Validated against a subset of SemVer by default.
        run_at: Metadata.DEFAULT_ITEMS.run_at.butRequired(),
    },
    warnings: Metadata.DEFAULT_WARNINGS,
    underscoresAsHyphens: true,
} as const;

export function createWebpackConfig(x: WebpackConfigParameters): webpack.Configuration {
    const buildConfig = (
        // We intentionally ignore any errors here; they will be handled by our Webpack plugin.
        overrideBuildConfig(x.buildConfig, x.env).buildConfig
    );
    const {
        allowJs,
        id,
        mainFile,
github SimonAlling / userscripter / src / build / internal / webpack.ts View on Github external
mainFile: "main.ts",
    mode: Mode.development,
    nightly: false,
    now: x.now,
    outDir: "dist",
    rootDir: x.rootDir,
    sassVariableGetter: "getGlobal",
    sassVariables: {},
    sourceDir: "src",
    verbose: false,
});

export const DEFAULT_METADATA_SCHEMA: Metadata.ValidateOptions = {
    items: {
        ...Metadata.DEFAULT_ITEMS,
        version: Metadata.DEFAULT_ITEMS.version.butRequired(), // Validated against a subset of SemVer by default.
        run_at: Metadata.DEFAULT_ITEMS.run_at.butRequired(),
    },
    warnings: Metadata.DEFAULT_WARNINGS,
    underscoresAsHyphens: true,
} as const;

export function createWebpackConfig(x: WebpackConfigParameters): webpack.Configuration {
    const buildConfig = (
        // We intentionally ignore any errors here; they will be handled by our Webpack plugin.
        overrideBuildConfig(x.buildConfig, x.env).buildConfig
    );
    const {
        allowJs,
        id,
        mainFile,
        mode,