-
-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12f3bed
commit e97f3c3
Showing
336 changed files
with
9,231 additions
and
10,097 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,9 +1,9 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
] | ||
"[javascript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"quickfix.biome": "explicit", | ||
"source.organizeImports.biome": "explicit" | ||
} | ||
} |
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,100 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", | ||
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false }, | ||
"files": { | ||
"ignoreUnknown": false, | ||
"ignore": ["**/*.d.ts", "**/mock", "biome.json"], | ||
"include": ["example/**/*.vue", "example/**/*.ts", "packages/**/*.ts"] | ||
}, | ||
"formatter": { "enabled": true, "indentStyle": "tab", "lineWidth": 320, "attributePosition": "auto" }, | ||
"organizeImports": { "enabled": true }, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": false, | ||
"complexity": { | ||
"noExtraBooleanCast": "error", | ||
"noMultipleSpacesInRegularExpressionLiterals": "error", | ||
"noUselessCatch": "error", | ||
"noUselessConstructor": "error", | ||
"noUselessLoneBlockStatements": "error", | ||
"noUselessRename": "error", | ||
"noUselessTernary": "error", | ||
"noUselessUndefinedInitialization": "error", | ||
"noVoid": "error", | ||
"noWith": "error", | ||
"useLiteralKeys": "off" | ||
}, | ||
"correctness": { | ||
"noConstAssign": "error", | ||
"noConstantCondition": "error", | ||
"noEmptyCharacterClassInRegex": "error", | ||
"noEmptyPattern": "error", | ||
"noGlobalObjectCalls": "error", | ||
"noInnerDeclarations": "error", | ||
"noInvalidConstructorSuper": "error", | ||
"noInvalidUseBeforeDeclaration": "error", | ||
"noNewSymbol": "error", | ||
"noSelfAssign": "error", | ||
"noSwitchDeclarations": "error", | ||
"noUndeclaredVariables": "error", | ||
"noUnreachable": "error", | ||
"noUnreachableSuper": "error", | ||
"noUnsafeFinally": "error", | ||
"noUnusedVariables": "warn", | ||
"useArrayLiterals": "error", | ||
"useExhaustiveDependencies": "warn", | ||
"useHookAtTopLevel": "off", | ||
"useIsNan": "error" | ||
}, | ||
"security": { "noGlobalEval": "error" }, | ||
"style": { | ||
"noCommaOperator": "error", | ||
"noNamespace": "error", | ||
"noNonNullAssertion": "off", | ||
"noYodaExpression": "error", | ||
"useBlockStatements": "error", | ||
"useConsistentBuiltinInstantiation": "error", | ||
"useConst": "error", | ||
"useSingleVarDeclarator": "error" | ||
}, | ||
"suspicious": { | ||
"noAsyncPromiseExecutor": "error", | ||
"noCatchAssign": "error", | ||
"noClassAssign": "error", | ||
"noCompareNegZero": "error", | ||
"noControlCharactersInRegex": "error", | ||
"noDebugger": "error", | ||
"noDoubleEquals": "error", | ||
"noDuplicateCase": "error", | ||
"noDuplicateClassMembers": "error", | ||
"noDuplicateObjectKeys": "error", | ||
"noDuplicateParameters": "error", | ||
"noFallthroughSwitchClause": "error", | ||
"noFunctionAssign": "error", | ||
"noGlobalAssign": "error", | ||
"noMisleadingCharacterClass": "error", | ||
"noPrototypeBuiltins": "error", | ||
"noRedeclare": "error", | ||
"noSelfCompare": "error", | ||
"noShadowRestrictedNames": "error", | ||
"noSparseArray": "error", | ||
"noUnsafeNegation": "error", | ||
"useValidTypeof": "error" | ||
} | ||
} | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"quoteStyle": "single", | ||
"semicolons": "asNeeded", | ||
"trailingCommas": "none", | ||
"lineWidth": 320, | ||
"attributePosition": "auto" | ||
}, | ||
"parser": { | ||
"unsafeParameterDecoratorsEnabled": true | ||
}, | ||
"globals": ["cy", "expect", "it", "context", "beforeEach", "afterEach", "describe", "Cypress", "navigator", "window", "document", "__isBrowser__", "JSX", "Vue", "React", "__non_webpack_require__"] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,7 +1,5 @@ | ||
import type { UserConfig } from 'ssr-types' | ||
|
||
const userConfig: UserConfig = { | ||
|
||
} | ||
const userConfig: UserConfig = {} | ||
|
||
export { userConfig } |
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,7 +1,6 @@ | ||
import { MidwayConfig } from '@midwayjs/core' | ||
|
||
export default { | ||
// use for cookie sign key, should change to your own and keep security | ||
keys: '1650192482948_2252' | ||
|
||
// use for cookie sign key, should change to your own and keep security | ||
keys: '1650192482948_2252' | ||
} as MidwayConfig |
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,26 +1,24 @@ | ||
import { Configuration, App } from '@midwayjs/decorator' | ||
import * as koa from '@midwayjs/koa' | ||
import { join } from 'path' | ||
import { initialSSRDevProxy, getCwd } from 'ssr-common-utils' | ||
import { App, Configuration } from '@midwayjs/decorator' | ||
import * as koa from '@midwayjs/koa' | ||
import { getCwd, initialSSRDevProxy } from 'ssr-common-utils' | ||
|
||
const koaStatic = require('koa-static-cache') | ||
const cwd = getCwd() | ||
|
||
@Configuration({ | ||
imports: [ | ||
koa | ||
], | ||
importConfigs: [join(__dirname, './config')] | ||
imports: [koa], | ||
importConfigs: [join(__dirname, './config')] | ||
}) | ||
export class ContainerLifeCycle { | ||
@App() | ||
app: koa.Application | ||
@App() | ||
app: koa.Application | ||
|
||
async onReady () { | ||
this.app.use(koaStatic(join(cwd, './build'), { maxAge: 864000 })) | ||
this.app.use(koaStatic(join(cwd, './public'), { maxAge: 864000 })) | ||
this.app.use(koaStatic(join(cwd, './build/client'), { maxAge: 864000 })) | ||
async onReady() { | ||
this.app.use(koaStatic(join(cwd, './build'), { maxAge: 864000 })) | ||
this.app.use(koaStatic(join(cwd, './public'), { maxAge: 864000 })) | ||
this.app.use(koaStatic(join(cwd, './build/client'), { maxAge: 864000 })) | ||
|
||
await initialSSRDevProxy(this.app) | ||
} | ||
await initialSSRDevProxy(this.app) | ||
} | ||
} |
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,30 +1,30 @@ | ||
import { Inject, Controller, Provide, Get } from '@midwayjs/decorator' | ||
import { Controller, Get, Inject, Provide } from '@midwayjs/decorator' | ||
import { Context } from '@midwayjs/koa' | ||
import { IApiService, IApiDetailService } from '../interface' | ||
import { IApiDetailService, IApiService } from '../interface' | ||
|
||
@Provide() | ||
@Controller('/api') | ||
export class Api { | ||
@Inject() | ||
ctx: Context | ||
@Inject() | ||
ctx: Context | ||
|
||
@Inject('ApiService') | ||
service: IApiService | ||
@Inject('ApiService') | ||
service: IApiService | ||
|
||
@Inject('ApiDetailService') | ||
detailService: IApiDetailService | ||
@Inject('ApiDetailService') | ||
detailService: IApiDetailService | ||
|
||
@Get('/index') | ||
async getIndexData () { | ||
const data = await this.service.index() | ||
return data | ||
} | ||
@Get('/index') | ||
async getIndexData() { | ||
const data = await this.service.index() | ||
return data | ||
} | ||
|
||
@Get('/detail/:id') | ||
async getDetailData () { | ||
const { ctx, detailService } = this | ||
const id = ctx.params.id | ||
const data = await detailService.index(id) | ||
return data | ||
} | ||
@Get('/detail/:id') | ||
async getDetailData() { | ||
const { ctx, detailService } = this | ||
const id = ctx.params.id | ||
const data = await detailService.index(id) | ||
return data | ||
} | ||
} |
Oops, something went wrong.