-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add automatic Alias HQ registration for Node (#48)
* Feat register script #46 * Use package exports to register node paths * Update demo Co-authored-by: Dave Stewart <[email protected]>
- Loading branch information
1 parent
d3de862
commit cbeae70
Showing
12 changed files
with
6,294 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
.reify-cache |
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,29 @@ | ||
# Alias HQ Demo | ||
|
||
> Demo for CLI and Node | ||
## Overview | ||
|
||
This folder is here only to test the CLI and Node integration. | ||
|
||
## CLI | ||
|
||
Run the tests from the root package: | ||
|
||
```bash | ||
npm run test # from root | ||
``` | ||
|
||
All tests should pass. | ||
|
||
## Node | ||
|
||
Run the script from the demo folder: | ||
|
||
```bash | ||
cd demo # if not already in demo | ||
npm i | ||
npm run node | ||
``` | ||
|
||
The terminal should print dummy output. |
Large diffs are not rendered by default.
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "alias-hq-demo", | ||
"description": "Demo for CLI (tests) and Node (script)", | ||
"scripts": { | ||
"node": "node -r alias-hq/init ./src/node.js" | ||
}, | ||
"devDependencies": { | ||
"alias-hq": "file:.." | ||
}, | ||
"dependencies": { | ||
"reify": "^0.20.12" | ||
} | ||
} |
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,3 @@ | ||
export default function (url, payload) { | ||
return Promise.resolve(JSON.stringify({ url, payload })) | ||
return Promise.resolve({ url, payload }) | ||
} |
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,4 +1,4 @@ | ||
import User from '@/classes/user' | ||
import User from '@/classes/User' | ||
import config from '../../../config/api' | ||
|
||
export const user = new User(config) |
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,5 +1,5 @@ | ||
export default ` | ||
<div> | ||
<pre>{{ data }}</pre> | ||
<output>{{ url }}</output> | ||
</div> | ||
` |
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,2 @@ | ||
require('reify') | ||
require('./main') |
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 @@ | ||
require('alias-hq').get('module-alias') |