Remove extollo/cc dependency and make ts-node the default runner
This commit is contained in:
parent
e234bc0d24
commit
426d5659a6
7
ex
7
ex
@ -1,4 +1,4 @@
|
||||
#!/bin/bash -e
|
||||
#!/bin/bash
|
||||
|
||||
ENV_NODE="$(which node)"
|
||||
ENV_PNPM="$(which pnpm)"
|
||||
@ -133,8 +133,5 @@ if [ ! -d "./node_modules" ]; then
|
||||
echo ""
|
||||
printf "\033[32m✓\033[39m Looks like you're all set up! Run this command again to access the Extollo CLI.\n"
|
||||
else
|
||||
start_spinner "Building your app..."
|
||||
"$ENV_PNPM" run build > /dev/null
|
||||
stop_spinner 0
|
||||
"$ENV_NODE" --experimental-repl-await ./lib/cli.js $@
|
||||
"$ENV_PNPM" cli "$@"
|
||||
fi
|
||||
|
13
package.json
13
package.json
@ -8,10 +8,13 @@
|
||||
"lib": "lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"@extollo/lib": "^0.9.0",
|
||||
"@extollo/lib": "link:../lib",
|
||||
"copyfiles": "^2.4.1",
|
||||
"feed": "^4.2.2",
|
||||
"gotify": "^1.1.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-expose-internals": "^4.5.4",
|
||||
"ts-node": "^10.9.0",
|
||||
"ts-patch": "^2.0.1",
|
||||
"ts-to-zod": "^1.8.0",
|
||||
"typescript": "^4.3.2",
|
||||
@ -19,9 +22,9 @@
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"build": "excc -c package.json -t tsconfig.json",
|
||||
"app": "pnpm run build && node lib/index.js",
|
||||
"cli": "pnpm run build && node lib/cli.js"
|
||||
"app": "ts-node src/index.ts",
|
||||
"cli": "ts-node src/cli.ts",
|
||||
"watch": "nodemon --ext js,pug,ts --watch src --exec 'ts-node src/index.ts'"
|
||||
},
|
||||
"files": [
|
||||
"lib/**/*"
|
||||
@ -46,6 +49,6 @@
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@extollo/cc": "^0.6.0"
|
||||
"nodemon": "^2.0.19"
|
||||
}
|
||||
}
|
||||
|
1823
pnpm-lock.yaml
1823
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
import {OAuth2Client, OAuth2Scope, env, /*uuid4*/} from '@extollo/lib'
|
||||
import {OAuth2Client, OAuth2Scope, env, uuid4} from '@extollo/lib'
|
||||
|
||||
export default {
|
||||
secret: env('OAUTH2_SECRET'),
|
||||
@ -10,15 +10,15 @@ export default {
|
||||
},
|
||||
} as {[key: string]: OAuth2Scope},
|
||||
clients: {
|
||||
// 'test-1': {
|
||||
// id: 'test-1',
|
||||
// display: 'Test 1',
|
||||
// secret: env('TEST_CLIENT_SECRET', uuid4()),
|
||||
// allowedFlows: ['code'],
|
||||
// allowedScopeIds: ['user-info'],
|
||||
// allowedRedirectUris: [
|
||||
// 'http://localhost:1234/callback',
|
||||
// ],
|
||||
// },
|
||||
'test-1': {
|
||||
id: 'test-1',
|
||||
display: 'Test 1',
|
||||
secret: env('TEST_CLIENT_SECRET', uuid4()),
|
||||
allowedFlows: ['code'],
|
||||
allowedScopeIds: ['user-info'],
|
||||
allowedRedirectUris: [
|
||||
'http://localhost:1234/callback',
|
||||
],
|
||||
},
|
||||
} as {[key: string]: OAuth2Client},
|
||||
}
|
||||
|
@ -1,4 +1,11 @@
|
||||
import {Route, SessionAuthMiddleware, AuthRequiredMiddleware} from '@extollo/lib'
|
||||
import {
|
||||
Route,
|
||||
SessionAuthMiddleware,
|
||||
AuthRequiredMiddleware,
|
||||
scope,
|
||||
OAuth2Server,
|
||||
TokenAuthMiddleware
|
||||
} from '@extollo/lib'
|
||||
import {Home} from '../controllers/main/Home.controller'
|
||||
|
||||
Route.group('/', () => {
|
||||
@ -11,3 +18,11 @@ Route.group('', () => {
|
||||
.pre(AuthRequiredMiddleware)
|
||||
.calls<Home>(Home, home => home.welcome)
|
||||
}).pre(SessionAuthMiddleware)
|
||||
|
||||
OAuth2Server.routes()
|
||||
|
||||
Route.group('', () => {
|
||||
Route.get('tok')
|
||||
.pre(scope('tok'))
|
||||
.handledBy(() => 'Token!')
|
||||
}).pre(TokenAuthMiddleware)
|
||||
|
@ -1,10 +1,7 @@
|
||||
import {Inject, Injectable, Logging, BaseJob} from '@extollo/lib'
|
||||
import {Injectable, BaseJob} from '@extollo/lib'
|
||||
|
||||
@Injectable()
|
||||
export default class LogMessage extends BaseJob {
|
||||
@Inject()
|
||||
protected readonly logging!: Logging
|
||||
|
||||
async execute(): Promise<void> {
|
||||
this.logging.info('Executing LogMessage...')
|
||||
await new Promise<void>(res => {
|
||||
|
@ -1,13 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"declaration": true,
|
||||
"outDir": "./lib",
|
||||
"strict": true,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules"]
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "commonjs",
|
||||
"declaration": true,
|
||||
"outDir": "./lib",
|
||||
"strict": true,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"lib": ["esnext", "dom", "dom.iterable"]
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules", "src/app/resources", "../lib", "../lib/node_modules"]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user