-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from KindSpells/improve-api
feat!: improve public api
- Loading branch information
Showing
7 changed files
with
166 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
[*.{js,mjs,json,ts}] | ||
charset = utf-8 | ||
indent_style = tab | ||
indent_size = 2 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
export type SriCspOptions = { | ||
/** | ||
* Specifies the path for the auto-generated module that will contain the SRI | ||
* hashes. Note that: | ||
* - The generated module will be an ESM module | ||
* - The generated module should be treated as source code, and not as a build | ||
* artifact. | ||
*/ | ||
sriHashesModule?: string | undefined | ||
} | ||
|
||
export type StrictSriCspOptions = SriCspOptions & { distDir: string } | ||
|
||
export function sriCSP( | ||
distDir: string, | ||
hashesOutputModule?: string | undefined, | ||
sriCspOptions: SriCspOptions, | ||
): import('astro').AstroIntegration | ||
|
||
export default sriCSP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,55 @@ | ||
{ | ||
"name": "@kindspells/astro-sri-csp", | ||
"version": "0.1.8", | ||
"description": "An Astro plugin to compute and inject SRI hashes for script and style tags", | ||
"private": false, | ||
"type": "module", | ||
"main": "main.mjs", | ||
"types": "main.d.ts", | ||
"exports": { | ||
"types": "./main.d.ts", | ||
"default": "./main.mjs" | ||
}, | ||
"files": [ | ||
"main.d.ts", | ||
"main.mjs" | ||
], | ||
"scripts": { | ||
"format": "biome format --write .", | ||
"lint": "biome lint ." | ||
}, | ||
"keywords": [ | ||
"astro", | ||
"astro-component", | ||
"astro-integration", | ||
"code-generation", | ||
"csp", | ||
"content-security-policy", | ||
"security", | ||
"sri", | ||
"subresource-integrity", | ||
"withastro" | ||
], | ||
"author": "KindSpells Labs S.L.", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@biomejs/biome": "^1.5.3", | ||
"astro": "^4.3.5" | ||
}, | ||
"repository": "github:KindSpells/astro-sri-csp", | ||
"funding": [ | ||
{ | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/kindspells-labs" | ||
}, | ||
{ | ||
"type": "individual", | ||
"url": "https://ko-fi.com/coderspirit" | ||
} | ||
] | ||
"name": "@kindspells/astro-sri-csp", | ||
"version": "0.2.1", | ||
"description": "An Astro plugin to compute and inject SRI hashes for script and style tags", | ||
"private": false, | ||
"type": "module", | ||
"main": "main.mjs", | ||
"types": "main.d.ts", | ||
"exports": { | ||
"types": "./main.d.ts", | ||
"default": "./main.mjs" | ||
}, | ||
"files": ["main.d.ts", "main.mjs"], | ||
"scripts": { | ||
"format": "biome format --write .", | ||
"lint": "pnpm run lint:biome && pnpm run lint:tsc", | ||
"lint:biome": "biome lint .", | ||
"lint:tsc": "tsc -p ." | ||
}, | ||
"keywords": [ | ||
"astro", | ||
"astro-component", | ||
"astro-integration", | ||
"code-generation", | ||
"csp", | ||
"content-security-policy", | ||
"security", | ||
"sri", | ||
"subresource-integrity", | ||
"withastro" | ||
], | ||
"author": "KindSpells Labs S.L.", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@biomejs/biome": "^1.5.3", | ||
"@types/node": "^20.11.17", | ||
"astro": "^4.3.5", | ||
"typescript": "^5.3.3" | ||
}, | ||
"repository": "github:KindSpells/astro-sri-csp", | ||
"funding": [ | ||
{ | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/kindspells-labs" | ||
}, | ||
{ | ||
"type": "individual", | ||
"url": "https://ko-fi.com/coderspirit" | ||
} | ||
], | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
"node": ">= 18.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2022", | ||
"module": "Node16", | ||
"moduleResolution": "Node16", | ||
|
||
"baseUrl": ".", | ||
"noEmit": true, | ||
|
||
"allowJs": true, | ||
"checkJs": true, | ||
|
||
"isolatedModules": true, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
|
||
"strict": true, | ||
"noImplicitAny": true, | ||
"strictNullChecks": true, | ||
"strictFunctionTypes": true, | ||
"strictBindCallApply": true, | ||
"strictPropertyInitialization": true, | ||
"noImplicitThis": true, | ||
"useUnknownInCatchVariables": true, | ||
"alwaysStrict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"exactOptionalPropertyTypes": true, | ||
"noUncheckedIndexedAccess": true, | ||
"noImplicitOverride": true, | ||
"noPropertyAccessFromIndexSignature": true, | ||
|
||
"skipLibCheck": true | ||
}, | ||
"include": ["*.mjs", "*.d.ts", "*.ts"] | ||
} |