Skip to content

Commit

Permalink
fix(rxPageObjects): added package.json and switched to npm pack so …
Browse files Browse the repository at this point in the history
…`npm install` now works
  • Loading branch information
Kevin Lamping committed Feb 24, 2014
1 parent 91831b7 commit 483f46a
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 17 deletions.
4 changes: 2 additions & 2 deletions docs/testing.md
Expand Up @@ -78,11 +78,11 @@ The file name for this page objects follows the `componentName.page.js` conventi

On build, all page object files are concatanated and tarballed into the `dist` directory. They are then published either manually or via Travis. To use these page objects, developers should include the following dependency in their `package.json` file:

"rxPageObjects": "https://95c7050854423f809e66-6999ba0e7a4f47d417515fb3f08fa9b8.ssl.cf1.rackcdn.com/0.0.4/rxPageObjects.tar.gz"
"rx-page-objects": "https://95c7050854423f809e66-6999ba0e7a4f47d417515fb3f08fa9b8.ssl.cf1.rackcdn.com/0.0.4/rx-page-objects-0.0.4.tgz"

Alternatively, they can install the file using this command:

npm install --save-dev https://95c7050854423f809e66-6999ba0e7a4f47d417515fb3f08fa9b8.ssl.cf1.rackcdn.com/0.0.4/rxPageObjects.tar.gz
npm install --save-dev https://95c7050854423f809e66-6999ba0e7a4f47d417515fb3f08fa9b8.ssl.cf1.rackcdn.com/0.0.4/rx-page-objects-0.0.4.tgz

Once installed, the page objects can be pulled in to any midway test via:

Expand Down
5 changes: 3 additions & 2 deletions grunt-tasks/options/bump.js
@@ -1,10 +1,11 @@
module.exports = {
options: {
files: ['package.json', 'bower.json'],
files: ['package.json', 'bower.json', 'utils/rx-page-objects/package.json'],
updateConfigs: ['pkg'],
commit: true,
commitMessage: 'chore(version): v%VERSION% [skip ci]',
commitFiles: ['package.json', 'bower.json', 'CHANGELOG.md', 'README.md', 'docs/testing.md'],
commitFiles: ['package.json', 'bower.json', 'CHANGELOG.md', 'README.md', 'docs/testing.md',
'utils/rx-page-objects/package.json'],
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
Expand Down
2 changes: 1 addition & 1 deletion grunt-tasks/options/clean.js
Expand Up @@ -9,6 +9,6 @@ module.exports = {
src: ['coverage']
},
rxPageObjects: {
src: 'index.js'
src: ['utils/rx-page-objects/index.js', 'utils/rx-page-objects/*.tgz']
}
};
9 changes: 0 additions & 9 deletions grunt-tasks/options/compress.js

This file was deleted.

2 changes: 1 addition & 1 deletion grunt-tasks/options/concat.js
Expand Up @@ -24,6 +24,6 @@ module.exports = {
}
},
src: ['src/*/*.page.js'],
dest: 'index.js'
dest: 'utils/rx-page-objects/index.js'
}
};
6 changes: 6 additions & 0 deletions grunt-tasks/options/copy.js
Expand Up @@ -59,5 +59,11 @@ module.exports = {
return dest + imagePath.join(path.sep);
}
}]
},
rxPageObjects: {
expand: true,
flatten: true,
src: 'utils/rx-page-objects/*.tgz',
dest: '<%= config.dist %>/'
}
};
3 changes: 3 additions & 0 deletions grunt-tasks/options/replace.js
Expand Up @@ -5,6 +5,9 @@ module.exports = {
replacements: [{
from: /\.com\/(?:\d\.){2}\d\//g,
to: '.com/<%= pkg.version %>/'
}, {
from: /\-(?:\d\.){2}\d\.tgz/g,
to: '-<%= pkg.version %>.tgz'
}]
}
};
9 changes: 9 additions & 0 deletions grunt-tasks/options/shell.js
Expand Up @@ -17,5 +17,14 @@ module.exports = {
return '';
}
}
},
rxPageObjects: {
command: 'npm pack',
options: {
stdout: true,
execOptions: {
cwd: 'utils/rx-page-objects'
}
}
}
};
7 changes: 6 additions & 1 deletion grunt-tasks/rxPageObjects.js
@@ -1,3 +1,8 @@
module.exports = function(grunt) {
grunt.registerTask('rxPageObjects', ['concat:rxPageObjects', 'compress:rxPageObjects', 'clean:rxPageObjects']);
grunt.registerTask('rxPageObjects', [
'concat:rxPageObjects',
'shell:rxPageObjects',
'copy:rxPageObjects',
'clean:rxPageObjects'
]);
};
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -60,7 +60,6 @@
"grunt-complexity": "~0.1.4",
"grunt-text-replace": "~0.3.11",
"chai-as-promised": "~4.1.0",
"grunt-contrib-compress": "~0.7.0",
"grunt-contrib-cssmin": "~0.8.0",
"grunt-contrib-uglify": "~0.3.2"
}
Expand Down
14 changes: 14 additions & 0 deletions utils/rx-page-objects/package.json
@@ -0,0 +1,14 @@
{
"name": "rx-page-objects",
"description": "Midway test page objects for all of the Encore UI components",
"version": "0.0.4",
"main": "index.js",
"license": "Apache License, Version 2.0",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@github.com:rackerlabs/encore-ui.git"
}
}

0 comments on commit 483f46a

Please sign in to comment.