Compare commits

...

12 Commits

Author SHA1 Message Date
Colin Eberhardt
486b9a84bf 1.0.0 2015-09-08 07:45:08 +01:00
Colin Eberhardt
00c8428015 Merge pull request #119 from ColinEberhardt/keywords
Keywords
2015-09-01 06:51:59 +01:00
Colin Eberhardt
ecb8f8e610 Added layout keyword 2015-09-01 06:10:34 +01:00
Colin Eberhardt
baf34484fe Updated repo to include cdnjs / npm instructions 2015-08-31 22:15:46 +01:00
Colin Eberhardt
5dd1482148 Minor build change
removed duplication of the step that creates the 'dist' folder
2015-08-31 22:09:30 +01:00
Colin Eberhardt
9d1abd8d51 added keywords 2015-08-31 22:05:14 +01:00
Christopher Chedeau
e6d3aea73d Merge pull request #117 from paramaggarwal/watch
Watch for changes and run tests during development using `grunt watch`.
2015-08-28 09:49:46 -07:00
Param Aggarwal
f9d308f923 Watch for changes and run tests during development using grunt watch. 2015-08-28 22:15:57 +05:30
Colin Eberhardt
68d45b4b9a 0.0.6 2015-08-21 11:05:20 +01:00
Colin Eberhardt
99f44302fe Giving up on travis!
OK, Travis you have defeated me! reverting to a more manual release process
2015-08-21 11:04:46 +01:00
Colin Eberhardt
1e9a212799 0.0.5 2015-08-21 09:20:12 +01:00
Colin Eberhardt
ca5490bdc5 updated npm login details - again! 2015-08-21 09:19:56 +01:00
5 changed files with 33 additions and 19 deletions

View File

@@ -11,12 +11,4 @@ addons:
apt:
packages:
- gcc
deploy:
provider: npm
email: ceberhardt@scottlogic.com
api_key:
secure: "KTmVyw8YdArB5xWgNbkeZ9JD1jAKh/uMjWJdjjDfTBxKVarFfyP5+899C+qZJ8f7cAfiHZKwNE5nCjfU6uuFjYc7gMFr/ezm1KZc1DXM51V6B9TnIwLxNBr5ZYwcW7H725iYpQMwXX9rC/W4U8mahMKo8m7L0DQGUWEoYuGkKd8="
on:
tags: true
branch: master

View File

@@ -149,7 +149,12 @@ module.exports = function(grunt) {
javaPackage: {
command: 'jar cf <%= config.distFolder %>/<%= config.libName %>.jar <%= config.javaSource %>'
}
}
},
watch: {
files: ['src/Layout.js'],
tasks: ['ci'],
},
});
// Compiles and runs the Java tests
@@ -165,20 +170,23 @@ module.exports = function(grunt) {
grunt.registerTask('test-javascript', ['eslint', 'karma']);
// 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
grunt.registerTask('package-java', ['mkdir:dist', 'shell:javaPackage']);
grunt.registerTask('package-java', ['shell:javaPackage']);
// 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!
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
// 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']);
};

View File

@@ -3,6 +3,8 @@ css-layout [![Build Status](https://travis-ci.org/facebook/css-layout.svg?branch
This project implements a subset of CSS including flexbox and the box model using pure JavaScript, then transpiled to C and Java. The goal is to have a small standalone library to layout elements. It doesn't rely on the DOM at all.
The Java, C and JavaScript version of the code is available via [npm](https://www.npmjs.com/package/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.
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.

11
dist/README.md vendored
View File

@@ -1,4 +1,4 @@
Releases can be found on [npm](https://www.npmjs.com/package/dss-layout).
Releases can be found on [npm](https://www.npmjs.com/package/css-layout).
#Release Process
@@ -6,7 +6,12 @@ Releases can be found on [npm](https://www.npmjs.com/package/dss-layout).
# 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]
```
This will take care of getting the latest version of `upstream/master`, updating the package.json, committing, tagging and pushing back to `upstream/master`. Travis will then take care of building the packages and pushing to npm.
# push the the commit and tag back to upstream
git push --tags upstream HEAD:master
# publish this new version to npm
npm publish
```

View File

@@ -1,9 +1,10 @@
{
"name": "css-layout",
"version": "0.0.4",
"version": "1.0.0",
"description": "Reimplementation of CSS layout using pure JavaScript",
"main": "dist/css-layout.js",
"scripts": {
"watch": "grunt watch",
"test": "grunt ci",
"postversion": "git push --tags upstream HEAD:master"
},
@@ -11,6 +12,11 @@
"type": "git",
"url": "https://github.com/facebook/css-layout.git"
},
"keywords": [
"css",
"flexbox",
"layout"
],
"author": "",
"license": "BSD",
"bugs": {
@@ -24,6 +30,7 @@
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-watch": "^0.6.1",
"grunt-eslint": "^17.1.0",
"grunt-execute": "^0.2.2",
"grunt-include-replace": "^3.1.0",