-
Notifications
You must be signed in to change notification settings - Fork 3
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
31 changed files
with
464 additions
and
166 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 |
---|---|---|
|
@@ -6,3 +6,4 @@ docs | |
.idea | ||
.vscode | ||
*.d.ts | ||
lib |
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 |
---|---|---|
|
@@ -10,3 +10,4 @@ temp | |
.versions | ||
.changelog | ||
package-lock.json | ||
lib |
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 @@ | ||
# `@dollie/cli` | ||
|
||
> TODO: description | ||
## Usage | ||
|
||
``` | ||
const cli = require('@dollie/cli'); | ||
// TODO: DEMONSTRATE API | ||
``` |
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 @@ | ||
{ | ||
"name": "@dollie/cli", | ||
"version": "3.0.0", | ||
"description": "Dollie CLI", | ||
"author": "lenconda <[email protected]>", | ||
"homepage": "https://github.com/lenconda/dollie#readme", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/lenconda/dollie.git" | ||
}, | ||
"bin": { | ||
"dollie": "bin/dollie.js" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: run tests from root\" && exit 1" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/lenconda/dollie/issues" | ||
}, | ||
"dependencies": { | ||
"commander": "^7.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash": "^4.14.170", | ||
"@types/node": "^15.12.2", | ||
"typescript": "^4.3.2" | ||
} | ||
} |
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 @@ | ||
console.log(); |
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,9 @@ | ||
{ | ||
"extends": "../../../tsconfig.json", | ||
"include": ["src/**/*.ts"], | ||
"compilerOptions": { | ||
"outDir": "./lib", | ||
"rootDir": "./src", | ||
"tsBuildInfoFile": "./lib/.tsbuildinfo" | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
packages/@dollie/core/lib/constants.js → packages/@dollie/core/src/constants.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
const VIRTUAL_VOLUME_DESTINATION_PATHNAME = '/template'; | ||
|
||
module.exports = { | ||
export { | ||
VIRTUAL_VOLUME_DESTINATION_PATHNAME, | ||
}; |
21 changes: 15 additions & 6 deletions
21
packages/@dollie/core/lib/errors.js → packages/@dollie/core/src/errors.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 |
---|---|---|
@@ -1,32 +1,41 @@ | ||
const _ = require('lodash'); | ||
import _ from 'lodash'; | ||
|
||
class InvalidInputError extends Error { | ||
constructor(reason) { | ||
public constructor(reason) { | ||
super(`Invalid input item${_.isString(reason) ? `: ${reason}` : ''}`); | ||
} | ||
} | ||
|
||
class ContextError extends Error { | ||
constructor(reason) { | ||
public constructor(reason) { | ||
super(`Invalid context${_.isString(reason) ? `: ${reason}` : ''}`); | ||
} | ||
} | ||
|
||
class HTTPNotFoundError extends Error { | ||
constructor() { | ||
public constructor() { | ||
super('Template resource not found'); | ||
} | ||
} | ||
|
||
class HTTPTimeoutError extends Error { | ||
constructor() { | ||
public constructor() { | ||
super('Download template resource timed out'); | ||
} | ||
} | ||
|
||
module.exports = { | ||
class DollieError extends Error { | ||
public code: string; | ||
|
||
public constructor(message: string) { | ||
super(message); | ||
} | ||
} | ||
|
||
export { | ||
InvalidInputError, | ||
ContextError, | ||
HTTPNotFoundError, | ||
HTTPTimeoutError, | ||
DollieError, | ||
}; |
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 @@ | ||
|
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,36 @@ | ||
import { | ||
DollieOrigin, | ||
} from '@dollie/origins'; | ||
import { Change } from 'diff'; | ||
import { Volume } from 'memfs'; | ||
import fs from 'fs'; | ||
import { Options as GotOptions } from 'got/dist/source'; | ||
|
||
export interface DiffChange extends Change { | ||
conflicted?: boolean; | ||
conflictGroup?: 'former' | 'current'; | ||
lineNumber: number; | ||
} | ||
|
||
export interface LoaderOptions { | ||
httpProxyUrl?: string; | ||
httpProxyAuth?: string; | ||
maximumRetryCount?: number; | ||
} | ||
|
||
export type LoaderConfig = LoaderOptions & GotOptions; | ||
|
||
export interface DollieConfig { | ||
origins?: DollieOrigin[]; | ||
loader?: LoaderConfig; | ||
getScaffoldConfig?: () => void; | ||
} | ||
|
||
export interface PatchTableItem { | ||
changes: Array<DiffChange>; | ||
modifyLength: number; | ||
} | ||
export type PatchTable = Record<string, PatchTableItem>; | ||
|
||
export type MemFS = typeof Volume.prototype; | ||
export type FileSystem = MemFS | typeof fs; |
Oops, something went wrong.