-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bundles): support artifact type
manifest
(#14)
* multiupload working * working * wip * refactor: remove multipart uplaod * wip * wip: generate manifest json * fix * wip: concurrent upload * Update MAX_CONCURRENT_UPLOADS to 20
- Loading branch information
Showing
16 changed files
with
456 additions
and
73 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
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,41 @@ | ||
import { defineCommand } from 'citty'; | ||
import consola from 'consola'; | ||
import { fileExistsAtPath } from '../../utils/file'; | ||
import { generateManifestJson } from '../../utils/manifest'; | ||
import { prompt } from '../../utils/prompt'; | ||
|
||
export default defineCommand({ | ||
meta: { | ||
description: 'Generate a manifest file.', | ||
}, | ||
args: { | ||
path: { | ||
type: 'string', | ||
description: 'Path to the web assets folder (e.g. `www` or `dist`).', | ||
}, | ||
}, | ||
run: async (ctx) => { | ||
let path = ctx.args.path as string | undefined; | ||
|
||
if (!path) { | ||
path = await prompt('Enter the path to the web assets folder:', { | ||
type: 'text', | ||
}); | ||
if (!path) { | ||
consola.error('You must provide a path to the web assets folder.'); | ||
return; | ||
} | ||
} | ||
|
||
// Check if the path exists | ||
const pathExists = await fileExistsAtPath(path); | ||
if (!pathExists) { | ||
consola.error(`The path does not exist.`); | ||
return; | ||
} | ||
// Generate the manifest file | ||
await generateManifestJson(path); | ||
|
||
consola.success('Manifest file generated.'); | ||
}, | ||
}); |
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 @@ | ||
export const API_URL = 'https://api.cloud.capawesome.io/v1'; | ||
// export const API_URL = 'http://api.cloud.capawesome.local/v1' | ||
// export const API_URL = 'http://api.cloud.capawesome.local/v1'; | ||
export const MANIFEST_JSON_FILE_NAME = 'capawesome-live-update-manifest.json'; // Do NOT change this! |
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.