-
Notifications
You must be signed in to change notification settings - Fork 37
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
54 changed files
with
166 additions
and
2,615 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,16 @@ | ||
import { execSyncPretty } from '../../stable/utils/exec_sync_pretty'; | ||
|
||
export function logSuccess(canisterName: string, canisterId: string): void { | ||
const replicaWebServerPort = execSyncPretty(`dfx info webserver-port`) | ||
.toString() | ||
.trim(); | ||
|
||
const url = | ||
process.env.DFX_NETWORK === 'ic' | ||
? `https://${canisterId}.raw.icp0.io` | ||
: `http://${canisterId}.localhost:${replicaWebServerPort}`; | ||
|
||
console.info( | ||
`\nCanister ${canisterName} serving HTTP requests at: ${url}\n` | ||
); | ||
} |
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,33 @@ | ||
import { rm } from 'fs/promises'; | ||
|
||
import { GLOBAL_AZLE_CONFIG_DIR } from '../utils/global_paths'; | ||
|
||
export async function runCommand(): Promise<void> { | ||
await rm(GLOBAL_AZLE_CONFIG_DIR, { | ||
recursive: true, | ||
force: true | ||
}); | ||
|
||
console.info(`~/.config/azle directory deleted`); | ||
|
||
await rm('.azle', { | ||
recursive: true, | ||
force: true | ||
}); | ||
|
||
console.info(`.azle directory deleted`); | ||
|
||
await rm('.dfx', { | ||
recursive: true, | ||
force: true | ||
}); | ||
|
||
console.info(`.dfx directory deleted`); | ||
|
||
await rm('node_modules', { | ||
recursive: true, | ||
force: true | ||
}); | ||
|
||
console.info(`node_modules directory deleted`); | ||
} |
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,33 @@ | ||
import { readFile, writeFile } from 'fs/promises'; | ||
// @ts-ignore | ||
import { copy } from 'fs-extra/esm'; | ||
import { join } from 'path'; | ||
|
||
export async function runCommand( | ||
azleVersion: string, | ||
templatePath: string | ||
): Promise<void> { | ||
if (process.argv[3] === undefined) { | ||
console.error('You must provide a name for your Azle project'); | ||
return; | ||
} | ||
|
||
const projectName = process.argv[3]; | ||
|
||
await copy(templatePath, projectName); | ||
|
||
const packageJson = ( | ||
await readFile(join(templatePath, 'package.json')) | ||
).toString(); | ||
|
||
let parsedPackageJson = JSON.parse(packageJson); | ||
|
||
parsedPackageJson.dependencies.azle = `^${azleVersion}`; | ||
|
||
await writeFile( | ||
join(projectName, 'package.json'), | ||
JSON.stringify(parsedPackageJson, null, 4) | ||
); | ||
|
||
console.info(`${projectName} created successfully`); | ||
} |
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 { version } from '../../../../package.json'; | ||
|
||
export function runCommand(): void { | ||
console.info(version); | ||
} |
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
Oops, something went wrong.