-
Notifications
You must be signed in to change notification settings - Fork 13
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
Showing
22 changed files
with
414 additions
and
57 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/usr/bin/env node | ||
require('source-map-support').install(); | ||
|
||
// require('source-map-support').install(); | ||
import('commandkit/cli'); |
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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export enum CKitActionType { | ||
ReloadAll, | ||
ReloadCommands, | ||
ReloadEvents, | ||
ReloadValidators, | ||
} | ||
|
||
export enum CKitNotification { | ||
Reload = 'reload', | ||
ReloadAck = 'reload-ack', | ||
} |
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,39 +1,40 @@ | ||
import { build } from 'tsup'; | ||
import { getConfig } from '../../config'; | ||
import { join } from 'path'; | ||
import { injectShims } from './shims'; | ||
import { Environment } from '../env'; | ||
|
||
export function bundle(mode: 'development' | 'production') { | ||
switch (mode) { | ||
case 'development': | ||
export function bundle() { | ||
switch (true) { | ||
case Environment.isDevelopment(): | ||
return buildDevelopment(); | ||
default: | ||
throw new Error('Not implemented'); | ||
} | ||
} | ||
|
||
function buildDevelopment() { | ||
const { watch } = getConfig(); | ||
return new Promise<string>((resolve) => { | ||
const { requirePolyfill } = getConfig(); | ||
|
||
const outDir = join(process.cwd(), '.commandkit'); | ||
|
||
return build({ | ||
clean: true, | ||
format: ['esm'], | ||
bundle: false, | ||
dts: false, | ||
skipNodeModulesBundle: true, | ||
minify: false, | ||
shims: true, | ||
sourcemap: 'inline', | ||
keepNames: true, | ||
outDir: '.commandkit', | ||
silent: true, | ||
entry: ['src'], | ||
watch, | ||
async onSuccess() { | ||
// return await injectShims('.commandkit', main, false, requirePolyfill); | ||
}, | ||
}).then(() => { | ||
return join(outDir, 'client.mjs'); | ||
return build({ | ||
clean: true, | ||
format: ['esm'], | ||
bundle: false, | ||
dts: false, | ||
skipNodeModulesBundle: true, | ||
minify: false, | ||
shims: true, | ||
sourcemap: 'inline', | ||
keepNames: true, | ||
outDir: '.commandkit', | ||
silent: true, | ||
entry: ['src'], | ||
async onSuccess() { | ||
const root = join(process.cwd(), '.commandkit'); | ||
await injectShims(root, 'client.mjs', false, requirePolyfill); | ||
resolve(join(root, 'client.mjs')); | ||
}, | ||
}); | ||
}); | ||
} |
Oops, something went wrong.