Skip to content

Commit

Permalink
Switch to lerna
Browse files Browse the repository at this point in the history
  • Loading branch information
guimard committed Sep 29, 2020
1 parent a7f59d9 commit 557ee4d
Show file tree
Hide file tree
Showing 51 changed files with 1,253 additions and 184 deletions.
51 changes: 10 additions & 41 deletions Gruntfile.coffee
Expand Up @@ -2,18 +2,12 @@ fs= require('fs')
packages = fs.readdirSync('src/packages')
np = "#{__dirname}/packages"
process.env.NODE_PATH = if process.env.NODE_PATH? then ":#{np}" else np
console.error('path',process.env.NODE_PATH)
require("module").Module._initPaths()

module.exports = (grunt) ->
grunt.initConfig
coffee:
main:
expand: true
flatten: false
cwd: 'src/lib'
src: ['**/*.coffee']
dest: 'lib/'
ext: '.js'
packages:
expand: true
flatten: false
Expand All @@ -22,11 +16,18 @@ module.exports = (grunt) ->
dest: 'packages/'
ext: '.js'
copy:
package:
files: [
expand: true
cwd: 'src/packages',
src: ['*/package.json', '*/*.md']
dest: 'packages/'
]
test:
files: [
expand: true
cwd: 'src/packages',
src: ['*/test/*.json']
src: ['*/test/**/*.json', '*/test/*.ini', '**/.exists' ]
dest: 'packages/'
]
mochaTest:
Expand All @@ -41,37 +42,5 @@ module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-mocha-test'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-copy'

# Build package.json files
main = grunt.file.readJSON "package.json"
grunt.registerTask 'conf', 'Build other files', () ->
depsError = 0
for p,v of main.dependencies
if p in packages and main.dependencies[p] != main.version
main.dependencies[p] = main.version
depsError++
if depsError
grunt.file.write 'package.json', JSON.stringify main, null, 2
packages.forEach (pack) ->
j = grunt.file.read "./src/packages/#{pack}/package.json"
j = j.replace /\$version/g, main.version
j = JSON.parse j
for k,v of main
j[k] = v unless j[k]? or k.match /dependencies/i
j.name = pack
grunt.file.write "packages/#{pack}/package.json", JSON.stringify j, null, 2
grunt.log.ok "#{packages.length} package.json files written"
packages.forEach (pack) ->
readme = ''
try
fs.accessSync "src/packages/#{pack}/README.md"
readme = grunt.file.read "src/packages/#{pack}/README.md"
catch err
readme = grunt.file.read "_README.tmpl"
readme = readme.replace /\$package/g, pack
grunt.file.write "packages/#{pack}/README.md", readme
grunt.log.ok "#{packages.length} README.md files written"
packages.forEach (pack) ->
# TODO: copy test files
grunt.registerTask 'default', ['clean', 'coffee', 'conf', 'copy']
grunt.registerTask 'default', ['clean', 'coffee', 'copy']
grunt.registerTask 'test', 'mochaTest'
6 changes: 0 additions & 6 deletions index.js

This file was deleted.

6 changes: 6 additions & 0 deletions lerna.json
@@ -0,0 +1,6 @@
{
"packages": [
"packages/*"
],
"version": "0.5.4"
}
59 changes: 11 additions & 48 deletions package.json
@@ -1,26 +1,19 @@
{
"name": "lemonldap-ng-handler",
"version": "0.5.3",
"description": "LemonLDAP::NG handler for Node.js",
"main": "lib/index",
"license": "GPL-2.0-or-later",
"scripts": {
"build": "grunt",
"pretest": "./scripts/pretest",
"test": "grunt test"
},
"homepage": "https://lemonldap-ng.org",
"maintainers": [
{
"name": "Xavier Guimard",
"email": "yadd@debian.org"
}
],
"homepage": "https://lemonldap-ng.org",
"directories": {
"lib": "lib",
"src": "src"
},
"files": [
"package.json",
"lib",
"CHANGELOG.md",
"LICENSE",
"README.md"
],
"llng-compat": "2.0.9",
"bugs": {
"url": "https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues"
},
Expand All @@ -38,48 +31,18 @@
"authors": [
"Xavier Guimard <yadd@debian.org>"
],
"license": "GPL-2.0-or-later",
"devDependencies": {
"aes-js": "^3.1.2",
"file-cache-simple": "^1.0.0",
"fs-jetpack": "^3.1.0",
"grunt": "*",
"grunt-contrib-clean": "*",
"grunt-contrib-coffee": "*",
"grunt-contrib-copy": "^1.0.0",
"grunt-mocha-test": "^0.13.3",
"inireader": "*",
"lerna": "^3.22.1",
"mocha": "^8.1.3",
"sha.js": "*"
},
"llng-compat": "2.0.5",
"scripts": {
"build": "grunt",
"pretest": "./scripts/pretest",
"test": "grunt test"
},
"dependencies": {
"extend": "*",
"inireader": "^1.2.1",
"lemonldap-ng-conf": "0.5.3",
"lemonldap-ng-logger": "0.5.3",
"lemonldap-ng-session": "0.5.3",
"node-fastcgi": "^1.3.3",
"normalize-url": "^5.1.0"
},
"optionalDependencies": {
"iconv": "^2.3.4",
"ipaddr.js": "^1.9.1",
"lemonldap-ng-conf-dbi": "*",
"lemonldap-ng-conf-ldap": "*",
"lemonldap-ng-conf-mongodb": "*",
"lemonldap-ng-conf-yaml": "*",
"lemonldap-ng-logger-syslog": "*",
"lemonldap-ng-session-dbi": "*",
"lemonldap-ng-session-ldap": "*",
"lemonldap-ng-session-mysql": "*",
"lemonldap-ng-session-pg": "*",
"lemonldap-ng-session-redis": "*",
"lemonldap-ng-session-sqlite": "*",
"perl-dbi": "*"
}
}
}
25 changes: 25 additions & 0 deletions src/packages/lemonldap-ng-conf-dbi/README.md
@@ -0,0 +1,25 @@
# lemonldap-ng-conf-dbi

