Skip to content

Commit

Permalink
fix: compatibility warning on deploy (#43)
Browse files Browse the repository at this point in the history
* feat: use latest compatibility date

* fix: make project discoverable not only from root
  • Loading branch information
nacho-vazquez authored Apr 20, 2024
1 parent 2baea92 commit 4ff171c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions packages/nx-cloudflare/src/executors/deploy/executor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { DeployExecutorSchema } from './schema';
import { ExecutorContext } from '@nx/devkit';
import { ExecutorContext, workspaceRoot } from '@nx/devkit';
import { fork } from 'child_process';
import { createCliOptions } from '../../utils/create-cli-options';
import { resolve as pathResolve } from 'path';

export default async function deployExecutor(
options: DeployExecutorSchema,
Expand All @@ -17,7 +18,8 @@ export default async function deployExecutor(
}

const args = createCliOptions({ ...options });
const p = runWrangler(args, projectRoot);
const cwd = pathResolve(workspaceRoot, projectRoot);
const p = runWrangler(args, cwd);
p.stdout.on('data', (message) => {
process.stdout.write(message);
});
Expand Down
7 changes: 5 additions & 2 deletions packages/nx-cloudflare/src/executors/next-build/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import {
getPackageManagerCommand,
logger,
readJsonFile,
workspaceRoot,
writeJsonFile,
} from '@nx/devkit';
import { createLockFile, createPackageJson, getLockFileName } from '@nx/js';
import { join } from 'path';
import { join, resolve as pathResolve } from 'path';
import {
copySync,
ensureDirSync,
Expand Down Expand Up @@ -142,11 +143,13 @@ function runCliBuild(projectRoot: string, options: NextBuildBuilderOptions) {

const args = createCliOptions({ experimentalAppOnly, profile, debug });

const cwd = pathResolve(workspaceRoot, projectRoot);

const pmc = getPackageManagerCommand('npm');
const execSyncOptions: ExecSyncOptions = {
stdio: ['inherit', 'inherit', 'inherit'],
encoding: 'utf-8',
cwd: projectRoot,
cwd,
};

execSync(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "<%=name %>"
compatibility_date = "2023-07-31"
compatibility_date = "2024-04-19"
main = "src/index.<%=extension %>"
<%-accountId %>

0 comments on commit 4ff171c

Please sign in to comment.