Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Playground dependencies in package.json #139

Merged
merged 3 commits into from
Jan 11, 2024
Merged
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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.13.0
v18.18.2
120 changes: 90 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
"@codemirror/state": "6.2.0",
"@codemirror/theme-one-dark": "6.1.1",
"@codemirror/view": "6.9.3",
"@php-wasm/node": "0.1.56",
"@php-wasm/progress": "0.1.56",
"@php-wasm/universal": "0.1.56",
"@php-wasm/web": "0.1.57",
"@php-wasm/node": "0.5.4",
"@php-wasm/progress": "0.5.4",
"@php-wasm/universal": "0.5.4",
"@php-wasm/web": "0.5.4",
"@uiw/react-codemirror": "^4.21.20",
"@wp-playground/blueprints": "0.1.56",
"@wp-playground/client": "0.2.0",
"@wp-playground/blueprints": "0.5.4",
"@wp-playground/client": "0.5.4",
"classnames": "^2.3.2",
"comlink": "^4.4.1",
"compressible": "2.0.18",
Expand Down
8 changes: 4 additions & 4 deletions packages/wp-now/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ To execute this Blueprint, create a file named `blueprint-example.json` and run
"WP_HOME": "http://myurl.wpnow:8881",
"WP_SITEURL": "http://myurl.wpnow:8881"
},
"virtualize": true
"method": "define-before-run"
}
]
}
Expand All @@ -141,7 +141,7 @@ The Blueprint to listen on port `80` will look like this:
"WP_HOME": "http://myurl.wpnow",
"WP_SITEURL": "http://myurl.wpnow"
},
"virtualize": true
"method": "define-before-run"
}
]
}
Expand All @@ -162,7 +162,7 @@ Run `wp-now start --blueprint=path/to/blueprint-example.json` where `blueprint-e
"WP_DEBUG": true,
"WP_DEBUG_LOG": true
},
"virtualize": true
"method": "define-before-run"
}
]
}
Expand All @@ -182,7 +182,7 @@ For example, if you run `wp-now start --blueprint=path/to/blueprint-example.json
"consts": {
"WP_DEBUG_LOG": "/var/www/html/wp-content/themes/atlas/example.log"
},
"virtualize": true
"method": "define-before-run"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion packages/wp-now/src/tests/blueprints/wp-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"WP_HOME": "http://127.0.0.1",
"WP_SITEURL": "http://127.0.0.1"
},
"virtualize": true
"method": "define-before-run"
}
]
}
2 changes: 1 addition & 1 deletion packages/wp-now/src/tests/blueprints/wp-debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"consts": {
"WP_DEBUG_LOG": "/var/www/html/wp-content/themes/fake/example.log"
},
"virtualize": true
"method": "define-before-run"
}
]
}
19 changes: 1 addition & 18 deletions packages/wp-now/src/wp-now.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ import getWpNowPath from './get-wp-now-path';
import getWordpressVersionsPath from './get-wordpress-versions-path';
import getSqlitePath from './get-sqlite-path';

function seemsLikeAPHPFile(path) {
return path.endsWith('.php') || path.includes('.php/');
}

async function applyToInstances(phpInstances: NodePHP[], callback: Function) {
for (let i = 0; i < phpInstances.length; i++) {
await callback(phpInstances[i]);
Expand All @@ -50,19 +46,6 @@ export default async function startWPNow(
requestHandler: {
documentRoot,
absoluteUrl: options.absoluteUrl,
isStaticFilePath: (path) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now handled by Playground core.

try {
const fullPath = options.documentRoot + path;
return (
php.fileExists(fullPath) &&
!php.isDir(fullPath) &&
!seemsLikeAPHPFile(fullPath)
);
} catch (e) {
output?.error(e);
return false;
}
},
},
};

Expand Down Expand Up @@ -338,7 +321,7 @@ async function initWordPress(
}
await defineWpConfigConsts(php, {
consts: wpConfigConsts,
virtualize: true,
method: 'define-before-run'
});

return { initializeDefaultDatabase };
Expand Down
Loading