lemonldap-ng-conf-dbi is a component of [lemonldap-ng-handler](https://www.npmjs.com/package/lemonldap-ng-handler)

## BUG REPORT AND OTHER ISSUES

Use OW2 system to report bug or ask for features:
[LLNG OW2 GitLab](https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues)

## COPYRIGHT AND LICENSE

Copyright (C) 2016-2019 by [Xavier Guimard](mailto:x.guimard@free.fr)

This library is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
48 changes: 47 additions & 1 deletion src/packages/lemonldap-ng-conf-dbi/package.json
@@ -1,5 +1,51 @@
{
"dependencies": {
"perl-dbi": "$version"
"perl-dbi": "0.5.4"
},
"name": "lemonldap-ng-conf-dbi",
"version": "0.5.4",
"description": "LemonLDAP::NG handler for Node.js",
"main": "lib/index",
"maintainers": [
{
"name": "Xavier Guimard",
"email": "yadd@debian.org"
}
],
"homepage": "https://lemonldap-ng.org",
"directories": {
"lib": "lib",
"src": "src"
},
"files": [
"package.json",
"lib",
"CHANGELOG.md",
"LICENSE",
"README.md"
],
"bugs": {
"url": "https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/LemonLDAPNG/node-lemonldap-ng-handler.git"
},
"keywords": [
"Lemonldap::NG",
"SSO",
"SAML",
"OpenID-Connect",
"SSOaaS"
],
"authors": [
"Xavier Guimard <yadd@debian.org>"
],
"license": "GPL-2.0-or-later",
"llng-compat": "2.0.5",
"scripts": {
"build": "grunt",
"pretest": "./scripts/pretest",
"test": "grunt test"
}
}
25 changes: 25 additions & 0 deletions src/packages/lemonldap-ng-conf-ldap/README.md
@@ -0,0 +1,25 @@
# lemonldap-ng-conf-ldap

lemonldap-ng-conf-ldap is a component of [lemonldap-ng-handler](https://www.npmjs.com/package/lemonldap-ng-handler)

## BUG REPORT AND OTHER ISSUES

Use OW2 system to report bug or ask for features:
[LLNG OW2 GitLab](https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues)

## COPYRIGHT AND LICENSE

Copyright (C) 2016-2019 by [Xavier Guimard](mailto:x.guimard@free.fr)

This library is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
46 changes: 46 additions & 0 deletions src/packages/lemonldap-ng-conf-ldap/package.json
@@ -1,5 +1,51 @@
{
"dependencies": {
"ldapjs": "*"
},
"name": "lemonldap-ng-conf-ldap",
"version": "0.5.4",
"description": "LemonLDAP::NG handler for Node.js",
"main": "lib/index",
"maintainers": [
{
"name": "Xavier Guimard",
"email": "yadd@debian.org"
}
],
"homepage": "https://lemonldap-ng.org",
"directories": {
"lib": "lib",
"src": "src"
},
"files": [
"package.json",
"lib",
"CHANGELOG.md",
"LICENSE",
"README.md"
],
"bugs": {
"url": "https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/LemonLDAPNG/node-lemonldap-ng-handler.git"
},
"keywords": [
"Lemonldap::NG",
"SSO",
"SAML",
"OpenID-Connect",
"SSOaaS"
],
"authors": [
"Xavier Guimard <yadd@debian.org>"
],
"license": "GPL-2.0-or-later",
"llng-compat": "2.0.5",
"scripts": {
"build": "grunt",
"pretest": "./scripts/pretest",
"test": "grunt test"
}
}
25 changes: 25 additions & 0 deletions src/packages/lemonldap-ng-conf-mongodb/README.md
@@ -0,0 +1,25 @@
# lemonldap-ng-conf-mongodb

lemonldap-ng-conf-mongodb is a component of [lemonldap-ng-handler](https://www.npmjs.com/package/lemonldap-ng-handler)

## BUG REPORT AND OTHER ISSUES

Use OW2 system to report bug or ask for features:
[LLNG OW2 GitLab](https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues)

## COPYRIGHT AND LICENSE

Copyright (C) 2016-2019 by [Xavier Guimard](mailto:x.guimard@free.fr)

This library is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.

0 comments on commit 557ee4d

Please sign in to comment.