Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from hapipal/esm-and-ts-support
Support and test TypeScript and ESM
- Loading branch information
Showing
14 changed files
with
179 additions
and
44 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,2 +1,3 @@ | ||
test/closet/haute-couture-broken/node_modules/haute-couture.js | ||
test/closet/new/** | ||
test/closet/run-command-ts/** |
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
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,3 @@ | ||
{ | ||
"name": "non-ambiguous-hc-file-cwd-esm" | ||
} |
Empty file.
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,5 @@ | ||
import * as HauteCouture from '@hapipal/haute-couture'; | ||
|
||
export default { | ||
pluggums: HauteCouture.amendment('plugins') | ||
}; |
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,3 @@ | ||
{ | ||
"name": "run-command-esm" | ||
} |
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,35 @@ | ||
import * as Hapi from '@hapi/hapi'; | ||
|
||
export const deployment = async () => { | ||
|
||
const server = Hapi.server(); | ||
|
||
const register = (srv) => { | ||
|
||
srv.expose('commands', { | ||
someCommand: (rootServer, args, root, ctx) => { | ||
|
||
ctx.options.cmd = [rootServer, args, root, ctx]; | ||
|
||
const stop = rootServer.stop; | ||
rootServer.stop = async () => { | ||
|
||
rootServer.stop = stop; | ||
|
||
await rootServer.stop(); | ||
|
||
rootServer.stopped = true; | ||
}; | ||
} | ||
}); | ||
}; | ||
|
||
const plugin = { | ||
name: 'x', | ||
register | ||
}; | ||
|
||
await server.register(plugin); | ||
|
||
return server; | ||
}; |
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,3 @@ | ||
{ | ||
"name": "run-command-ts" | ||
} |
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,25 @@ | ||
import * as Hapi from '@hapi/hapi'; | ||
|
||
export const deployment = async () => { | ||
|
||
const server = Hapi.server(); | ||
|
||
const register = (srv: Hapi.Server) => { | ||
|
||
srv.expose('commands', { | ||
someCommand: () => { | ||
|
||
console.log('some-command was run!'); | ||
} | ||
}); | ||
}; | ||
|
||
const plugin = { | ||
name: 'x', | ||
register | ||
}; | ||
|
||
await server.register(plugin); | ||
|
||
return server; | ||
}; |
Oops, something went wrong.