Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
486b9a84bf | ||
|
00c8428015 | ||
|
ecb8f8e610 | ||
|
baf34484fe | ||
|
5dd1482148 | ||
|
9d1abd8d51 | ||
|
e6d3aea73d | ||
|
f9d308f923 | ||
|
68d45b4b9a | ||
|
99f44302fe | ||
|
1e9a212799 | ||
|
ca5490bdc5 | ||
|
0a80d40351 | ||
|
d3c891f39a |
10
.travis.yml
10
.travis.yml
@@ -11,12 +11,4 @@ addons:
|
|||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- gcc
|
- gcc
|
||||||
|
|
||||||
deploy:
|
|
||||||
provider: npm
|
|
||||||
email: ceberhardt@scottlogic.com
|
|
||||||
api_key:
|
|
||||||
secure: Vc9fsS/InXhvF8b3OIK5iTCRRB4ajUP73E5ObLiFYskVTCb5tLbl8rdYElV/uE2LF3Dw3SE9OyAARFPtkbUcmJ3A6YibEx5eKlPjWJZ8P0Pe85ap9XjopZzHzqpu+8kvZIPIQKUyisrD6RCRQdudT2uZKg2jvyvRwjnNVlVye4M=
|
|
||||||
on:
|
|
||||||
tags: true
|
|
||||||
branch: master
|
|
20
Gruntfile.js
20
Gruntfile.js
@@ -149,7 +149,12 @@ module.exports = function(grunt) {
|
|||||||
javaPackage: {
|
javaPackage: {
|
||||||
command: 'jar cf <%= config.distFolder %>/<%= config.libName %>.jar <%= config.javaSource %>'
|
command: 'jar cf <%= config.distFolder %>/<%= config.libName %>.jar <%= config.javaSource %>'
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
files: ['src/Layout.js'],
|
||||||
|
tasks: ['ci'],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Compiles and runs the Java tests
|
// Compiles and runs the Java tests
|
||||||
@@ -165,20 +170,23 @@ module.exports = function(grunt) {
|
|||||||
grunt.registerTask('test-javascript', ['eslint', 'karma']);
|
grunt.registerTask('test-javascript', ['eslint', 'karma']);
|
||||||
|
|
||||||
// Packages the JavaScript as a single UMD module and minifies
|
// Packages the JavaScript as a single UMD module and minifies
|
||||||
grunt.registerTask('package-javascript', ['mkdir:dist', 'includereplace', 'uglify']);
|
grunt.registerTask('package-javascript', ['includereplace', 'uglify']);
|
||||||
|
|
||||||
// Packages the Java as a JAR
|
// Packages the Java as a JAR
|
||||||
grunt.registerTask('package-java', ['mkdir:dist', 'shell:javaPackage']);
|
grunt.registerTask('package-java', ['shell:javaPackage']);
|
||||||
|
|
||||||
// Packages the C code as a single header
|
// Packages the C code as a single header
|
||||||
grunt.registerTask('package-c', ['mkdir:dist', 'concat']);
|
grunt.registerTask('package-c', ['concat']);
|
||||||
|
|
||||||
|
// package all languages
|
||||||
|
grunt.registerTask('package-all', ['package-javascript', 'package-java', 'package-c']);
|
||||||
|
|
||||||
// Default build, performs the full works!
|
// Default build, performs the full works!
|
||||||
grunt.registerTask('build', ['test-javascript', 'transpile', 'clean:dist', 'package-javascript', 'package-java', 'package-c']);
|
grunt.registerTask('build', ['test-javascript', 'transpile', 'clean:dist', 'mkdir:dist', 'package-all']);
|
||||||
|
|
||||||
// The JavaScript unit tests require Chrome (they need a faithful flexbox implementation
|
// The JavaScript unit tests require Chrome (they need a faithful flexbox implementation
|
||||||
// to test against), so under CI this step is skipped.
|
// to test against), so under CI this step is skipped.
|
||||||
grunt.registerTask('ci', ['eslint', 'transpile', 'clean:dist', 'package-javascript', 'package-java', 'package-c']);
|
grunt.registerTask('ci', ['eslint', 'transpile', 'clean:dist', 'mkdir:dist', 'package-all']);
|
||||||
|
|
||||||
grunt.registerTask('default', ['build']);
|
grunt.registerTask('default', ['build']);
|
||||||
};
|
};
|
||||||
|
@@ -3,6 +3,8 @@ css-layout [ or directly from the `dist` folder of this repo. The JavaScript version is also available via [cdnjs](https://cdnjs.com/libraries/css-layout).
|
||||||
|
|
||||||
In order to make sure that the code is correct, it is developed in JavaScript using TDD where each commit adds a unit test and the associated code to make it work. All the unit tests are tested against Chrome's implementation of CSS.
|
In order to make sure that the code is correct, it is developed in JavaScript using TDD where each commit adds a unit test and the associated code to make it work. All the unit tests are tested against Chrome's implementation of CSS.
|
||||||
|
|
||||||
The JavaScript version has been implemented in a way that can be easily transpiled to C and Java via regexes. The layout function doesn't do any allocation nor uses any of the dynamic aspect of JavaScript. The tests are also transpiled to make sure that the implementations are correct everywhere.
|
The JavaScript version has been implemented in a way that can be easily transpiled to C and Java via regexes. The layout function doesn't do any allocation nor uses any of the dynamic aspect of JavaScript. The tests are also transpiled to make sure that the implementations are correct everywhere.
|
||||||
|
17
dist/README.md
vendored
Normal file
17
dist/README.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
Releases can be found on [npm](https://www.npmjs.com/package/css-layout).
|
||||||
|
|
||||||
|
#Release Process
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Ensure that the local codebase is up to date
|
||||||
|
git fetch upstream master && git checkout FETCH_HEAD
|
||||||
|
|
||||||
|
# increment the version number and tag the release
|
||||||
|
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]
|
||||||
|
|
||||||
|
# push the the commit and tag back to upstream
|
||||||
|
git push --tags upstream HEAD:master
|
||||||
|
|
||||||
|
# publish this new version to npm
|
||||||
|
npm publish
|
||||||
|
```
|
12
package.json
12
package.json
@@ -1,15 +1,22 @@
|
|||||||
{
|
{
|
||||||
"name": "css-layout",
|
"name": "css-layout",
|
||||||
"version": "0.0.3",
|
"version": "1.0.0",
|
||||||
"description": "Reimplementation of CSS layout using pure JavaScript",
|
"description": "Reimplementation of CSS layout using pure JavaScript",
|
||||||
"main": "dist/css-layout.js",
|
"main": "dist/css-layout.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "grunt ci"
|
"watch": "grunt watch",
|
||||||
|
"test": "grunt ci",
|
||||||
|
"postversion": "git push --tags upstream HEAD:master"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/facebook/css-layout.git"
|
"url": "https://github.com/facebook/css-layout.git"
|
||||||
},
|
},
|
||||||
|
"keywords": [
|
||||||
|
"css",
|
||||||
|
"flexbox",
|
||||||
|
"layout"
|
||||||
|
],
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "BSD",
|
"license": "BSD",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
@@ -23,6 +30,7 @@
|
|||||||
"grunt-contrib-concat": "^0.5.1",
|
"grunt-contrib-concat": "^0.5.1",
|
||||||
"grunt-contrib-copy": "^0.8.0",
|
"grunt-contrib-copy": "^0.8.0",
|
||||||
"grunt-contrib-uglify": "^0.9.1",
|
"grunt-contrib-uglify": "^0.9.1",
|
||||||
|
"grunt-contrib-watch": "^0.6.1",
|
||||||
"grunt-eslint": "^17.1.0",
|
"grunt-eslint": "^17.1.0",
|
||||||
"grunt-execute": "^0.2.2",
|
"grunt-execute": "^0.2.2",
|
||||||
"grunt-include-replace": "^3.1.0",
|
"grunt-include-replace": "^3.1.0",
|
||||||
|
Reference in New Issue
Block a user