diff --git a/.bowerrc b/.bowerrc deleted file mode 100644 index efb8c79d79..0000000000 --- a/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory" : "mockup/bower_components" -} diff --git a/.gitignore b/.gitignore index 9d940f93bc..bdcc196965 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ stamp-bower stamp-npm test-results.xml .vscode +!.yarnrc diff --git a/.nix/bower.nix b/.nix/bower.nix deleted file mode 100644 index 7fba1391cc..0000000000 --- a/.nix/bower.nix +++ /dev/null @@ -1,113 +0,0 @@ -{ }: [ - { name = "console-polyfill"; - version = "0.1.1"; - target = "0.1.1"; - outputHash = "1ql54f9mwzn0kmgy01bsdfgx04hs3a6vzk9yjzckfaikigad5czv"; - } - { name = "jquery.cookie"; - version = "1.4.0"; - target = "1.4.0"; - outputHash = "1ad2k90b1f4fjazs6jzma4gxpqmwbzra36hrnchjp223hnasv263"; - } - { name = "requirejs-text"; - version = "2.0.10"; - target = "2.0.10"; - outputHash = "0s83zzk9syh568fjlzfdzmbb2csx1nmkcbvcjimi1achl0v7sk4q"; - } - { name = "mockup-core"; - version = "1.2.1"; - target = "1.2.1"; - outputHash = "0hp0bxligqqlbxmnzdsgpfwsv6mksl1hx0w369rsn6c1wx2b1idx"; - } - { name = "jquery-form"; - version = "3.46.0"; - target = "3.46.0"; - outputHash = "11bnyx8ig3bc4vwskd99zxzbnzayh18vdkaklmjiwkg8jbcxix40"; - } - { name = "sinonjs"; - version = "1.9.0"; - target = "1.9.0"; - outputHash = "1s9hn5x3vzxs41mhgfagbj0m6s8x53598y4h1za1nr9z6ymvig3l"; - } - { name = "expect"; - version = "0.3.1"; - target = "0.3.1"; - outputHash = "0b32higq1g005i066gk6anyv1yrb450rbhaw9cfrrqpw9wxlgcfm"; - } - { name = "dropzone"; - version = "3.8.4"; - target = "3.8.4"; - outputHash = "1hbr2bhm9250xk3apvbinns0aiw02wxh4idzlgb8jcngb42w1r6k"; - } - { name = "es5-shim"; - version = "2.3.0"; - target = "2.3.0"; - outputHash = "021mwrjnrhf64sx7nqmi1q52ypm10njp9m3pd0mvf9h139v98x9y"; - } - { name = "select2"; - version = "3.4.5"; - target = "3.4.5"; - outputHash = "1aibpwlnj5d10s7m7a7fci9jnv5nq1bq881fk952a8xz3p33mmd1"; - } - { name = "jqtree"; - version = "0.20.0"; - target = "0.20.0"; - outputHash = "11xb3f510ngi27rp54xzhg5n6zdpib3cq0w27njjdkhy0259j7sg"; - } - { name = "backbone.paginator"; - version = "0.8.1"; - target = "0.8.1"; - outputHash = "1caknrjn4iz1yg11g3ilma8l6mjgpgc9pzmwa4vz3r5gf1pcb2ds"; - } - { name = "jquery"; - version = "1.8.3"; - target = "1.8.3"; - outputHash = "1frlqnm1rhwwbvcp4i5ysb1adxbcsb90kh369nw3drgi9ky9x0sy"; - } - { name = "moment"; - version = "2.5.1"; - target = "2.5.1"; - outputHash = "0bibpc7xjn8b9irm49679hzcadp5vacas9r5gdhz92h2bznv01nb"; - } - { name = "react"; - version = "0.9.0"; - target = "0.9.0"; - outputHash = "180m4lj68hjh6hvirb1pvws61ljhry30pyvbhhadzl1zn3jf90h7"; - } - { name = "marked"; - version = "0.3.2"; - target = "0.3.2"; - outputHash = "1s17a069bdfr9gxnmk7nvlb0yivnklq047lw2zjsdasmdb77kd2l"; - } - { name = "lodash"; - version = "2.4.1"; - target = "2.4.1"; - outputHash = "08jmf5hq8r055cq8c3flkg1ycmpdrrgi6s9070lddk6jljaqa2ha"; - } - { name = "bootstrap"; - version = "3.1.1"; - target = "3.1.1"; - outputHash = "1n7ngrymiv5pbivw36wmryahs0j132i6hzy25jwqhs9k36qr16xb"; - } - { name = "pickadate"; - version = "3.4.0"; - target = "3.4.0"; - outputHash = "1f15vw4crj6zjyqx47n1ncjldh8alzdkf04jn0m8xplzz3sfl48i"; - } - { name = "backbone"; - version = "1.1.2"; - target = "1.1.2"; - outputHash = "1h5yy2lbwd8ik6cyi234hv4i0cy1dijlh6s65kqi0asq1qzi18bs"; - } - { name = "underscore"; - version = "1.6.0"; - target = ">=1.5.0"; - outputHash = "0sdqbyqx56awpd481plp9x16ii9ws0kmi3kmpinj4nzlqv8p9jrv"; - } - { name = "ace-builds"; - version = "1.1.3"; - target = "1.1.3"; - outputHash = "0n5cbasg4f09scpkb38gvb70xsvl0x27dj2pxl8iknaqqfhia137"; - } -] - diff --git a/.nix/default.nix b/.nix/default.nix index 3604745254..2aecb49cf0 100644 --- a/.nix/default.nix +++ b/.nix/default.nix @@ -46,9 +46,9 @@ in rec { requirejs ]; postInstall = '' - mkdir -p $out/bower_components + mkdir -p $out/node_modules ${pkgs.lib.concatStrings (map (p: '' - ln -s ${pkgs.fetchbower p.name p.version p.target p.outputHash}/packages/*/${p.version} $out/bower_components/${p.name} + ln -s ${pkgs.fetchbower p.name p.version p.target p.outputHash}/packages/*/${p.version} $out/node_modules/${p.name} '') bowerPackages )} ''; diff --git a/.yarnrc b/.yarnrc new file mode 100644 index 0000000000..e1f875881e --- /dev/null +++ b/.yarnrc @@ -0,0 +1 @@ +--modules-folder mockup/node_modules diff --git a/CHANGES.rst b/CHANGES.rst index 2d1b8f6792..4e8d0115a2 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,7 +1,49 @@ Changelog ========= -2.7.6 (Unreleased) +3.0 (unreleased) +---------------- + +TODO: + +- Refactor docs like in Patterns to get rid of react. +- since we removed marked and react, refactor docs like in Patterns. + +- Refactor jquery.recurrenceinput.js dependencies + + +Breaking changes: + +* Uses now ``yarn`` instead of ``bower``. + ``bower.json`` is dropped, ``package.json`` is extended and all packages go into ``mockup/node_modules``. + Note: you have to use ``yarn`` for that to work, as with npm there is no way to customize the modules directory. + All references in LESS files to ``bowerPath`` are kept for a frictionless upgrade. + [thet] + +* Remove obsolete dependencies: + - console-polyfill + - es5-shim + - selectivizr + - js-shortcuts + - marked + - react + - JSXTransformer + [thet] + +* Remove support for IE < 9. + [thet] + +New features: + +* Add ``plone-patterns-toolbar`` pattern from CMFPlone. + [thet] + +Bug fixes: + +* add items here + + +2.6.3 (Unreleased) ------------------ Breaking changes: diff --git a/MANIFEST.in b/MANIFEST.in index 852a3c6544..99bd87b6e3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -13,7 +13,7 @@ recursive-include mockup/patterns * recursive-include mockup/tests * prune .nix prune dist -prune mockup/bower_components +prune mockup/node_modules prune mockup/build prune mockup/coverage prune mockup/docs diff --git a/Makefile b/Makefile index 87954972e1..4f6fa61df4 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,7 @@ GIT = git -NPM = npm -GRUNT = ./node_modules/grunt-cli/bin/grunt -BOWER = ./node_modules/bower/bin/bower -NODE_PATH = ./node_modules +NODE_PATH = ./mockup/node_modules +GRUNT = $(NODE_PATH)/grunt-cli/bin/grunt BUILD_DIR = ./mockup/build DEBUG = @@ -19,14 +17,10 @@ endif all: test-once bundles docs stamp-npm: package.json - npm install + yarn install touch stamp-npm -stamp-bower: stamp-npm bower.json - $(BOWER) install - touch stamp-bower - -bundles: stamp-bower bundle-widgets bundle-structure bundle-plone +bundles: stamp-npm bundle-widgets bundle-structure bundle-plone # ----------------------------------------------------------------------- # # For plone 5, build the bundles on the plone side, as described in: # Products.CMFPlone/DEVELOPING_BUNDLES.rst @@ -60,13 +54,12 @@ bootstrap-common: mkdir -p $(BUILD_DIR) bootstrap: bootstrap-common - $(NPM) link - NODE_PATH=$(NODE_PATH) $(BOWER) install --config.interactive=0 + NODE_PATH=$(NODE_PATH) yarn install bootstrap-nix: clean bootstrap-common nix-build default.nix -A build -o nixenv ln -s nixenv/lib/node_modules/mockup/node_modules - ln -s nixenv/bower_components + ln -s nixenv/node_modules jshint: NODE_PATH=$(NODE_PATH) $(GRUNT) jshint $(DEBUG) $(VERBOSE) --gruntfile=mockup/Gruntfile.js @@ -74,13 +67,13 @@ jshint: watch: NODE_PATH=$(NODE_PATH) $(GRUNT) watch $(DEBUG) $(VERBOSE) --gruntfile=mockup/Gruntfile.js -test: stamp-bower +test: stamp-npm NODE_PATH=$(NODE_PATH) $(GRUNT) test $(DEBUG) $(VERBOSE) --gruntfile=mockup/Gruntfile.js --pattern=$(pattern) -test-once: stamp-bower +test-once: stamp-npm NODE_PATH=$(NODE_PATH) $(GRUNT) test_once $(DEBUG) $(VERBOSE) --gruntfile=mockup/Gruntfile.js --pattern=$(pattern) -test-jenkins: stamp-bower +test-jenkins: stamp-npm NODE_PATH=$(NODE_PATH) $(GRUNT) test_jenkins $(DEBUG) $(VERBOSE) --gruntfile=mockup/Gruntfile.js --pattern=$(pattern) test-dev: @@ -98,14 +91,11 @@ test-ci: clean: mkdir -p $(BUILD_DIR) rm -rf $(BUILD_DIR) - rm -rf node_modules - rm -rf mockup/bower_components - rm -f stamp-npm stamp-bower - rm -rf node_modules src/bower_components + rm -rf mockup/node_modules + rm -f stamp-npm clean-deep: clean - if test -f $(BOWER); then $(BOWER) cache clean; fi - if test -f $(NPM); then $(NPM) cache clean; fi + yarn cache clean publish-docs: echo -e "Publishing 'docs' bundle!\n"; cd mockup/docs; git add -fA .; git commit -m "Publishing docs"; git push -f git@github.com:plone/mockup.git gh-pages; cd ../..; diff --git a/bower.json b/bower.json deleted file mode 100644 index 07da0f87e4..0000000000 --- a/bower.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "mockup", - "description": "A collection of client side patterns for faster and easier web development", - "dependencies": { - "ace-builds": "1.2.6", - "backbone": "1.1.2", - "backbone.paginator": "0.8.1", - "bootstrap": "3.3.6", - "console-polyfill": "0.2.2", - "datatables.net": "1.10.16", - "datatables.net-bs": "1.10.16", - "datatables.net-autofill": "2.2.2", - "datatables.net-autofill-bs": "2.2.2", - "datatables.net-buttons": "1.4.2", - "datatables.net-buttons-bs": "1.4.2", - "datatables.net-colreorder": "1.4.1", - "datatables.net-colreorder-bs": "1.4.1", - "datatables.net-fixedcolumns": "3.2.3", - "datatables.net-fixedcolumns-bs": "3.2.3", - "datatables.net-fixedheader": "3.1.3", - "datatables.net-fixedheader-bs": "3.1.3", - "datatables.net-keytable": "2.3.2", - "datatables.net-keytable-bs": "2.3.2", - "datatables.net-responsive": "2.2.0", - "datatables.net-responsive-bs": "2.2.0", - "datatables.net-rowreorder": "1.2.3", - "datatables.net-rowreorder-bs": "1.2.3", - "datatables.net-scroller": "1.4.3", - "datatables.net-scroller-bs": "1.4.3", - "datatables.net-select": "1.2.3", - "datatables.net-select-bs": "1.2.3", - "dropzone": "4.3.0", - "es5-shim": "4.5.9", - "jqtree": "1.4.1", - "jquery": "1.11.3", - "jquery-form": "3.51", - "jquery.cookie": "1.4.1", - "jquery.recurrenceinput.js": "v1.5.2", - "logging": "", - "marked": "0.3.5", - "moment": "2.10.6", - "patternslib": "2.0.13", - "pickadate": "3.5.6", - "react": "0.10.0", - "requirejs-text": "2.0.15", - "select2": "3.5.4", - "selectivizr": "1.0.2", - "tinymce-builded": "4.7.13", - "js-shortcuts": "^1.0.1", - "cs-jqtree-contextmenu": "^0.1.0" - }, - "devDependencies": { - "expect": "0.3.1", - "sinonjs": "1.17.1" - }, - "resolutions": { - "bootstrap": "3.3.6", - "jquery": "1.11.3", - "jquery-form": "3.51", - "select2": "3.5.4", - "moment": "2.10.6" - } -} diff --git a/mockup/GETTING_STARTED.md b/mockup/GETTING_STARTED.md index 7bf4411d47..eac6e97b17 100644 --- a/mockup/GETTING_STARTED.md +++ b/mockup/GETTING_STARTED.md @@ -47,7 +47,7 @@ and then you open index.html with your browser! * `less/` : Contains all the [Less](http://lesscss.org/) code for all the patterns and bundles - * `lib/` : Contains external libraries not necessarily found in the bower repositories + * `lib/` : Contains external libraries not necessarily found in ``mockup/node_modules``. * `tests/` : Contains all tests for patterns and bundles, including general setup and configuration code diff --git a/mockup/Gruntfile.js b/mockup/Gruntfile.js index 645fca93c3..9e0bcebcb5 100644 --- a/mockup/Gruntfile.js +++ b/mockup/Gruntfile.js @@ -27,7 +27,7 @@ module.exports = function(grunt) { options: { paths: ['../../../'], modifyVars: { - bowerPath: '"bower_components/"', + bowerPath: '"node_modules/"', mockupPath: '"patterns/"', mockuplessPath: '"less/"' } @@ -37,7 +37,7 @@ module.exports = function(grunt) { docs: { files: [ { expand: true, src: '*.md', dest: 'docs/dev/' }, - { expand: true, src: 'bower_components/**', dest: 'docs/dev/' }, + { expand: true, src: 'node_modules/**', dest: 'docs/dev/' }, { expand: true, src: 'index.html', dest: 'docs/dev/' }, { expand: true, src: 'js/**', dest: 'docs/dev/' }, { expand: true, src: 'less/**', dest: 'docs/dev/' }, @@ -65,9 +65,8 @@ module.exports = function(grunt) { //}, 'docs-legacy-js': { path: 'docs/dev/index.html', - pattern: - '\n \n ', - replacement: '' + pattern: '', + replacement: '\n' }, 'docs-catalogurl': { path: 'docs/dev/index.html', @@ -159,7 +158,7 @@ module.exports = function(grunt) { console.log('read folder: ' + path); var files = fs.readdirSync(path); files.forEach(function(filename) { - if (filename === 'bower_components' || filename === 'node_modules') { + if (filename === 'node_modules' || filename === 'node_modules') { return; } var stats = fs.statSync(path + filename); diff --git a/mockup/LEARN.md b/mockup/LEARN.md index 944575ef49..a98ef3fd7e 100644 --- a/mockup/LEARN.md +++ b/mockup/LEARN.md @@ -18,7 +18,6 @@ You might also want to review the *Mockup Project Structure* section of *Getting
 mockup/
-	bower.json
   CHANGES.rst
   CONTRIBUTING.rst
   LICENSE.rst
@@ -47,6 +46,7 @@ mockup/
     node_modules/
     patterns/
     tests/
+  package.json
   …
 
@@ -123,7 +123,7 @@ So, first open the file *js/config.js* and add the following line under the *pat baseUrl: './', paths: { … - 'underscore': 'bower_components/underscore/underscore', + 'underscore': 'node_modules/underscore/underscore', 'mockup-patterns-helloworld': 'patterns/hello/pattern' // <- right here! }, … diff --git a/mockup/index.html b/mockup/index.html index 2fdd8c54c5..56607d009b 100644 --- a/mockup/index.html +++ b/mockup/index.html @@ -1,23 +1,12 @@ - - - - + - Mockup - - -