bobtemplates.plone
bobtemplates.plone copied to clipboard
`grunt watch` fails with theme_package template when package name has 2 dots
Is it related to the template ?
test.name.themefails
test.theme works
[10:33:19] ~/testname
$ virtualenv-2.7 .
New python executable in /Users/aurore/testname/bin/python2.7
Also creating executable in /Users/aurore/testname/bin/python
Installing setuptools, pip, wheel...done.
[10:33:25] ~/testname
$ bin/pip install mr.bob
Collecting mr.bob
Requirement already satisfied: setuptools in ./lib/python2.7/site-packages (from mr.bob) (40.0.0)
Collecting Jinja2>=2.5.0 (from mr.bob)
Using cached https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl
Collecting six>=1.2.0 (from mr.bob)
Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from Jinja2>=2.5.0->mr.bob)
Installing collected packages: MarkupSafe, Jinja2, six, mr.bob
Successfully installed Jinja2-2.10 MarkupSafe-1.0 mr.bob-0.1.2 six-1.11.0
[10:33:35] ~/testname
$ bin/pip install bobtemplates.plone
Collecting bobtemplates.plone
Collecting stringcase (from bobtemplates.plone)
Requirement already satisfied: mr.bob in ./lib/python2.7/site-packages (from bobtemplates.plone) (0.1.2)
Collecting case-conversion (from bobtemplates.plone)
Collecting colorama (from bobtemplates.plone)
Using cached https://files.pythonhosted.org/packages/db/c8/7dcf9dbcb22429512708fe3a547f8b6101c0d02137acbd892505aee57adf/colorama-0.3.9-py2.py3-none-any.whl
Requirement already satisfied: setuptools in ./lib/python2.7/site-packages (from bobtemplates.plone) (40.0.0)
Collecting lxml (from bobtemplates.plone)
Using cached https://files.pythonhosted.org/packages/5c/4c/aabf60136f633c3d00aae4fe1eb0c78663947e8d176a3a091ff6aa1d45ae/lxml-4.2.3-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Requirement already satisfied: Jinja2>=2.5.0 in ./lib/python2.7/site-packages (from mr.bob->bobtemplates.plone) (2.10)
Requirement already satisfied: six>=1.2.0 in ./lib/python2.7/site-packages (from mr.bob->bobtemplates.plone) (1.11.0)
Collecting regex>=2016.2.25 (from case-conversion->bobtemplates.plone)
Using cached https://files.pythonhosted.org/packages/9f/79/adbe79373ec3c56ae61670bbed30609fe4a9b6af835478fa12bf8795cdec/regex-2018.07.11.tar.gz
Requirement already satisfied: MarkupSafe>=0.23 in ./lib/python2.7/site-packages (from Jinja2>=2.5.0->mr.bob->bobtemplates.plone) (1.0)
Building wheels for collected packages: regex
Running setup.py bdist_wheel for regex ... done
Stored in directory: /Users/aurore/Library/Caches/pip/wheels/cc/bf/b9/a2c431d3b6285626a4938ee6dbd287b961e5142c5ab80b8e8b
Successfully built regex
Installing collected packages: stringcase, regex, case-conversion, colorama, lxml, bobtemplates.plone
Successfully installed bobtemplates.plone-3.4.1 case-conversion-2.1.0 colorama-0.3.9 lxml-4.2.3 regex-2018.7.11 stringcase-1.2.0
[10:33:51] ~/testname
$ bin/mrbob bobtemplates.plone:theme_package -O test.name.theme
Welcome to mr.bob interactive mode. Before we generate directory structure, some questions need to be answered.
Answer with a question mark to display help.
Values in square brackets at the end of the questions show the default value if there is no answer.
--> Theme name [Theme]: test.name.theme
--> Author's name [aurore]:
--> Author's email [[email protected]]:
--> Author's github username:
--> Package description [A theme add-on for Plone]:
--> Do you want me to initialze a GIT repository in your new package? (y/n) [y]:
--> Plone version [5.1]:
RUN: git init
Initialized empty Git repository in /Users/aurore/testname/test.name.theme/.git/
Should we run?:
git add .
git commit -m "Create theme_package: test.name.theme"
in: /Users/aurore/testname/test.name.theme
[y]/n:
RUN: git add .
RUN: git commit -m "Create theme_package: test.name.theme"
No .pre-commit-config.yaml file was found
- To temporarily silence this, run `PRE_COMMIT_ALLOW_NO_CONFIG=1 git ...`
- To permanently silence this, install pre-commit with the --allow-missing-config option
- To uninstall pre-commit run `pre-commit uninstall`
Generated file structure at /Users/aurore/testname/test.name.theme
[10:34:23] ~/testname
$ cd test.name.theme/
[10:34:31] ~/testname/test.name.theme master✘
$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See `npm help json` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
package name: (test.name.theme)
version: (1.0.0)
entry point: (Gruntfile.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to /Users/aurore/testname/test.name.theme/package.json:
{
"//": "Put here only devDependencies, theme dependencies should stay inside of the theme folder.",
"name": "test.name.theme",
"version": "1.0.0",
"devDependencies": {
"grunt": "~0.4.4",
"grunt-browser-sync": "^2.2.0",
"grunt-contrib-less": "latest",
"grunt-contrib-watch": "latest",
"grunt-postcss": "^0.8.0",
"pixrem": "^3.0.2",
"cssnano": "^3.7.7",
"autoprefixer": "^6.5.1"
},
"description": ".. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features. If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html This text does not appear on pypi or github. It is a comment.",
"main": "Gruntfile.js",
"directories": {
"doc": "docs"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
Is this OK? (yes)
[10:34:43] ~/testname/test.name.theme master✘
$ npm install
npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
> [email protected] install /Users/aurore/testname/test.name.theme/node_modules/fsevents
> node install
[fsevents] Success: "/Users/aurore/testname/test.name.theme/node_modules/fsevents/lib/binding/Release/node-v59-darwin-x64/fse.node" is installed via remote
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No repository field.
added 506 packages from 513 contributors in 9.301s
[10:34:56] ~/testname/test.name.theme master✘
$ grunt watch --verbose
Initializing
Command-line options: --verbose
Reading "Gruntfile.js" Gruntfile...OK
Registering Gruntfile tasks.
Reading package.json...OK
Parsing package.json...OK
Initializing config...OK
Registering "grunt-browser-sync" local Npm module tasks.
Reading /Users/aurore/testname/test.name.theme/node_modules/grunt-browser-sync/package.json...OK
Parsing /Users/aurore/testname/test.name.theme/node_modules/grunt-browser-sync/package.json...OK
Loading "browser-sync.js" tasks...OK
+ browserSync, bsNotify, bsReload
Registering "grunt-contrib-watch" local Npm module tasks.
Reading /Users/aurore/testname/test.name.theme/node_modules/grunt-contrib-watch/package.json...OK
Parsing /Users/aurore/testname/test.name.theme/node_modules/grunt-contrib-watch/package.json...OK
Loading "watch.js" tasks...OK
+ watch
Registering "grunt-contrib-less" local Npm module tasks.
Reading /Users/aurore/testname/test.name.theme/node_modules/grunt-contrib-less/package.json...OK
Parsing /Users/aurore/testname/test.name.theme/node_modules/grunt-contrib-less/package.json...OK
Loading "less.js" tasks...OK
+ less
Registering "grunt-postcss" local Npm module tasks.
Reading /Users/aurore/testname/test.name.theme/node_modules/grunt-postcss/package.json...OK
Parsing /Users/aurore/testname/test.name.theme/node_modules/grunt-postcss/package.json...OK
Loading "postcss.js" tasks...OK
+ postcss
Loading "Gruntfile.js" tasks...ERROR
>> Error: ENOENT: no such file or directory, uv_chdir
>> at process.chdir (/Users/aurore/testname/test.name.theme/node_modules/less/node_modules/graceful-fs/polyfills.js:21:9)
>> at Object.file.setBase (/Users/aurore/testname/test.name.theme/node_modules/grunt/lib/grunt/file.js:44:11)
>> at Object.module.exports (/Users/aurore/testname/test.name.theme/Gruntfile.js:98:16)
>> at loadTask (/Users/aurore/testname/test.name.theme/node_modules/grunt/lib/grunt/task.js:325:10)
>> at Task.task.init (/Users/aurore/testname/test.name.theme/node_modules/grunt/lib/grunt/task.js:437:5)
>> at Object.grunt.tasks (/Users/aurore/testname/test.name.theme/node_modules/grunt/lib/grunt.js:120:8)
>> at Object.module.exports [as cli] (/Users/aurore/testname/test.name.theme/node_modules/grunt/lib/grunt/cli.js:38:9)
>> at Object.<anonymous> (/usr/local/lib/node_modules/grunt-cli/bin/grunt:44:20)
>> at Module._compile (internal/modules/cjs/loader.js:654:30)
>> at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
Running tasks: watch
Running "watch" task
Waiting...
Verifying property watch exists in config...OK
Verifying property watch.scripts.files exists in config...OK
Could you test this with the new theme_barceloneta subtemplate inside an addon? The theme_package template is now deprecated, as the subtemplate is more flexible.