Skip to content

Commit

Permalink
chore: update script
Browse files Browse the repository at this point in the history
  • Loading branch information
reruin committed Oct 12, 2021
1 parent 5315088 commit 0e7f929
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 35 deletions.
3 changes: 0 additions & 3 deletions packages/sharelist-plugin/lib/driver.baidu.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,11 @@ module.exports = class Driver {
return []
}

console.log('list', id, fid)
const { request } = this.app
let { access_token } = await this.getCredentials(key)

let data = await this.meta(fid, key)
let dir = data.extra.path || '/'
console.log(data, dir)
if (data.type != 'folder') return []

// if (data.type != 'folder') return []
Expand Down Expand Up @@ -254,7 +252,6 @@ module.exports = class Driver {
break
}
} while (true)
console.log(files)
return files
}

Expand Down
28 changes: 3 additions & 25 deletions packages/sharelist-web/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
# Vue 3 + Typescript + Vite
# @sharelist/web [![npm](https://img.shields.io/npm/v/@sharelist/web.svg)](https://npmjs.com/package/@sharelist/web)

This template should help get you started developing with Vue 3 and Typescript in Vite.
It's a part for sharelist

## Recommended IDE Setup

[VSCode](https://code.visualstudio.com/) + [Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur). Make sure to enable `vetur.experimental.templateInterpolationService` in settings!

### If Using `<script setup>`

[`<script setup>`](https://github.com/vuejs/rfcs/pull/227) is a feature that is currently in RFC stage. To get proper IDE support for the syntax, use [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) instead of Vetur (and disable Vetur).

## Type Support For `.vue` Imports in TS

Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can use the following:

### If Using Volar

Run `Volar: Switch TS Plugin on/off` from VSCode command palette.

### If Using Vetur

1. Install and add `@vuedx/typescript-plugin-vue` to the [plugins section](https://www.typescriptlang.org/tsconfig#plugins) in `tsconfig.json`
2. Delete `src/shims-vue.d.ts` as it is no longer needed to provide module info to Typescript
3. Open `src/main.ts` in VSCode
4. Open the VSCode command palette
5. Search and run "Select TypeScript version" -> "Use workspace version"
## Useage
12 changes: 7 additions & 5 deletions packages/sharelist/package/webdav/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,18 @@ const createDriver = (driver, { proxy, baseUrl } = {}) => {

let name = paths.pop()

console.log('ipload pre')
let data = await driver.stat({ paths })
console.log('ipload end ', data)

let existData = await driver.stat({ paths: [...paths, name] })

if (existData) {
await driver.rm(existData.id)
}

if (!data.id) {
return { error: { code: 404 } }
}
console.log('data.id', data.id, size)
let ret = await driver.upload(data.id, { name, size, stream })
console.log(ret, name, size, '<<<')
if (!ret) {
return {
error: { code: 500 }
Expand Down Expand Up @@ -169,7 +171,7 @@ const createDriver = (driver, { proxy, baseUrl } = {}) => {
}

const isWebDAVRequest = (ctx) => {
return /(Microsoft\-WebDAV|FileExplorer|WinSCP|WebDAVLib|WebDAVFS|rclone|Kodi|davfs2|sharelist\-webdav)/i.test(ctx.request.headers['user-agent'])
return /(Microsoft\-WebDAV|FileExplorer|WinSCP|WebDAVLib|WebDAVFS|rclone|Kodi|davfs2|sharelist\-webdav|RaiDrive)/i.test(ctx.request.headers['user-agent']) || (ctx.request.headers['translate']) || (ctx.request.headers['overwrite'])
}

module.exports = (app) => {
Expand Down
6 changes: 4 additions & 2 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const skipBuild = args.skipBuild

const skipNpmPublish = args.skipNpmPublish

const commitPath = args['commit-path'] || ''

/**
* @type {import('semver').ReleaseType[]}
*/
Expand Down Expand Up @@ -125,7 +127,7 @@ async function main() {
if (!skipBuild && !isDryRun) {
await run('yarn', ['build'])
} else {
console.log(`(skipped)`)
console.log(`(skipped build)`)
}

step('\nGenerating changelog...')
Expand All @@ -134,7 +136,7 @@ async function main() {
const { stdout } = await run('git', ['diff'], { stdio: 'pipe' })
if (stdout) {
step('\nCommitting changes...')
await run('git', ['add', '-A'])
await run('git', ['add', commitPath, '-A'])
await run('git', ['commit', '-m', `release: ${tag}`])
} else {
console.log('No changes to commit.')
Expand Down

0 comments on commit 0e7f929

Please sign in to comment.