opennextjs-azure 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -533,7 +533,7 @@ program.command("init").description("Initialize Azure infrastructure in your pro
533
533
  program.command("build").description("Build Next.js app for Azure deployment").option("-c, --config <path>", "Path to open-next.config.ts file").action(async (options) => {
534
534
  await build(options.config);
535
535
  });
536
- program.command("deploy").description("Deploy Next.js app to Azure (provisions infrastructure + deploys)").option("-n, --app-name <name>", "Application name (overrides azure.config.json)").option("-g, --resource-group <name>", "Azure resource group name").option("-l, --location <location>", "Azure region").option("-e, --environment <env>", "Environment: dev, staging, or prod").option("--skip-infrastructure", "Skip infrastructure provisioning").action(async (options) => {
536
+ program.command("deploy").description("Deploy Next.js app to Azure (provisions infrastructure + deploys)").option("-n, --app-name <name>", "Application name (overrides azure.config.json)").option("-g, --resource-group <name>", "Azure resource group name").option("-l, --location <location>", "Azure region").option("-e, --environment <env>", "Environment: dev, staging, or prod").option("--skip-infrastructure", "Skip infrastructure provisioning").option("--skip-resource-checks", "Skip Azure resource validation checks (permissions, quota, providers)").action(async (options) => {
537
537
  await deploy(options);
538
538
  });
539
539
  program.command("tail").description("Open Azure Portal Log Stream in browser (live logs)").option("-n, --app-name <name>", "Application name").option("-g, --resource-group <name>", "Azure resource group name").action(async (options) => {
package/dist/deploy.js CHANGED
@@ -459,17 +459,22 @@ async function deploy$1(options) {
459
459
  resourceGroup = `${appName}-rg`,
460
460
  location = "eastus",
461
461
  environment = "dev",
462
- skipInfrastructure = false
462
+ skipInfrastructure = false,
463
+ skipResourceChecks = false
463
464
  } = options;
464
465
  console.log(`Deploying ${appName} to Azure (${environment} environment)`);
465
466
  try {
466
467
  await checkAzureCLI();
467
468
  await checkAzureLogin();
468
- await checkAzureSubscriptionPermissions();
469
- await checkLocation(location);
470
- await checkRequiredProviders(options.applicationInsights);
471
- await checkQuotaAvailability(location, environment);
472
469
  await checkBuildOutput();
470
+ if (!skipResourceChecks) {
471
+ await checkAzureSubscriptionPermissions();
472
+ await checkLocation(location);
473
+ await checkRequiredProviders(options.applicationInsights);
474
+ await checkQuotaAvailability(location, environment);
475
+ } else {
476
+ console.log("Skipping resource checks (--skip-resource-checks)");
477
+ }
473
478
  if (skipInfrastructure) {
474
479
  await checkExistingInfrastructure(appName, resourceGroup, environment);
475
480
  }
@@ -781,7 +786,17 @@ async function syncBicepTemplate() {
781
786
  }
782
787
  async function provisionInfrastructure(options) {
783
788
  const { appName, resourceGroup, location, environment, applicationInsights } = options;
784
- await execAsync$1(`az group create --name ${resourceGroup} --location ${location}`);
789
+ const { stdout: rgExists } = await execAsync$1(`az group exists --name ${resourceGroup}`);
790
+ if (rgExists.trim() === "true") {
791
+ const { stdout: rgLocation } = await execAsync$1(`az group show --name ${resourceGroup} --query location -o tsv`);
792
+ if (rgLocation.trim() !== location) {
793
+ console.warn(
794
+ ` ${colors.yellow}Warning:${colors.reset} Resource group "${resourceGroup}" exists in ${rgLocation.trim()}, but ${location} was specified`
795
+ );
796
+ }
797
+ } else {
798
+ await execAsync$1(`az group create --name ${resourceGroup} --location ${location}`);
799
+ }
785
800
  const bicepPath = path.join(process.cwd(), "infrastructure/main.bicep");
786
801
  const enableAppInsights = applicationInsights ? "true" : "false";
787
802
  const { stdout } = await execAsync$1(
@@ -945,6 +960,7 @@ async function deploy(options) {
945
960
  location: resourceGroupLocation || options.location || config.location || "eastus",
946
961
  environment,
947
962
  skipInfrastructure: options.skipInfrastructure,
963
+ skipResourceChecks: options.skipResourceChecks,
948
964
  applicationInsights: config.applicationInsights ?? false
949
965
  });
950
966
  }
package/dist/index.d.mts CHANGED
@@ -30,6 +30,7 @@ declare function deploy(options: {
30
30
  location?: string;
31
31
  environment?: "dev" | "staging" | "prod";
32
32
  skipInfrastructure?: boolean;
33
+ skipResourceChecks?: boolean;
33
34
  }): Promise<void>;
34
35
 
35
36
  export { build, deploy, init };
package/dist/index.d.ts CHANGED
@@ -30,6 +30,7 @@ declare function deploy(options: {
30
30
  location?: string;
31
31
  environment?: "dev" | "staging" | "prod";
32
32
  skipInfrastructure?: boolean;
33
+ skipResourceChecks?: boolean;
33
34
  }): Promise<void>;
34
35
 
35
36
  export { build, deploy, init };
package/package.json CHANGED
@@ -1,98 +1,98 @@
1
1
  {
2
- "name": "opennextjs-azure",
3
- "version": "0.1.3",
4
- "description": "True serverless Next.js on Azure Functions with a Vercel-grade developer experience",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "bin": {
9
- "opennextjs-azure": "dist/cli/index.js"
2
+ "name": "opennextjs-azure",
3
+ "version": "0.1.4",
4
+ "description": "True serverless Next.js on Azure Functions with a Vercel-grade developer experience",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "bin": {
9
+ "opennextjs-azure": "dist/cli/index.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.js"
10
16
  },
11
- "exports": {
12
- ".": {
13
- "import": "./dist/index.js",
14
- "types": "./dist/index.d.ts",
15
- "default": "./dist/index.js"
16
- },
17
- "./package.json": "./package.json",
18
- "./config/index.js": {
19
- "import": "./dist/config/index.js",
20
- "types": "./dist/config/index.d.ts"
21
- },
22
- "./adapters/wrappers/azure-functions.js": {
23
- "import": "./dist/adapters/wrappers/azure-functions.js",
24
- "types": "./dist/adapters/wrappers/azure-functions.d.ts"
25
- },
26
- "./adapters/converters/azure-http.js": {
27
- "import": "./dist/adapters/converters/azure-http.js",
28
- "types": "./dist/adapters/converters/azure-http.d.ts"
29
- },
30
- "./overrides/incrementalCache/azure-blob.js": {
31
- "import": "./dist/overrides/incrementalCache/azure-blob.js",
32
- "types": "./dist/overrides/incrementalCache/azure-blob.d.ts"
33
- },
34
- "./overrides/tagCache/azure-table.js": {
35
- "import": "./dist/overrides/tagCache/azure-table.js",
36
- "types": "./dist/overrides/tagCache/azure-table.d.ts"
37
- },
38
- "./overrides/queue/azure-queue.js": {
39
- "import": "./dist/overrides/queue/azure-queue.js",
40
- "types": "./dist/overrides/queue/azure-queue.d.ts"
41
- }
17
+ "./package.json": "./package.json",
18
+ "./config/index.js": {
19
+ "import": "./dist/config/index.js",
20
+ "types": "./dist/config/index.d.ts"
42
21
  },
43
- "files": [
44
- "dist",
45
- "infrastructure"
46
- ],
47
- "scripts": {
48
- "build": "unbuild",
49
- "dev": "unbuild --stub",
50
- "clean": "rimraf dist",
51
- "lint": "eslint src --ext .ts",
52
- "test": "vitest",
53
- "typecheck": "tsc --noEmit",
54
- "format": "prettier --write ."
22
+ "./adapters/wrappers/azure-functions.js": {
23
+ "import": "./dist/adapters/wrappers/azure-functions.js",
24
+ "types": "./dist/adapters/wrappers/azure-functions.d.ts"
55
25
  },
56
- "keywords": [
57
- "nextjs",
58
- "azure",
59
- "serverless",
60
- "azure-functions",
61
- "opennext"
62
- ],
63
- "author": "",
64
- "license": "MIT",
65
- "repository": {
66
- "type": "git",
67
- "url": "git+https://github.com/zpg6/opennextjs-azure.git"
26
+ "./adapters/converters/azure-http.js": {
27
+ "import": "./dist/adapters/converters/azure-http.js",
28
+ "types": "./dist/adapters/converters/azure-http.d.ts"
68
29
  },
69
- "bugs": {
70
- "url": "https://github.com/zpg6/opennextjs-azure/issues"
30
+ "./overrides/incrementalCache/azure-blob.js": {
31
+ "import": "./dist/overrides/incrementalCache/azure-blob.js",
32
+ "types": "./dist/overrides/incrementalCache/azure-blob.d.ts"
71
33
  },
72
- "dependencies": {
73
- "@opennextjs/aws": "^3.8.5",
74
- "@azure/functions": "^4.5.1",
75
- "@azure/storage-blob": "^12.20.0",
76
- "@azure/data-tables": "^13.2.2",
77
- "@azure/storage-queue": "^12.18.0",
78
- "commander": "^11.1.0"
34
+ "./overrides/tagCache/azure-table.js": {
35
+ "import": "./dist/overrides/tagCache/azure-table.js",
36
+ "types": "./dist/overrides/tagCache/azure-table.d.ts"
79
37
  },
80
- "devDependencies": {
81
- "@types/node": "^20.11.0",
82
- "@typescript-eslint/eslint-plugin": "^6.20.0",
83
- "@typescript-eslint/parser": "^6.20.0",
84
- "eslint": "^8.56.0",
85
- "rimraf": "^5.0.5",
86
- "prettier": "^3.5.3",
87
- "prettier-plugin-tailwindcss": "^0.5.0",
88
- "typescript": "^5.3.3",
89
- "unbuild": "^2.0.0",
90
- "vitest": "^1.2.0"
91
- },
92
- "peerDependencies": {
93
- "next": ">=13.4.0"
94
- },
95
- "engines": {
96
- "node": ">=18.0.0"
38
+ "./overrides/queue/azure-queue.js": {
39
+ "import": "./dist/overrides/queue/azure-queue.js",
40
+ "types": "./dist/overrides/queue/azure-queue.d.ts"
97
41
  }
98
- }
42
+ },
43
+ "files": [
44
+ "dist",
45
+ "infrastructure"
46
+ ],
47
+ "keywords": [
48
+ "nextjs",
49
+ "azure",
50
+ "serverless",
51
+ "azure-functions",
52
+ "opennext"
53
+ ],
54
+ "author": "",
55
+ "license": "MIT",
56
+ "repository": {
57
+ "type": "git",
58
+ "url": "git+https://github.com/zpg6/opennextjs-azure.git"
59
+ },
60
+ "bugs": {
61
+ "url": "https://github.com/zpg6/opennextjs-azure/issues"
62
+ },
63
+ "dependencies": {
64
+ "@opennextjs/aws": "^3.8.5",
65
+ "@azure/functions": "^4.5.1",
66
+ "@azure/storage-blob": "^12.20.0",
67
+ "@azure/data-tables": "^13.2.2",
68
+ "@azure/storage-queue": "^12.18.0",
69
+ "commander": "^11.1.0"
70
+ },
71
+ "devDependencies": {
72
+ "@types/node": "^20.11.0",
73
+ "@typescript-eslint/eslint-plugin": "^6.20.0",
74
+ "@typescript-eslint/parser": "^6.20.0",
75
+ "eslint": "^8.56.0",
76
+ "rimraf": "^5.0.5",
77
+ "prettier": "^3.5.3",
78
+ "prettier-plugin-tailwindcss": "^0.5.0",
79
+ "typescript": "^5.3.3",
80
+ "unbuild": "^2.0.0",
81
+ "vitest": "^1.2.0"
82
+ },
83
+ "peerDependencies": {
84
+ "next": ">=13.4.0"
85
+ },
86
+ "engines": {
87
+ "node": ">=18.0.0"
88
+ },
89
+ "scripts": {
90
+ "build": "unbuild",
91
+ "dev": "unbuild --stub",
92
+ "clean": "rimraf dist",
93
+ "lint": "eslint src --ext .ts",
94
+ "test": "vitest",
95
+ "typecheck": "tsc --noEmit",
96
+ "format": "prettier --write ."
97
+ }
98
+ }