diff --git a/.github/Image/DarkAstro.svg b/.github/Image/DarkAstro.svg new file mode 100644 index 00000000..316afa57 --- /dev/null +++ b/.github/Image/DarkAstro.svg @@ -0,0 +1,24 @@ + diff --git a/.github/Image/LightAstro.svg b/.github/Image/LightAstro.svg new file mode 100644 index 00000000..3315635a --- /dev/null +++ b/.github/Image/LightAstro.svg @@ -0,0 +1,25 @@ + diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4d4096fb..0bd58331 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,5 @@ version: 2 + updates: - package-ecosystem: "github-actions" directory: "/" diff --git a/.github/workflows/dependabot.yml b/.github/workflows/Dependabot.yml similarity index 69% rename from .github/workflows/dependabot.yml rename to .github/workflows/Dependabot.yml index fb496916..819f8a17 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/Dependabot.yml @@ -1,29 +1,44 @@ name: Dependabot concurrency: - group: dependabot-${{ github.workflow }}-${{ github.ref }} + group: Dependabot-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -on: - workflow_dispatch: - pull_request: - permissions: + security-events: write contents: write pull-requests: write +on: + workflow_dispatch: + pull_request: + jobs: - approve-and-merge: + Approve: runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: - uses: dependabot/fetch-metadata@v1.6.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: gh pr review --approve "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + Merge: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v1.6.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: gh pr merge --auto --merge "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} diff --git a/.github/workflows/NPM.yml b/.github/workflows/NPM.yml index 59e489f8..c890b37a 100644 --- a/.github/workflows/NPM.yml +++ b/.github/workflows/NPM.yml @@ -1,11 +1,13 @@ name: NPM concurrency: - group: npm-${{ github.workflow }}-${{ github.ref }} + group: NPM-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: security-events: write + contents: write + pull-requests: write on: workflow_dispatch: @@ -14,17 +16,21 @@ on: workflow_call: jobs: - publish: + Publish: runs-on: ubuntu-latest + permissions: contents: read id-token: write + steps: - - uses: actions/checkout@v3.5.3 - - uses: actions/setup-node@v3.7.0 + - uses: actions/checkout@v4.1.1 + + - uses: actions/setup-node@v4.0.0 with: node-version: "18" registry-url: "https://registry.npmjs.org" + - run: npm install -g npm - name: Publish . diff --git a/.github/workflows/node.yml b/.github/workflows/Node.yml similarity index 83% rename from .github/workflows/node.yml rename to .github/workflows/Node.yml index c44a32e4..bc12d1a7 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/Node.yml @@ -1,11 +1,13 @@ name: Node concurrency: - group: node-${{ github.workflow }}-${{ github.ref }} + group: Node-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: security-events: write + contents: write + pull-requests: write on: workflow_dispatch: @@ -16,7 +18,7 @@ on: workflow_call: jobs: - node: + Pre-Publish: runs-on: ubuntu-latest env: @@ -51,20 +53,19 @@ jobs: strategy: matrix: - node-version: [16, 18, 19] + node-version: [18, 19, 20] steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v4.1.1 + - uses: pnpm/action-setup@v2.4.0 with: - version: 8.6.6 + version: 8.6.12 run_install: | - recursive: true args: [ - --child-concurrency=9999, --link-workspace-packages=true, --lockfile-only, - --network-concurrency=9999, --prefer-frozen-lockfile=false, --shamefully-hoist=false, --shared-workspace-lockfile=true, @@ -72,18 +73,19 @@ jobs: --unsafe-perm=true ] - - uses: actions/setup-node@v3.7.0 + - uses: actions/setup-node@v4.0.0 with: node-version: ${{ matrix.node-version }} cache: "pnpm" cache-dependency-path: ./pnpm-lock.yaml + - run: pnpm install working-directory: . - run: pnpm run prepublishOnly working-directory: . - - uses: actions/upload-artifact@v3.1.2 + - uses: actions/upload-artifact@v4.0.0 with: - name: .-node-${{ matrix.node-version }}-Target + name: .-Node-${{ matrix.node-version }}-Target path: ./Target diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 9ef91a07..00000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: "CodeQL" - -concurrency: - group: codeql-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - -on: - workflow_dispatch: - push: - branches: [main] - pull_request: - branches: [main] - workflow_call: - -jobs: - codeql: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - TELEMETRY_DISABLED: 1 - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - - steps: - - uses: actions/checkout@v3.5.3 - - - uses: github/codeql-action/init@v2.21.3 - with: - languages: javascript - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2.21.3 - with: - category: "/language:javascript" diff --git a/.npmignore b/.npmignore index 1244cda2..d0265ba4 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,6 @@ .github/ -.turbo/ Source/ +Documentation/ +CHANGELOG.md +CODE_OF_CONDUCT.md +CONTRIBUTING.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e6f1ad3..9fd18e14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,114 @@ +## 2.2.5 + +- Bug fix + +## 2.2.4 + +- Cleanup +- Colorizes output + +## 2.2.3 + +- Cleanup + +## 2.2.2 + +- Cleanup + +## 2.2.1 + +- Bug fix + +## 2.2.0 + +- Bug fix +- Refactor allowing multiple parsers + +## 2.1.6 + +- Cleanup + +## 2.1.5 + +- Cleanup + +## 2.1.4 + +- Bug fix + +## 2.1.3 + +- Bug fix + +## 2.1.2 + +- Bug fix + +## 2.1.1 + +- Cleanup + +## 2.1.0 + +- Refactor +- Documentation + +## 2.0.15 + +- Cleanup + +## 2.0.14 + +- Cleanup + +## 2.0.13 + +- Cleanup + +## 2.0.12 + +- Cleanup + +## 2.0.11 + +- Cleanup + +## 2.0.10 + +- Cleanup + +## 2.0.9 + +- Cleanup + +## 2.0.8 + +- Cleanup + +## 2.0.7 + +- Cleanup + +## 2.0.6 + +- Cleanup + +## 2.0.5 + +- Cleanup + +## 2.0.4 + +- Cleanup + +## 2.0.2 + +- Cleanup + +## 2.0.1 + +- Restoration + ## 1.1.50 - Cleanup diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index e5da8c1c..b4f1f9be 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -73,9 +73,10 @@ representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at nikola@lightrix.help. All complaints will be reviewed and investigated promptly and fairly. -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. +reported to the community leaders responsible for enforcement at +nikola@nikolahristov.tech. All complaints will be reviewed and investigated +promptly and fairly. All community leaders are obligated to respect the privacy +and security of the reporter of any incident. ## Enforcement Guidelines diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 87ce38ce..c7401851 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,9 +61,10 @@ representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at nikola@lightrix.help. All complaints will be reviewed and investigated promptly and fairly. -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. +reported to the community leaders responsible for enforcement at +nikola@nikolahristov.tech. All complaints will be reviewed and investigated +promptly and fairly. All community leaders are obligated to respect the privacy +and security of the reporter of any incident. ## Enforcement Guidelines diff --git a/Documentation/.nojekyll b/Documentation/.nojekyll new file mode 100644 index 00000000..e2ac6616 --- /dev/null +++ b/Documentation/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/Documentation/Function/Function_Directory.directory.html b/Documentation/Function/Function_Directory.directory.html new file mode 100644 index 00000000..808dbd47 --- /dev/null +++ b/Documentation/Function/Function_Directory.directory.html @@ -0,0 +1 @@ +
Generated using TypeDoc
Generated using TypeDoc
Creates a sharp instance from an image
+Optional
options: SharpOptionsObject with optional attributes.
+A sharp instance that can be used to chain operations
+Invalid parameters
+Optional
input: string | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array | ArrayBuffer | BufferOptional
options: SharpOptionsGenerated using TypeDoc
Block libvips operations at runtime.
+This is in addition to the VIPS_BLOCK_UNTRUSTED
environment variable,
+which when set will block all "untrusted" operations.
List of libvips low-level operation names to block.
+0.32.4
+sharp.block({
operation: ['VipsForeignLoadTiff']
});
+
+Generated using TypeDoc
Gets or, when options are provided, sets the limits of libvips' operation cache. +Existing entries in the cache will be trimmed after any change in limits. +This method always returns cache statistics, useful for determining how much working memory is required for a particular task.
+Optional
options: boolean | CacheOptionsObject with the following attributes, or Boolean where true uses default cache settings and false removes all caching (optional, default true)
+The cache results.
+Generated using TypeDoc
Gets or sets the number of threads libvips' should create to process each image. +The default value is the number of CPU cores. A value of 0 will reset to this default. +The maximum number of images that can be processed in parallel is limited by libuv's UV_THREADPOOL_SIZE environment variable.
+Optional
concurrency: numberThe new concurrency value.
+The current concurrency value.
+Generated using TypeDoc
Generated using TypeDoc
Get and set use of SIMD vector unit instructions. Requires libvips to have been compiled with highway support. +Improves the performance of resize, blur and sharpen operations by taking advantage of the SIMD vector unit of the CPU, e.g. Intel SSE and ARM NEON.
+Optional
enable: booleanenable or disable use of SIMD vector unit instructions
+true if usage of SIMD vector unit instructions is enabled
+Generated using TypeDoc
Unblock libvips operations at runtime.
+This is useful for defining a list of allowed operations.
+List of libvips low-level operation names to unblock.
+0.32.4
+sharp.block({
operation: ['VipsForeignLoad']
});
sharp.unblock({
operation: ['VipsForeignLoadWebpFile']
});
+
+sharp.block({
operation: ['VipsForeignLoad']
});
sharp.unblock({
operation: ['VipsForeignLoadJpegBuffer', 'VipsForeignLoadPngBuffer']
});
+
+Generated using TypeDoc
Optional
Option: TypeGenerated using TypeDoc
Merges multiple objects of type Ts using the provided merge functions and built-in metadata.
+Rest
...Objects: TsGenerated using TypeDoc
Optional
afterCalled right after compress() is run.
+Optional
beforeCalled right after parse is run.
+Optional
cloneTransform a copy of input AST if true. Useful in case of AST reuse.
+false
+
+Optional
commentsSpecify what comments to leave:
+AstroCompress false
+
+csso true
+
+Optional
debugOutput debug information to stderr.
+false
+
+Optional
filenameFilename of input CSS, uses for source map generation.
+'<unknown>'
+
+Optional
forceEnables merging of
+rules with the same media query by splitted by other rules. +The optimisation is unsafe in general, but should work fine in most cases. Use it on your own risk.
+AstroCompress true
+
+csso false
+
+Optional
loggerFunction to track every step of transformation.
+Optional
restructureDisable or enable a structure optimisations.
+AstroCompress false
+
+csso true
+
+Optional
sourceGenerate a source map when true.
+false
+
+Optional
usageUsage data for advanced optimisations.
+Generated using TypeDoc
Optional
analyzeWhether to analyze dependencies (e.g. @import
and url()
).
+When enabled, @import
rules are removed, and url()
dependencies
+are replaced with hashed placeholders that can be replaced with the final
+urls later (after bundling). Dependencies are returned as part of the result.
Optional
cssWhether to compile this file as a CSS module.
+Optional
customDefines how to parse custom CSS at-rules. Each at-rule can have a prelude, defined using a CSS +syntax string, and +a block body. The body can be a declaration list, rule list, or style block as defined in the +css spec.
+Optional
draftsWhether to enable parsing various draft syntax.
+Optional
errorWhether to ignore invalid rules and declarations rather than erroring. +When enabled, warnings are returned, and the invalid rule or declaration is +omitted from the output code.
+Optional
excludeFeatures that should never be compiled, even when unsupported by targets.
+Optional
includeFeatures that should always be compiled, even when supported by targets.
+Optional
inputAn input source map to extend.
+Optional
minifyWhether to enable minification
+AstroCompress true
+
+lightningcss false
+
+Optional
nonWhether to enable various non-standard syntax.
+Optional
projectAn optional project root path, used as the source root in the output source map. +Also used to generate relative paths for sources used in CSS module hashes.
+Optional
pseudoReplaces user action pseudo classes with class names that can be applied from JavaScript. +This is useful for polyfills, for example.
+Optional
sourceWhether to output a source map.
+Optional
targetsThe browser targets for the generated code.
+Optional
unusedA list of class names, ids, and custom identifiers (e.g. @keyframes) that are known +to be unused. These will be removed during minification. Note that these are not +selectors but individual names (without any . or # prefixes).
+Optional
visitorAn AST visitor object. This allows custom transforms or analysis to be implemented in JavaScript.
+Multiple visitors can be composed into one using the composeVisitors
function.
+For optimal performance, visitors should be as specific as possible about what types of values
+they care about so that JavaScript has to be called as little as possible.
Generated using TypeDoc
Generated using TypeDoc
Optional
avifOptional
gifOptional
heifOptional
jpegOptional
pngOptional
tiffOptional
webpGenerated using TypeDoc
The size after the action.
+The size before the action.
+biome-ignore lint/suspicious/noExplicitAny:
+The input file.
+The output file.
+Generated using TypeDoc
Generated using TypeDoc
Optional
Option: TypeGenerated using TypeDoc
Generated using TypeDoc
Optional
ActionAction pipe configuration.
+Optional
CSScsso, lightningcss option properties
+Optional
CacheConfiguration for the target cache.
+{ Search: "./", Folder: "./Cache" }
+
+Optional
ExcludeCriteria for excluding files.
+Optional
FilesFile patterns to be matched.
+Optional
HTMLhtml-minifier-terser option properties
+Optional
html-Optional
Imagesharp option properties
+Optional
sharp?: TypeOptional
Javaterser option properties
+Optional
terser?: MinifyOptionsOptional
LoggerDebugging level.
+2
+
+Optional
MapMap to different file paths
+Optional
ParserParsers for different file types
+Optional
PathConfiguration for the target path(s).
+"./Target"
+
+Optional
SVGsvgo option properties
+Optional
svgo?: ConfigGenerated using TypeDoc
biome-ignore lint/suspicious/noExplicitAny:
+Optional
CSSOptional
HTMLOptional
ImageOptional
JavaOptional
SVGGenerated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Const
Generated using TypeDoc
Const
Generated using TypeDoc
Const
Object containing nested boolean values representing the available input and output formats/methods.
+Generated using TypeDoc
Const
#endregion
+Generated using TypeDoc
Const
An Object containing the available interpolators and their proper values
+Generated using TypeDoc
Const
Generated using TypeDoc
Const
An EventEmitter that emits a change event when a task is either queued, waiting for libuv to provide a worker thread, complete
+Generated using TypeDoc
Const
Generated using TypeDoc
Const
An Object containing the version numbers of sharp, libvips and its dependencies.
+Optional
avif?: stringOptional
cairo?: stringOptional
croco?: stringOptional
exif?: stringOptional
expat?: stringOptional
ffi?: stringOptional
fontconfig?: stringOptional
freetype?: stringOptional
gdkpixbuf?: stringOptional
gif?: stringOptional
glib?: stringOptional
gsf?: stringOptional
harfbuzz?: stringOptional
heif?: stringOptional
jpeg?: stringOptional
lcms?: stringOptional
orc?: stringOptional
pango?: stringOptional
pixman?: stringOptional
png?: stringOptional
sharp?: stringOptional
svg?: stringOptional
tiff?: stringOptional
webp?: stringOptional
xml?: stringOptional
zlib?: stringGenerated using TypeDoc
Generated using TypeDoc
TODO: Test this for security
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
| |||
AstroCritters 🦔 AstroJS GoogleChromeLabs Critters integration. Inline your critical CSS with Astro. | AstroRome 🏛️ AstroJS Rome tools. Format, lint and check your Astro website with Rome. |
This Astro integration brings compression utilities to +your Astro project.
+CSS / HTML / JavaScript / +Image / SVG
+++Note
++
AstroCompress
will not compress your requests, only your statically +generated build and pre-rendered routes.
++[!IMPORTANT]
+Use
+AstroCompress
last in your integration list for the best optimization.
There are two ways to add integrations to your project. Let's try the most +convenient option first!
+astro add
commandAstro includes a CLI tool for adding first party integrations: astro add
. This
+command will:
astro.config.*
file to apply this integrationTo install AstroCompress
, run the following from your project directory and
+follow the prompts:
Using NPM:
+npx astro add astro-compress
+
+Using Yarn:
+yarn astro add astro-compress
+
+Using PNPM:
+pnpx astro add astro-compress
+
+First, install the AstroCompress
integration like so:
npm install -D -E astro-compress
+
+Then, apply this integration to your astro.config.*
file using the
+integrations
property:
astro.config.ts
import Compress from "astro-compress";
export default { integrations: [Compress()] };
+
+The utility will now automatically compress all your CSS, HTML, SVG, JavaScript
+and image files in the Astro outDir
folder.
The following image file types will be compressed via sharp:
+SVG compression is supported via svgo.
+You can override any of the default options from the configurations of:
+or disable them entirely:
+astro.config.ts
import Compress from "astro-compress";
export default {
integrations: [
Compress({
CSS: false,
HTML: false,
Image: false,
JavaScript: false,
SVG: false,
}),
],
};
+
+to see the full option map visit: +Source/Interface/Option.ts
+You can add multiple paths to compress by specifying an array as the Path
+variable.
astro.config.ts
import Compress from "astro-compress";
export default {
integrations: [
Compress({
Path: ["./Target", "./Build"],
}),
],
};
+
+You can also provide a map of paths for different input output directories.
+astro.config.ts
import Compress from "astro-compress";
export default {
integrations: [
Compress({
Path: new Map([["./Source", "./Target"]]),
}),
],
};
+
+Or an array of the two.
+astro.config.ts
import Compress from "astro-compress";
export default {
integrations: [
Compress({
Path: [
// Compress Target
"./Target",
// Compress Target one more time into a different directory
new Map([["./Target", "./TargetCompress"]]),
],
}),
],
};
+
+You can filter files to exclude specific ones from compression. A filter can be +an array of regular expressions or a single match. You can also use functions to +match on file names:
+astro.config.ts
import Compress from "astro-compress";
export default {
integrations: [
Compress({
Exclude: [
"File.png",
(File: string) =>
File === "./Target/Favicon/Image/safari-pinned-tab.svg",
],
}),
],
};
+
+You can control the logging level by setting the Logger
parameter. The default
+value is 2
, but you can set it to 0
if you don't want to see debug messages:
astro.config.ts
import Compress from "astro-compress";
export default {
integrations: [
Compress({
Logger: 0,
}),
],
};
+
+See CHANGELOG.md for a history of changes to this integration.
+Generated using TypeDoc
astro-critters 🦔 AstroJS GoogleChromeLabs critters integration. Inline your critical CSS with Astro. | astro-rome 🏛️ AstroJS Rome tools. Format, lint and check your Astro website with Rome. |
| |||
AstroCritters 🦔 AstroJS GoogleChromeLabs Critters integration. Inline your critical CSS with Astro. | AstroRome 🏛️ AstroJS Rome tools. Format, lint and check your Astro website with Rome. |
biome-ignore lint/suspicious/noExplicitAny:
+