nextpress-core 3.1.2 → 3.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/README.md CHANGED
@@ -1,4 +1,4 @@
1
1
  # Nextpress Core
2
- `npm i -D nextpress-core`
2
+ `npm i nextpress-core`
3
3
 
4
4
  https://github.com/ellsaw/nextpress
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from 'commander';
3
+ import path from 'path';
4
+ import { runCommand } from './run-command.js';
5
+ import { containerLibPath } from './start-composer.js';
6
+
7
+ const program = new Command();
8
+
9
+ program
10
+ .name('np run wp-cli')
11
+ .allowUnknownOption()
12
+ .argument('[args...]', 'Arguments passed directly to WP-CLI')
13
+ .action(async () => {
14
+ const wpArgs = program.args;
15
+
16
+ await runCommand('docker', [
17
+ 'compose',
18
+ '--project-directory', process.cwd(),
19
+ '--env-file', path.join(process.cwd(), '.env'),
20
+ '-f', path.join(containerLibPath, 'docker-compose.yml'),
21
+ 'run',
22
+ '--rm',
23
+ 'wp-cli',
24
+ 'wp',
25
+ ...wpArgs
26
+ ]);
27
+ });
28
+
29
+ program.parse(process.argv);
package/cli/np-run.js CHANGED
@@ -6,5 +6,6 @@ program
6
6
  .name('np run')
7
7
  .command('dev', 'Run Nextpress in development mode')
8
8
  .command('start', 'Run Nextpress in production mode')
9
+ .command('wp-cli', 'Execute command in the Wordpress CLI')
9
10
  .parse(process.argv);
10
11
 
@@ -21,9 +21,6 @@ export function nextpressProxy(request: NextRequest): NextResponse {
21
21
  response.cookies.set('nextpress_logged_in_user_id', loggedInUserId || '0');
22
22
  return response;
23
23
  }
24
- if (request.cookies.has('nextpress_logged_in_user_id')) {
25
- return NextResponse.next();
26
- }
27
24
 
28
25
  const cookies = request.cookies;
29
26
 
@@ -31,6 +28,10 @@ export function nextpressProxy(request: NextRequest): NextResponse {
31
28
  cookie.name.startsWith('wordpress_logged_in_')
32
29
  );
33
30
 
31
+ if (request.cookies.has('nextpress_logged_in_user_id') && hasWordpressCookie) {
32
+ return NextResponse.next();
33
+ }
34
+
34
35
  if (hasWordpressCookie) {
35
36
  const currentPath = url.pathname + url.search;
36
37
 
@@ -66,7 +66,7 @@ export function RenderTheAdminBar({ loggedInUserId }: Props) {
66
66
  <Script src={adminBar.assets.js.admin_bar}/>
67
67
 
68
68
  <div
69
- className={`fixed top-0 left-0 right-0 transform transition-all duration-300 ease-in-out ${
69
+ className={`fixed top-0 left-0 right-0 z-9999 transform transition-all duration-300 ease-in-out ${
70
70
  isMounted
71
71
  ? "scale-y-100"
72
72
  : "scale-y-0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextpress-core",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "description": "Nextpress Core",
5
5
  "keywords": [],
6
6
  "bin": {