feat: add the root path fix.
This commit is contained in:
parent
3ac1810435
commit
5c2b3a93b0
52
biome.json
52
biome.json
@ -1,28 +1,28 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"formatWithErrors": false,
|
||||
"indentStyle": "space",
|
||||
"indentWidth": 2,
|
||||
"lineEnding": "lf",
|
||||
"lineWidth": 120,
|
||||
"attributePosition": "auto"
|
||||
},
|
||||
"organizeImports": { "enabled": true },
|
||||
"linter": { "enabled": true, "rules": { "recommended": true } },
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"jsxQuoteStyle": "double",
|
||||
"quoteProperties": "asNeeded",
|
||||
"trailingCommas": "all",
|
||||
"semicolons": "always",
|
||||
"arrowParentheses": "always",
|
||||
"bracketSpacing": true,
|
||||
"bracketSameLine": false,
|
||||
"quoteStyle": "single",
|
||||
"attributePosition": "auto"
|
||||
}
|
||||
},
|
||||
"overrides": [{ "include": ["**/*.astro"] }]
|
||||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"formatWithErrors": false,
|
||||
"indentStyle": "space",
|
||||
"indentWidth": 2,
|
||||
"lineEnding": "lf",
|
||||
"lineWidth": 120,
|
||||
"attributePosition": "auto"
|
||||
},
|
||||
"organizeImports": { "enabled": true },
|
||||
"linter": { "enabled": true, "rules": { "recommended": true } },
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"jsxQuoteStyle": "double",
|
||||
"quoteProperties": "asNeeded",
|
||||
"trailingCommas": "all",
|
||||
"semicolons": "always",
|
||||
"arrowParentheses": "always",
|
||||
"bracketSpacing": true,
|
||||
"bracketSameLine": false,
|
||||
"quoteStyle": "single",
|
||||
"attributePosition": "auto"
|
||||
}
|
||||
},
|
||||
"overrides": [{ "include": ["**/*.astro"] }]
|
||||
}
|
||||
|
@ -1,16 +1,11 @@
|
||||
import { defineBuildConfig } from 'unbuild'
|
||||
import { defineBuildConfig } from 'unbuild';
|
||||
|
||||
export default defineBuildConfig({
|
||||
entries: [
|
||||
'src/index',
|
||||
],
|
||||
entries: ['src/index'],
|
||||
clean: true,
|
||||
declaration: true,
|
||||
rollup: {
|
||||
emitCJS: true,
|
||||
},
|
||||
externals: [
|
||||
'astro',
|
||||
'astro/zod'
|
||||
],
|
||||
})
|
||||
externals: ['astro', 'astro/zod'],
|
||||
});
|
||||
|
12
package.json
12
package.json
@ -2,11 +2,7 @@
|
||||
"name": "astro-uploader",
|
||||
"version": "1.0.1",
|
||||
"description": "A uploader for uploading the Astro generated files through the S3 API.",
|
||||
"keywords": [
|
||||
"Astro",
|
||||
"S3",
|
||||
"withastro"
|
||||
],
|
||||
"keywords": ["Astro", "S3", "withastro"],
|
||||
"bugs": {
|
||||
"url": "https://github.com/syhily/astro-uploader/issues"
|
||||
},
|
||||
@ -27,12 +23,10 @@
|
||||
"main": "./dist/index.mjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"files": ["dist"],
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"format": "biome format src --write",
|
||||
"format": "biome format . --write",
|
||||
"stub": "unbuild --stub"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -38,7 +38,7 @@ const S3Options = z
|
||||
region: z.string().min(1).default('auto'),
|
||||
endpoint: z.string().url().optional(),
|
||||
bucket: z.string().min(1),
|
||||
root: z.string().default('/'),
|
||||
root: z.string().default(''),
|
||||
accessKey: z.string().min(1),
|
||||
secretAccessKey: z.string().min(1),
|
||||
extraOptions: z.record(z.string(), z.string()).default({}),
|
||||
@ -95,10 +95,6 @@ class Uploader {
|
||||
this.override = override;
|
||||
}
|
||||
|
||||
private async delete(key: string): Promise<void> {
|
||||
await this.operator.delete(key);
|
||||
}
|
||||
|
||||
async isExist(key: string, size: number): Promise<boolean> {
|
||||
const exist = await this.operator.isExist(key);
|
||||
if (exist) {
|
||||
|
Loading…
Reference in New Issue
Block a user