Skip to content

Commit

Permalink
ncu (#156)
Browse files Browse the repository at this point in the history
* Drop node 0.10 & 0.12, add 7, deps++, fix test
* Update dependencies
* Bump version and update README.md
* Add OOTB Support Tools to README.md
* Use `yarn` instead of `npm install` in `.travis.yml`
  • Loading branch information
binduwavell authored Mar 25, 2017
1 parent d36388a commit d4d8285
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 68 deletions.
19 changes: 3 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
/* eslint-env node */
module.exports = {
"env": {
"node": true
},
"extends": "standard",
"plugins": [
"standard"
],
"rules": {
"comma-dangle": ["error", "always-multiline"],
"no-template-curly-in-string": ["off"],
"operator-linebreak": ["error", "before"],
"semi": ["error", "always", { "omitLastInOneLineBlock": true}],
}
};
{

}
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ jdk:
- oraclejdk8

env:
- NODE_VERSION=v7
- NODE_VERSION=v6
- NODE_VERSION=v5
- NODE_VERSION=v4
- NODE_VERSION=v0.12
- NODE_VERSION=v0.10

cache:
yarn: true
directories:
- node_modules
- $HOME/.m2

install:
- nvm install $NODE_VERSION
- npm install
- npm install -g yarn
- yarn

script:
- nvm use $NODE_VERSION
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Alfresco SDK and specifically the All in One maven archetype.
### What is [Yeoman](http://yeoman.io)?

Yeoman is a command line tool that helps you to automate coding tasks. Out of the box, Yeoman
doesn't do very much. It relies on a library of thousands of
doesn't do very much. It relies on a library of thousands of
[generators](http://yeoman.io/generators/) to actually perform the coding tasks for you.

Yeoman lives in the [npm](https://npmjs.org) package repository. Assuming you have a recent
Expand All @@ -24,21 +24,24 @@ to install Yeoman.
npm install -g yo
```

NOTE: that we now require Node 4.x or above. Information on installing Node is linked from
our [Supported Platforms / Node Versions][installing-node] wiki page.

### Installing and using the generator

You have a couple of options for installing the Alfresco generator for Yeoman. Your choice will
You have a couple of options for installing the Alfresco generator for Yeoman. Your choice will
depend on if you plan to extend the generator or if you simply want to use it.

> _Checkout the next section for what to do if you plan to work on the generator code._
We have not pushed a version of the Alfresco generator to npmjs.org yet, so if you don't
We have not pushed a version of the Alfresco generator to npmjs.org yet, so if you don't
plan to make changes to the generator itself, run:

```bash
npm install -g binduwavell/generator-alfresco
```

WARNING: you will likely need to update this occasionally as the project is under active
WARNING: you will likely need to update this occasionally as the project is under active
development.

Now, assuming you have all of the pre-requisites installed (including appropriate
Expand Down Expand Up @@ -198,10 +201,11 @@ of the SDK:
| | SDK 2.2.0<br/>Community | SDK 2.2.0<br/>Enterprise | SDK 2.1.1<br/>Community | SDK 2.1.1<br/>Enterprise | SDK 2.1.0<br/>Community | SDK 2.1.0<br/>Enterprise | SDK 2.0.0<br/>Community | SDK 2.0.0<br/>Enterprise | local SDK<br/>Community | local SDK<br/>Enterprise |
| ------------------------------ | --------- | ---------- | --------- | ---------- | --------- | ---------- | --------- | ---------- | --------- | ---------- |
| Alfresco Office Services | 1.1 | 1.1.3 | | | | | | | | |
| Developer Helper | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 |
| Developer Helper | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 |
| JavaMelody | 1.62.0 | 1.62.0 | | | | | | | | |
| JavaScript Console | 0.6 | 0.6 | 0.6 | 0.6 | 0.6 | 0.6 | 0.6 | 0.6 | 0.6 | 0.6 |
| JScript Extensions | 1.2 | 1.2 | | | | | | | | |
| Order of the Bee Support Tools | 0.0.1.0 | 0.0.1.0 | 0.0.1.0 | 0.0.1.0 | 0.0.1.0 | 0.0.1.0 | 0.0.1.0 | 0.0.1.0 | 0.0.1.0 | 0.0.1.0 |
| Records Management | 2.5.a | 2.5.0 | 2.3 | 2.3 | 2.3 | 2.3 | | | | |
| Share Inbound Calendar Invites | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 |
| Share Site Announcements | 0.0.2 | 0.0.2 | 0.0.2 | 0.0.2 | 0.0.2 | 0.0.2 | 0.0.2 | 0.0.2 | 0.0.2 | 0.0.2 |
Expand Down Expand Up @@ -335,3 +339,4 @@ Apache 2.0
[gitter-url]: https://gitter.im/binduwavell/generator-alfresco?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[codenvy-image]: http://beta.codenvy.com/factory/resources/codenvy-contribute.svg
[codenvy-url]: http://beta.codenvy.com/f?id=zia672875qiibfzv
[installing-node]: https://github.com/binduwavell/generator-alfresco/wiki/Supported-Platforms-Node-Versions#user-content-installing-node
2 changes: 1 addition & 1 deletion ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require('shelljs/global');
var nodeVersion = String(process.argv[2]);
var cmd;

if (nodeVersion === 'v6') {
if (nodeVersion === 'v7') {
cmd = 'npm run codecov:color';
} else {
cmd = 'npm run test:color';
Expand Down
1 change: 0 additions & 1 deletion generators/amp-add-local/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ module.exports = SubGenerator.extend({

return this.subgeneratorPrompt(this.prompts, '', function (props) {
this.props = props;
this.props.warType;
if (_.startsWith(this.props.path, path.join(constants.FOLDER_CUSTOMIZATIONS, constants.FOLDER_AMPS, path.sep))) {
this.props.warType = 'repo';
}
Expand Down
30 changes: 15 additions & 15 deletions generators/common/alfresco-module-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = function (yo) {
module.addModule = function (modOrGroupId, artifactId, ver, packaging, war, loc, path) {
debug('attempting to addModule: %s %s %s %s %s %s %s', modOrGroupId, artifactId, ver, packaging, war, loc, path);
var mod = this.moduleRegistry.findModule(modOrGroupId, artifactId, ver, packaging, war, loc, path);
// console.log("Existing module: " + JSON.stringify(mod));
debug("Existing module: " + JSON.stringify(mod));
if (!mod) {
mod = this.moduleRegistry.normalizeModule(modOrGroupId, artifactId, ver, packaging, war, loc, path);
debug('normalized result: %j', mod);
Expand All @@ -37,7 +37,7 @@ module.exports = function (yo) {

// Stuff we only need to do for source amps
if (mod.location === 'source') {
// console.log('Scheduling ops for ' + mod.artifactId);
debug('Scheduling ops for ' + mod.artifactId);
ops.push(function () { copyTemplateForModule(mod) });
ops.push(function () { renamePathElementsForModule(mod) });
ops.push(function () { addModuleToParentPom(mod) });
Expand All @@ -56,17 +56,17 @@ module.exports = function (yo) {
function copyTemplateForModule (mod) {
debug('copyTemplateForModule()');
var toPath = yo.destinationPath(mod.path);
// console.log('Copy destination: ' + toPath);
debug('Copy destination: ' + toPath);
if (!yo.fs.exists(toPath)) {
var prefix = yo.sdk.sdkVersionPrefix.call(yo);
yo.config.get('artifactId');
var fromPath = yo.destinationPath(constants.FOLDER_SOURCE_TEMPLATES + '/' + prefix + mod.war + '-' + mod.packaging);
yo.out.info('Copying template for ' + mod.artifactId + ' module ' + fromPath + ' to ' + toPath);
if (memFsUtils.existsInMemory(yo.fs, fromPath)) {
// console.log('IN-MEMORY COPY: ' + fromPath + ' to: ' + toPath);
debug('IN-MEMORY COPY: ' + fromPath + ' to: ' + toPath);
memFsUtils.inMemoryCopy(yo.fs, fromPath, toPath);
} else {
// console.log('PHYSICAL COPY: ' + fromPath + '/** to: ' + toPath);
debug('PHYSICAL COPY: ' + fromPath + '/** to: ' + toPath);
yo.fs.copy(path.join(fromPath, '/**'), toPath);
}
} else {
Expand Down Expand Up @@ -96,12 +96,12 @@ module.exports = function (yo) {
mod.artifactId
);
yo.out.info('Renaming path elements from ' + fromPath + ' to ' + toPath);
// console.log("MOVING FROM: " + fromPath + " to: " + toPath);
debug("MOVING FROM: " + fromPath + " to: " + toPath);
if (memFsUtils.existsInMemory(yo.fs, fromPath)) {
// console.log('IN-MEMORY MOVE: ' + fromPath + ' to: ' + toPath);
debug('IN-MEMORY MOVE: ' + fromPath + ' to: ' + toPath);
memFsUtils.inMemoryMove(yo.fs, fromPath, toPath);
} else {
// console.log('PHYSICAL MOVE: ' + fromPath + '/** to: ' + toPath);
debug('PHYSICAL MOVE: ' + fromPath + '/** to: ' + toPath);
yo.fs.move(fromPath + '/**', toPath);
}
}
Expand Down Expand Up @@ -238,9 +238,9 @@ module.exports = function (yo) {
var parentArtifactId = (parentArtifactIdEl ? parentArtifactIdEl.textContent : yo.projectArtifactId || yo.config.get(constants.PROP_PROJECT_ARTIFACT_ID));
var parentVersion = (parentVersionEl ? parentVersionEl.textContent : yo.projectVersion || yo.config.get(constants.PROJECT_VERSION));

// console.log("POM EXISTS: " + projectPomPath + " [" + yo.fs.exists(projectPomPath) + "]");
debug("POM EXISTS: " + projectPomPath + " [" + yo.fs.exists(projectPomPath) + "]");
var projectPom = yo.fs.read(projectPomPath);
// console.log("POM CONTENTS: " + projectPom);
debug("POM CONTENTS: " + projectPom);
var pom = require('generator-alfresco-common').maven_pom(projectPom);
// Unless we are in the customizations folder we can use provided values with
// inheritance magic for project.blah references. In the customizations folder
Expand Down Expand Up @@ -303,7 +303,7 @@ module.exports = function (yo) {
var configuration = domutils.getOrCreateChild(plugin, 'pom', 'configuration');
domutils.getOrCreateChild(configuration, 'pom', 'overlays');
pom.addOverlay(mod.groupId, mod.artifactId, mod.packaging);
// console.log(pom.getPOMString());
debug(pom.getPOMString());
yo.fs.write(wrapperPomPath, pom.getPOMString());
debug('addModuleToWarWrapper() finished');
}
Expand Down Expand Up @@ -333,12 +333,12 @@ module.exports = function (yo) {
yo.out.warn('Deleting source module: ' + mod.path);
var absPath = yo.destinationPath(mod.path);
// if we have files on disk already this will get them
// console.log("DELETING EXISTING FILES FROM: " + absPath);
debug("DELETING EXISTING FILES FROM: " + absPath);
yo.fs.delete(absPath);
// if we have files in mem-fs, this should get those
yo.fs.store.each(function (file, idx) {
if (file.path.indexOf(absPath) === 0) {
// console.log("DELETING: " + file.path);
debug("DELETING: " + file.path);
yo.fs.delete(file.path);
}
});
Expand Down Expand Up @@ -380,12 +380,12 @@ module.exports = function (yo) {
// now if we find executions for this module remove them too
var mft = domutils.getFirstNodeMatchingXPath('pom:execution[pom:id="functional-tests-' + mod.artifactId + '"]', pluginExs);
if (mft) {
console.log('Removing functional-tests-' + mod.artifactId);
debug('Removing functional-tests-' + mod.artifactId);
domutils.removeParentsChild(pluginExs, mft);
}
var mvt = domutils.getFirstNodeMatchingXPath('pom:execution[pom:id="verify-tests-' + mod.artifactId + '"]', pluginExs);
if (mvt) {
console.log('Removing verify-tests-' + mod.artifactId);
debug('Removing verify-tests-' + mod.artifactId);
domutils.removeParentsChild(pluginExs, mvt);
}
yo.fs.write(runnerPomPath, domutils.prettyPrint(pomDoc));
Expand Down
48 changes: 23 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-alfresco",
"version": "0.9.1",
"version": "0.9.5",
"description": "Yeoman generator",
"license": "Apache-2.0",
"main": "app/index.js",
Expand All @@ -27,46 +27,44 @@
"adm-zip": "0.4.7",
"ascii-table": "0.0.9",
"chalk": "1.1.3",
"debug": "2.3.2",
"generator-alfresco-common": "0.9.2",
"lodash": "4.16.6",
"debug": "2.6.3",
"generator-alfresco-common": "0.9.5",
"lodash": "4.17.4",
"pinkie-promise": "2.0.1",
"rmdir": "1.2.0",
"run-async": "2.2.0",
"run-async": "2.3.0",
"semver": "5.3.0",
"yeoman-generator": "0.24.1",
"yosay": "1.2.1"
"yosay": "2.0.0"
},
"devDependencies": {
"codecov": "1.0.1",
"coveralls": "2.11.15",
"eslint": "3.10.0",
"eslint-config-standard": "6.2.1",
"eslint-plugin-promise": "3.3.2",
"eslint-plugin-standard": "2.0.1",
"fixme": "0.4.2",
"ghooks": "1.3.2",
"codecov": "2.1.0",
"coveralls": "2.12.0",
"eslint": "3.18.0",
"eslint-config-standard": "7.1.0",
"eslint-plugin-promise": "3.5.0",
"eslint-plugin-standard": "2.1.1",
"fixme": "0.4.3",
"husky": "0.13.3",
"istanbul": "0.4.5",
"mem-fs": "1.1.3",
"mem-fs-editor": "2.3.0",
"mocha": "3.1.2",
"mem-fs-editor": "3.0.2",
"mocha": "3.2.0",
"mocha-eslint": "3.0.1",
"mocha-lcov-reporter": "1.2.0",
"npm-check-updates": "2.8.6",
"shelljs": "0.5.3",
"yeoman-assert": "2.2.1",
"yeoman-test": "1.5.1"
"mocha-lcov-reporter": "1.3.0",
"npm-check-updates": "2.10.4",
"shelljs": "0.7.7",
"yeoman-assert": "3.0.0",
"yeoman-test": "1.6.0"
},
"config": {
"ghooks": {
"pre-commit": "eslint generators test"
}
},
"scripts": {
"eslint": "eslint generators test || echo DONE",
"fixme": "node -e \"require('fixme')()\"",
"ncu": "ncu",
"ncu:upgrade": "ncu -u -x shelljs",
"ncu:upgrade": "ncu -u -x run-async -x yeoman-generator",
"precommit": "eslint generators test",
"test": "mocha --reporter spec test",
"test:color": "mocha --colors --reporter spec test",
"test:one": "mocha --reporter spec",
Expand Down
14 changes: 13 additions & 1 deletion test/test-alfresco-module-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ describe('generator-alfresco:alfresco-module-manager', function () {
yomock.fs.write(yomock.wrapperPomPath, '');
yomock.templatePomPath = yomock.destinationPath(constants.FOLDER_SOURCE_TEMPLATES + '/repo-packaging/pom.xml');
yomock.fs.write(yomock.templatePomPath, '');
yomock.modulePropertiesPath = yomock.destinationPath(constants.FOLDER_SOURCE_TEMPLATES + '/repo-packaging/src/main/amp/config/alfresco/module/repo-amp/module.properties');
yomock.fs.write(yomock.modulePropertiesPath, '');
yomock.projectPomPath = yomock.destinationPath('path/pom.xml');
yomock.moduleManager.addModule('groupId', 'artifactId', 'version', 'packaging', 'repo', 'source', 'path');
yomock.moduleManager.save();
Expand Down Expand Up @@ -83,7 +85,13 @@ describe('generator-alfresco:alfresco-module-manager', function () {
assert.equal(packagingNode.textContent, 'packaging');
var parentNode = pom.getOrCreateTopLevelElement('pom', 'parent');
assert.ok(parentNode);
assert.equal(parentNode.toString(), '<parent>\n <groupId>com.example</groupId>\n <artifactId>placeholder</artifactId>\n <version>0.0.1-SNAPSHOT</version>\n </parent>');
assert.equal(parentNode.toString(), [
'<parent xmlns="http://maven.apache.org/POM/4.0.0">',
' <groupId>com.example</groupId>',
' <artifactId>placeholder</artifactId>',
' <version>0.0.1-SNAPSHOT</version>',
' </parent>',
].join('\n'));
});

it('adds a module to the top pom', function () {
Expand Down Expand Up @@ -139,6 +147,10 @@ describe('generator-alfresco:alfresco-module-manager', function () {
yomock.fs.write(yomock.wrapperPomPath, '');
yomock.targetPomPath = yomock.destinationPath('path/pom.xml');
yomock.fs.write(yomock.targetPomPath, '');
yomock.templatePomPath = yomock.destinationPath(constants.FOLDER_SOURCE_TEMPLATES + '/war-packaging/pom.xml');
yomock.fs.write(yomock.templatePomPath, '');
yomock.modulePropertiesPath = yomock.destinationPath(constants.FOLDER_SOURCE_TEMPLATES + '/war-packaging/src/main/amp/config/alfresco/module/repo-amp/module.properties');
yomock.fs.write(yomock.modulePropertiesPath, '');
yomock.moduleManager.addModule('groupId', 'artifactId', 'version', 'packaging', 'war', 'source', 'path');
yomock.moduleManager.removeModule('groupId', 'artifactId', 'version', 'packaging', 'war', 'source', 'path');
yomock.moduleManager.save();
Expand Down

0 comments on commit d4d8285

Please sign in to comment.