Comments (3)
In tests the paths are not consistent:
wordpress/test/1-verify-theme.spec.ts
Line 76 in 2e63d93
wordpress/test/2-prepare-theme.spec.ts
Line 94 in 2e63d93
from wordpress.
Good catch 💪
You are correct, there is an error with a double path resolve, but the path creation and concatenation is proper in this context. Meaning - it should and must work.
path
is an undocumented setting added primarily to make testing procedures easier, and maybe to support some advanced workflows in the future. Glad to see your putting it to good use 😊
You can see here
wordpress/test/2-prepare-theme.spec.ts
Line 52 in a7da74b
That the full path to the theme needs to be provided - so it's an error in the config.
Your config:
[
"@semantic-release/wordpress",
{
"type": "theme",
"slug" : "my-theme",
"withReadme": true,
"copyFiles": false,
"releasePath": "/tmp/wp-release",
"path": "./dist"
}
],
Needs to be
[
"@semantic-release/wordpress",
{
"type": "theme",
"slug" : "my-theme",
"withReadme": true,
"copyFiles": false,
"releasePath": "/tmp/wp-release",
"path": "./dist/my-theme"
}
],
And then it should work.
P.S. I corrected the error with the double path.resolve
and improved the test case to demonstrate that custom path works
from wordpress.
Hi @seebeen, thanks for the immediate response.
I did a test but with this configuration the file verification fails.
[
"@semantic-release/wordpress",
{
"type": "theme",
"slug" : "my-theme",
"withReadme": true,
"copyFiles": false,
"releasePath": "/tmp/wp-release",
"path": "./dist/my-theme"
}
],
i think because inside verify-theme.ts
concat path with slug.
wordpress/lib/utils/verify-theme.ts
Line 9 in 2e63d93
So the path in verify state is "./dist/my-theme/my-theme" and in prepare state is "./dist/my-theme"
In my case the correct path is "./dist/my-theme".
[5:13:15 PM] [semantic-release] › ✘ ETHEMEFILENOTFOUND Your theme must contain these files: style.css, functions.php
Check if the files exist, and if not create them: style.css, functions.php.
AggregateError:
SemanticReleaseError: Your theme must contain these files: style.css, functions.php
at getError (file:///builds/my-theme/theme/node_modules/@semantic-release/wordpress/dist/utils/get-error.js:5:12)
at verifyTheme (file:///builds/my-theme/theme/node_modules/@semantic-release/wordpress/dist/utils/verify-theme.js:13:13)
at async verifyConditions (file:///builds/my-theme/theme/node_modules/@semantic-release/wordpress/dist/verify-conditions.js:12:17)
at async validator (file:///builds/my-theme/theme/node_modules/semantic-release/lib/plugins/normalize.js:36:24)
at async file:///builds/my-theme/theme/node_modules/semantic-release/lib/plugins/pipeline.js:38:36
at async Promise.all (index 0)
at async next (file:///builds/my-theme/theme/node_modules/semantic-release/node_modules/p-reduce/index.js:15:44)
at file:///builds/my-theme/theme/node_modules/semantic-release/lib/plugins/pipeline.js:55:13
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async pluginsConfigAccumulator.<computed> [as verifyConditions] (file:///builds/my-theme/theme/node_modules/semantic-release/lib/plugins/index.js:87:11)
at async run (file:///builds/my-theme/theme/node_modules/semantic-release/index.js:106:3)
at async Module.default (file:///builds/my-theme/theme/node_modules/semantic-release/index.js:275:22)
at async default (file:///builds/my-theme/theme/node_modules/semantic-release/cli.js:55:5) {
errors: [
SemanticReleaseError: Your theme must contain these files: style.css, functions.php
at getError (file:///builds/my-theme/theme/node_modules/@semantic-release/wordpress/dist/utils/get-error.js:5:12)
at verifyTheme (file:///builds/my-theme/theme/node_modules/@semantic-release/wordpress/dist/utils/verify-theme.js:13:13)
at async verifyConditions (file:///builds/my-theme/theme/node_modules/@semantic-release/wordpress/dist/verify-conditions.js:12:17)
at async validator (file:///builds/my-theme/theme/node_modules/semantic-release/lib/plugins/normalize.js:36:24)
at async file:///builds/my-theme/theme/node_modules/semantic-release/lib/plugins/pipeline.js:38:36
at async Promise.all (index 0)
at async next (file:///builds/my-theme/theme/node_modules/semantic-release/node_modules/p-reduce/index.js:15:44) {
code: 'ETHEMEFILENOTFOUND',
details: 'Check if the files exist, and if not create them: style.css, functions.php.',
semanticRelease: true,
pluginName: '@semantic-release/wordpress'
}
]
For test this user case, the prepare.specs.ts and verify-theme.spec.ts must have the same options
{
type: 'theme',
slug: 'complete-theme',
path: './test/fixtures/complete-theme',
copyFiles: false,
}
from wordpress.
Related Issues (9)
- Bug theme when specify path verify stage HOT 2
- DOCS: Listed as `.distexclude` but actually is `.distignore` HOT 2
- Requirement that `readme.txt` is in the `.wordpress-org` Directory is Not the Correct Standard HOT 6
- Failure to Complete Creating Package - TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined HOT 3
- DOCS: Update zip name
- zip command not found HOT 5
- Action Required: Fix Renovate Configuration
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wordpress.