diff --git a/.cz-config.js b/.cz-config.js new file mode 100644 index 0000000..7d9cfd4 --- /dev/null +++ b/.cz-config.js @@ -0,0 +1,20 @@ +'use strict'; + +module.exports = { + + types: [ + {value: 'feat', name: 'feat: A new feature'}, + {value: 'fix', name: 'fix: A bug fix'}, + {value: 'docs', name: 'docs: Documentation only changes'}, + {value: 'style', name: 'style: Changes that do not affect the meaning of the code\n (white-space, formatting, missing semi-colons, etc)'}, + {value: 'refactor', name: 'refactor: A code change that neither fixes a bug nor adds a feature'}, + {value: 'perf', name: 'perf: A code change that improves performance'}, + {value: 'test', name: 'test: Adding missing tests'}, + {value: 'chore', name: 'chore: Changes to the build process or auxiliary tools\n and libraries such as documentation generation'}, + {value: 'revert', name: 'revert: Revert to a commit'}, + {value: 'WIP', name: 'WIP: Work in progress'} + ], + + allowBreakingChanges: ['feat', 'fix', 'perf'] + +}; diff --git a/.gitignore b/.gitignore index 9f64f46..e310494 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store +tmp lib-cov *.seed *.log @@ -14,4 +15,3 @@ results node_modules npm-debug.log -tmp/ diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..2c630f1 --- /dev/null +++ b/.npmignore @@ -0,0 +1,2 @@ +test +.* diff --git a/.travis.yml b/.travis.yml index afffc56..0760cfb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,4 @@ language: node_js -node_js: - - "0.8.23" -before_install: - - "npm install -g mocha" - - "npm install -g grunt-cli" \ No newline at end of file +node_js: "6" +after_success: + - npm run semantic-release diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 4293a60..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,72 +0,0 @@ -/** - * - * Copyright 2012 Adobe Systems Inc.; - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/*global module:false*/ - -module.exports = function(grunt) { - - // Project configuration. - grunt.initConfig({ - - clean: { - release: ['css'] - }, - - topcoat: { - options: { - browsers: ['last 2 versions'], - license: grunt.file.read('test/fixtures/license.txt', 'utf-8') - }, - compile: { - files: [{ - src: 'test/fixtures/navigation-bar.css', - dest: 'css/navigation-bar.css' - } - ] - } - }, - - cssmin: { - minify: { - expand: true, - cwd: 'css', - src: ['*.css', '!*.min.css'], - dest: 'css', - ext: '.min.css' - } - }, - - simplemocha: { - all: { - src: ['test/*.test.js'] - } - } - }); - - // These plugins provide necessary tasks. - grunt.loadNpmTasks('grunt-topcoat'); - grunt.loadNpmTasks('grunt-simple-mocha'); - grunt.loadNpmTasks('grunt-contrib-cssmin'); - grunt.loadNpmTasks('grunt-contrib-clean'); - - grunt.registerTask('default', ['clean', 'build', 'test', 'release']); - grunt.registerTask('build', ['topcoat']); - grunt.registerTask('test', ['simplemocha']); - grunt.registerTask('release', ['cssmin']); - -}; diff --git a/LICENSE b/LICENSE index 242fd8a..d645695 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,3 @@ -Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. Apache License Version 2.0, January 2004 @@ -200,4 +199,4 @@ Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file + limitations under the License. diff --git a/README.md b/README.md index c81f186..ebc90a4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,4 @@ -Topcoat Navigation Bar Base -=========================== - -### Topcoat navigation bar base +# Topcoat Button Base This is the reset base for all Topcoat navigation bars. diff --git a/css/navigation-bar.css b/css/navigation-bar-base.css similarity index 52% rename from css/navigation-bar.css rename to css/navigation-bar-base.css index d4b09da..eaa3d14 100644 --- a/css/navigation-bar.css +++ b/css/navigation-bar-base.css @@ -1,20 +1,3 @@ -/** -* -* Copyright 2012 Adobe Systems Inc.; -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -*/ .navigation-bar, .navigation-bar__item, .navigation-bar__title { @@ -36,7 +19,6 @@ .navigation-bar, .navigation-bar__item { - -moz-box-sizing: border-box; box-sizing: border-box; background-clip: padding-box; } @@ -59,4 +41,4 @@ .navigation-bar__title { text-overflow: ellipsis; -} \ No newline at end of file +} diff --git a/css/navigation-bar.min.css b/css/navigation-bar.min.css deleted file mode 100644 index 24bea74..0000000 --- a/css/navigation-bar.min.css +++ /dev/null @@ -1 +0,0 @@ -.navigation-bar,.navigation-bar__item,.navigation-bar__title{padding:0;margin:0;font:inherit;color:inherit;background:transparent;border:0}.navigation-bar{cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.navigation-bar,.navigation-bar__item{-moz-box-sizing:border-box;box-sizing:border-box;background-clip:padding-box}.navigation-bar,.navigation-bar__title{white-space:nowrap;overflow:hidden}.navigation-bar{word-spacing:0}.navigation-bar__item{position:relative;display:inline-block;vertical-align:top}.navigation-bar__title{text-overflow:ellipsis} \ No newline at end of file diff --git a/package.json b/package.json index c1388d5..0065ce8 100644 --- a/package.json +++ b/package.json @@ -2,20 +2,18 @@ "name": "topcoat-navigation-bar-base", "version": "0.6.0", "description": "Topcoat navigation bar base", - "main": "index.html", "style": "src/navigation-bar.css", "directories": { - "test": "test", - "lib": "src", - "bin": "css" + "test": "test" }, "scripts": { - "test": "grunt test", - "prepublish": "grunt" + "test": "ava test", + "prepublish": "rsn -p './' -o ./css/navigation-bar-base.css ./test/navigation-bar-base.fixture.css", + "semantic-release": "semantic-release pre && npm publish && semantic-release post" }, "repository": { "type": "git", - "url": "git://github.com/topcoat/navigation-bar-base.git" + "url": "https://github.com/topcoat/navigation-bar-base.git" }, "keywords": [ "navigation", @@ -25,16 +23,33 @@ "base", "adobe" ], - "author": "@dam", - "license": "Apache2", - "devDependencies": { - "grunt": "~0.4.1", - "grunt-contrib-cssmin": "~0.6.1", - "grunt-contrib-clean": "~0.5.0", - "grunt-simple-mocha": "~0.4.0", - "grunt-topcoat": "~0.1.0" + "author": "Kristofer Joseph (http://kristoferjoseph.com/)", + "contributors": [ + "Garth Braithwaite (http://garthdb.com)" + ], + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/topcoat/topcoat/issues" }, + "homepage": "http://topcoat.io", "dependencies": { - "topcoat-utils": "~0.3.0" + "topcoat-utils": "^1.0.0" + }, + "devDependencies": { + "autoprefixer": "^6.5.3", + "ava": "^0.17.0", + "babel-cli": "^6.18.0", + "babel-core": "^6.20.0", + "babel-preset-es2015": "^6.18.0", + "babel-register": "^6.18.0", + "cz-customizable": "^4.0.0", + "mocha": "^3.2.0", + "resin": "^1.2.1", + "semantic-release": "^6.3.2" + }, + "config": { + "commitizen": { + "path": "./node_modules/cz-customizable" + } } } diff --git a/src/navigation-bar.css b/src/navigation-bar.css index 5860c07..2aa6927 100644 --- a/src/navigation-bar.css +++ b/src/navigation-bar.css @@ -1,35 +1,18 @@ -/** -* -* Copyright 2012 Adobe Systems Inc.; -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -*/ @import "topcoat-utils"; %navigation-bar { - extend: %reset-container; - extend: %reset-base; - extend: %reset-cursor; + @extend: %reset-container; + @extend: %reset-base; + @extend: %reset-cursor; } %navigation-bar__item { - extend: %reset-box-model; - extend: %inline-block; - extend: %reset-base; + @extend: %reset-box-model; + @extend: %inline-block; + @extend: %reset-base; } %navigation-bar__title { - extend: %reset-base; - extend: %ellipsis; -} \ No newline at end of file + @extend: %reset-base; + @extend: %ellipsis; +} diff --git a/test/fixtures/license.txt b/test/fixtures/license.txt deleted file mode 100644 index 8ee6f12..0000000 --- a/test/fixtures/license.txt +++ /dev/null @@ -1,17 +0,0 @@ -/** -* -* Copyright 2012 Adobe Systems Inc.; -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -*/ diff --git a/test/fixtures/navigation-bar.css b/test/fixtures/navigation-bar.css deleted file mode 100644 index 97a781c..0000000 --- a/test/fixtures/navigation-bar.css +++ /dev/null @@ -1,30 +0,0 @@ -/** -* -* Copyright 2012 Adobe Systems Inc.; -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -*/ -@import "./src/navigation-bar.css"; - -.navigation-bar { - extend: %navigation-bar; -} - -.navigation-bar__item { - extend: %navigation-bar__item; -} - -.navigation-bar__title { - extend: %navigation-bar__title; -} \ No newline at end of file diff --git a/test/expected/navigation-bar.css b/test/navigation-bar-base.expected.css similarity index 52% rename from test/expected/navigation-bar.css rename to test/navigation-bar-base.expected.css index d4b09da..eaa3d14 100644 --- a/test/expected/navigation-bar.css +++ b/test/navigation-bar-base.expected.css @@ -1,20 +1,3 @@ -/** -* -* Copyright 2012 Adobe Systems Inc.; -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -*/ .navigation-bar, .navigation-bar__item, .navigation-bar__title { @@ -36,7 +19,6 @@ .navigation-bar, .navigation-bar__item { - -moz-box-sizing: border-box; box-sizing: border-box; background-clip: padding-box; } @@ -59,4 +41,4 @@ .navigation-bar__title { text-overflow: ellipsis; -} \ No newline at end of file +} diff --git a/test/navigation-bar-base.fixture.css b/test/navigation-bar-base.fixture.css new file mode 100644 index 0000000..82c7690 --- /dev/null +++ b/test/navigation-bar-base.fixture.css @@ -0,0 +1,11 @@ +.navigation-bar { + @extend: %navigation-bar; +} + +.navigation-bar__item { + @extend: %navigation-bar__item; +} + +.navigation-bar__title { + @extend: %navigation-bar__title; +} diff --git a/test/navigation-bar.test.js b/test/navigation-bar.test.js index cdc8b0b..d0243d8 100644 --- a/test/navigation-bar.test.js +++ b/test/navigation-bar.test.js @@ -1,33 +1,18 @@ -/** - * - * Copyright 2012 Adobe Systems Inc.; - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ +import test from 'ava'; +import resin from 'resin'; +import fs from 'fs'; -/*global require, describe, it*/ - -var grunt = require('grunt'), - assert = require('assert'); - -describe('Topcoat Navigation Bar base', function() { - 'use strict'; - - it('should output the correct css', function() { - var actual = grunt.file.read('css/navigation-bar.css'); - var expected = grunt.file.read('test/expected/navigation-bar.css'); - assert.equal(actual, expected, 'should generate correct css'); - }); +test('compilation', t => { + const input = './test/navigation-bar-base.fixture.css'; + const expected = fs.readFileSync('./test/navigation-bar-base.expected.css','utf-8').trim(); + return resin({ + src: input, + css: fs.readFileSync(input, 'utf-8'), + vars: true, + extend: true, + prepend: '.' + }).then(result => { + t.is(result.css.trim(), expected); + }); }); diff --git a/test/perf/topcoat_navigation-bar-base.test.html b/test/perf/topcoat_navigation-bar-base.test.html deleted file mode 100644 index 838696d..0000000 --- a/test/perf/topcoat_navigation-bar-base.test.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file