Skip to content

Commit 9d4174e

Browse files
author
Adrian Hall
committed
fix: ci-deploy import attributes
1 parent 4583dc7 commit 9d4174e

10 files changed

Lines changed: 56 additions & 33 deletions

File tree

package-lock.json

Lines changed: 32 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"husky": "^4.3.8",
8989
"lint-staged": "^12.4.1",
9090
"memfs": "^4.9.3",
91-
"prettier": "2.6.2",
91+
"prettier": "3.3.2",
9292
"semantic-release": "^22.0.12",
9393
"start-server-and-test": "^2.0.4",
9494
"supertest": "^6.3.4",

src/cli/commands/deploy/deploy.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as accountModule from "../../../core/account.js";
66
import * as deployClientModule from "../../../core/deploy-client.js";
77
import { deploy } from "./deploy.js";
88
import * as loginModule from "../login/login.js";
9-
import pkg from "../../../../package.json";
9+
import pkg from "../../../../package.json" with { type: "json" };
1010

1111
vi.mock("../../../core/utils/logger", () => {
1212
return {
@@ -97,7 +97,7 @@ describe("deploy", () => {
9797
expect(logger.error).toHaveBeenNthCalledWith(
9898
2,
9999
"Provide a deployment token using the --deployment-token option or SWA_CLI_DEPLOYMENT_TOKEN environment variable",
100-
true
100+
true,
101101
);
102102

103103
expect(deployClientModule.getDeployClientPath).not.toBeCalled();

src/cli/commands/deploy/deploy.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { cleanUp, getDeployClientPath } from "../../../core/deploy-client.js";
1414
import { swaCLIEnv } from "../../../core/env.js";
1515
import { getDefaultVersion } from "../../../core/functions-versions.js";
1616
import { login } from "../login/login.js";
17-
import packageInfo from "../../../../package.json";
17+
import packageInfo from "../../../../package.json" with { type: "json" };
1818

1919
export async function deploy(options: SWACLIConfig) {
2020
const { SWA_CLI_DEPLOYMENT_TOKEN, SWA_CLI_DEBUG } = swaCLIEnv();
@@ -94,7 +94,7 @@ export async function deploy(options: SWACLIConfig) {
9494
logger.warn(
9595
`An API folder was found at ".${
9696
path.sep + path.basename(apiFolder)
97-
}" but the --api-location option was not provided. The API will not be deployed.\n`
97+
}" but the --api-location option was not provided. The API will not be deployed.\n`,
9898
);
9999
}
100100
}
@@ -152,7 +152,7 @@ export async function deploy(options: SWACLIConfig) {
152152
credentialChain,
153153
subscriptionId,
154154
resourceGroup as string,
155-
staticSiteName as string
155+
staticSiteName as string,
156156
);
157157

158158
deploymentToken = deploymentTokenResponse?.properties?.apiKey;
@@ -212,7 +212,7 @@ export async function deploy(options: SWACLIConfig) {
212212
logger.warn(`Error reading workflow configuration:`);
213213
logger.warn((err as any).message);
214214
logger.warn(
215-
`See https://docs.microsoft.com/azure/static-web-apps/build-configuration?tabs=github-actions#build-configuration for more information.`
215+
`See https://docs.microsoft.com/azure/static-web-apps/build-configuration?tabs=github-actions#build-configuration for more information.`,
216216
);
217217
}
218218

@@ -298,7 +298,7 @@ export async function deploy(options: SWACLIConfig) {
298298
else if (line.includes("[31m")) {
299299
if (line.includes("Cannot deploy to the function app because Function language info isn't provided.")) {
300300
line = chalk.red(
301-
`Cannot deploy to the function app because Function language info isn't provided, use flags "--api-language" and "--api-version" or add a "platform.apiRuntime" property to your staticwebapp.config.json file, or create one in ${options.outputLocation!}. Please consult the documentation for more information about staticwebapp.config.json: https://learn.microsoft.com/azure/static-web-apps/build-configuration?tabs=github-actions#skip-building-the-api`
301+
`Cannot deploy to the function app because Function language info isn't provided, use flags "--api-language" and "--api-version" or add a "platform.apiRuntime" property to your staticwebapp.config.json file, or create one in ${options.outputLocation!}. Please consult the documentation for more information about staticwebapp.config.json: https://learn.microsoft.com/azure/static-web-apps/build-configuration?tabs=github-actions#skip-building-the-api`,
302302
);
303303
}
304304

@@ -331,7 +331,7 @@ export async function deploy(options: SWACLIConfig) {
331331
logger.error("Deployment Failed :(");
332332
logger.error(`Deployment Failure Reason: ${(error as any).message}`);
333333
logger.error(
334-
`For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/azure/static-web-apps/`
334+
`For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/azure/static-web-apps/`,
335335
);
336336
logGitHubIssueMessageAndExit();
337337
} finally {

src/cli/commands/start/start.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { DATA_API_BUILDER_BINARY_NAME, DATA_API_BUILDER_DEFAULT_CONFIG_FILE_NAME
1616
import { getDataApiBuilderBinaryPath } from "../../../core/dataApiBuilder/index.js";
1717
import { swaCLIEnv } from "../../../core/env.js";
1818
import { getCertificate } from "../../../core/ssl.js";
19-
import packageInfo from "../../../../package.json";
19+
import packageInfo from "../../../../package.json" with { type: "json" };
2020

2121
import { createRequire } from "node:module";
2222
const require = createRequire(import.meta.url);
@@ -153,7 +153,7 @@ export async function start(options: SWACLIConfig) {
153153
logger.warn(`Error reading workflow configuration:`);
154154
logger.warn((err as any).message);
155155
logger.warn(
156-
`See https://docs.microsoft.com/azure/static-web-apps/build-configuration?tabs=github-actions#build-configuration for more information.`
156+
`See https://docs.microsoft.com/azure/static-web-apps/build-configuration?tabs=github-actions#build-configuration for more information.`,
157157
);
158158
}
159159

@@ -186,7 +186,7 @@ export async function start(options: SWACLIConfig) {
186186
} else {
187187
if (isCoreToolsVersionCompatible(targetVersion, nodeMajorVersion) === false) {
188188
logger.error(
189-
`Found Azure Functions Core Tools v${targetVersion} which is incompatible with your current Node.js v${process.versions.node}.`
189+
`Found Azure Functions Core Tools v${targetVersion} which is incompatible with your current Node.js v${process.versions.node}.`,
190190
);
191191
logger.error("See https://aka.ms/functions-node-versions for more information.");
192192
process.exit(1);
@@ -214,7 +214,7 @@ export async function start(options: SWACLIConfig) {
214214
`Could not find or install ${DATA_API_BUILDER_BINARY_NAME} binary.
215215
If you already have data-api-builder installed, try connecting using --data-api-devserver-url by
216216
starting data-api-builder engine separately. Exiting!!`,
217-
true
217+
true,
218218
);
219219
} else {
220220
serveDataApiCommand = `cd "${dataApiLocation}" && "${dataApiBinary}" start -c ${DATA_API_BUILDER_DEFAULT_CONFIG_FILE_NAME} --no-https-redirect`;
@@ -314,7 +314,7 @@ export async function start(options: SWACLIConfig) {
314314
if (isApiLocationExistsOnDisk) {
315315
concurrentlyCommands.push(
316316
// serve the api, if it's available
317-
{ command: serveApiCommand, name: "api", env, prefixColor: "gray.dim" }
317+
{ command: serveApiCommand, name: "api", env, prefixColor: "gray.dim" },
318318
);
319319
}
320320

@@ -372,7 +372,7 @@ export async function start(options: SWACLIConfig) {
372372
break;
373373
}
374374
logger.error(`SWA emulator stopped because ${commandMessage}.`, true);
375-
}
375+
},
376376
)
377377
.catch((err: Error) => {
378378
logger.error(err.message, true);

src/cli/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { fs, vol } from "memfs";
22
import { program } from "commander";
33
import { run } from "./index.js";
4-
import pkg from "../../package.json";
4+
import pkg from "../../package.json" with { type: "json" };
55
import * as builder from "./commands/build/build.js";
66

77
vi.mock("node:fs");

src/cli/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { default as registerBuild } from "./commands/build/register.js";
2020
import { registerDocs } from "./commands/docs.js";
2121
import { default as registerDb } from "./commands/db/init/register.js";
2222
import { promptOrUseDefault } from "../core/prompts.js";
23-
import pkg from "../../package.json";
23+
import pkg from "../../package.json" with { type: "json" };
2424

2525
function printWelcomeMessage(argv?: string[]) {
2626
const args = argv?.slice(2) || [];
@@ -62,7 +62,7 @@ export async function run(argv?: string[]) {
6262
.addOption(
6363
new Option("-V, --verbose [prefix]", "enable verbose output. Values are: silly,info,log,silent")
6464
.preset(DEFAULT_CONFIG.verbose)
65-
.default(DEFAULT_CONFIG.verbose)
65+
.default(DEFAULT_CONFIG.verbose),
6666
)
6767
.option("-c, --config <path>", "path to swa-cli.config.json file to use", path.relative(process.cwd(), swaCliConfigFilename))
6868
.option("-cn, --config-name <name>", "name of the configuration to use", undefined)
@@ -78,7 +78,7 @@ export async function run(argv?: string[]) {
7878
7979
Documentation:
8080
https://aka.ms/swa/cli-local-development
81-
`
81+
`,
8282
);
8383

8484
// Register commands

src/core/utils/json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Draft04, Draft, JsonError } from "json-schema-library";
22
import { promises as fs } from "node:fs";
33
import chalk from "chalk";
44
import { logger } from "./logger.js";
5-
import configSchema from "../../../schema/staticwebapp.config.json";
5+
import configSchema from "../../../schema/staticwebapp.config.json" with { type: "json" };
66

77
/**
88
* Loads JSON from the designated file path, printing any JSON errors to the console.

src/core/utils/update-notifier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import updateNotifier from "update-notifier";
2-
import pkg from "../../../package.json";
2+
import pkg from "../../../package.json" with { type: "json" };
33

44
export function notifyOnUpdate() {
55
updateNotifier({ pkg }).notify();

tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2022",
4-
"module": "Node16", // ESM Module resolution
5-
"moduleResolution": "Node16", // ESM module resolution
3+
"target": "ESNext",
4+
"module": "NodeNext", // ESM Module resolution
5+
"moduleResolution": "NodeNext", // ESM module resolution
66
"declaration": true,
77
"declarationMap": true,
88
"sourceMap": true,

0 commit comments

Comments
 (0)