-
Notifications
You must be signed in to change notification settings - Fork 134
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
Feat: Output faust version in dev|build|start commands. #1874
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d7e4caa
Feat: Output faust version in dev|build|start commands.
theodesp 05cc371
Lint: Fix eslint issue
theodesp 8d97c66
Acceptance Tests: update preview button selectos for WP 6.5
theodesp 83fdb7b
Acceptance Tests: Attempt to fix preview tests
theodesp c555a8c
Acceptance Test: Use correct variables
theodesp ed1fa9f
Acceptance Test: Fix cpt_name var
theodesp ec31be3
Acceptance Test: Remove click event
theodesp 3be607e
Acceptance Test: Attempt to close welcome modals.
theodesp df2d868
Acceptance Test: Revert last commit
theodesp 439e2e7
Acceptance Test: Update DEVELOPMENT.md
theodesp dcb4d6d
Acceptance Test: Click Welcome modal if present
theodesp 48cb974
Acceptance Test: Pin e2e tests to WP 6.4
theodesp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
'@faustwp/cli': patch | ||
--- | ||
|
||
Faust CLI now outputs version number when running dev|build|start commands. | ||
|
||
When running those commands it will print the current Faust core and cli versions in the console: | ||
|
||
```bash | ||
% npm run dev -w examples/next/faustwp-getting-started | ||
info - Faust.js v3.0.1 | ||
info - Faust.js CLI v3.0.1 | ||
ready - started server on 0.0.0.0:3000, url: http://localhost:3000 | ||
... | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import fs from 'fs'; | ||
import { infoLog } from '../stdout/index.js'; | ||
|
||
/** | ||
* Sanitizes the version from a dependency in package.json. | ||
* | ||
* @param version The dependency version. | ||
* @returns A sanitized version or undefined if the version is a path. | ||
*/ | ||
export function sanitizePackageJsonVersion(_version: string | undefined) { | ||
let version = _version; | ||
|
||
if (!version) { | ||
return undefined; | ||
} | ||
|
||
if (version.charAt(0) === '^' || version.charAt(0) === '~') { | ||
version = version.substring(1); | ||
} | ||
|
||
/** | ||
* If a dependency is a file path set the value to undefined as we | ||
* don't want to collect file paths in telemetry | ||
*/ | ||
if (version.startsWith('file:')) { | ||
version = undefined; | ||
} | ||
|
||
return version; | ||
} | ||
|
||
export function printFaustVersion(): void { | ||
const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8')); | ||
const coreVersion = sanitizePackageJsonVersion( | ||
packageJson?.dependencies?.['@faustwp/core'] as string | undefined, | ||
); | ||
const cliVersion = sanitizePackageJsonVersion( | ||
packageJson?.dependencies?.['@faustwp/cli'] as string | undefined, | ||
); | ||
// eslint-disable-next-line | ||
infoLog(`Faust.js v${coreVersion || 'unknown'}`); | ||
infoLog(`Faust.js CLI v${cliVersion || 'unknown'}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG WP_VERSION=latest | ||
ARG WP_VERSION=6.4 | ||
|
||
FROM wordpress:${WP_VERSION} | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a stopper, but let's add a to-do for later on this... just in case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1875