Hello community, here is the log from the commit of package nodejs-realize-package-specifier for openSUSE:Factory checked in at 2015-07-02 22:43:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/nodejs-realize-package-specifier (Old) and /work/SRC/openSUSE:Factory/.nodejs-realize-package-specifier.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "nodejs-realize-package-specifier" Changes: -------- --- /work/SRC/openSUSE:Factory/nodejs-realize-package-specifier/nodejs-realize-package-specifier.changes 2015-04-27 13:02:23.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.nodejs-realize-package-specifier.new/nodejs-realize-package-specifier.changes 2015-07-02 22:43:11.000000000 +0200 @@ -1,0 +2,10 @@ +Sat Jun 27 06:56:36 UTC 2015 - i@marguerite.su + +- update version 3.0.1 + +------------------------------------------------------------------- +Fri Apr 24 12:45:32 UTC 2015 - hvogel@suse.com + +- Update to version 3.0.0 + +------------------------------------------------------------------- Old: ---- realize-package-specifier-1.2.0.tgz New: ---- realize-package-specifier-3.0.1.tgz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nodejs-realize-package-specifier.spec ++++++ --- /var/tmp/diff_new_pack.v6OBlf/_old 2015-07-02 22:43:12.000000000 +0200 +++ /var/tmp/diff_new_pack.v6OBlf/_new 2015-07-02 22:43:12.000000000 +0200 @@ -19,7 +19,7 @@ %define base_name realize-package-specifier Name: nodejs-%{base_name} -Version: 1.2.0 +Version: 3.0.1 Release: 0 Summary: Parse a package specifier, peeking at the disk to differentiate between local License: ISC @@ -45,12 +45,9 @@ cp -pr package.json index.js \ %{buildroot}%{nodejs_modulesdir}/%{base_name}/ -%clean -rm -rf $RPM_BUILD_ROOT - %files %defattr(-,root,root,-) -%doc README.md +%doc LICENSE README.md %{nodejs_modulesdir}/%{base_name} %changelog ++++++ realize-package-specifier-1.2.0.tgz -> realize-package-specifier-3.0.1.tgz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/LICENSE new/package/LICENSE --- old/package/LICENSE 1970-01-01 01:00:00.000000000 +0100 +++ new/package/LICENSE 2015-05-21 20:42:12.000000000 +0200 @@ -0,0 +1,13 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/README.md new/package/README.md --- old/package/README.md 2014-09-27 07:53:18.000000000 +0200 +++ new/package/README.md 2015-05-21 20:37:37.000000000 +0200 @@ -13,6 +13,8 @@ }) ``` +## Using + * realizePackageSpecifier(*spec*, [*where*,] *callback*) Parses *spec* using `npm-package-arg` and then uses stat to check to see if @@ -34,14 +36,17 @@ For all `local` and `directory` type results spec will contain the full path of the local package. -## Result Objects +## Result Object The full definition of the result object is: * `name` - If known, the `name` field expected in the resulting pkg. * `type` - One of the following strings: * `git` - A git repo - * `github` - A github shorthand, like `user/project` + * `hosted` - A hosted project, from github, bitbucket or gitlab. Originally + either a full url pointing at one of these services or a shorthand like + `user/project` or `github:user/project` for github or `bitbucket:user/project` + for bitbucket. * `tag` - A tagged version, like `"foo@latest"` * `version` - A specific version number, like `"foo@1.2.3"` * `range` - A version range, like `"foo@2.x"` @@ -49,6 +54,12 @@ * `directory` - A local package directory * `remote` - An http url (presumably to a tgz) * `spec` - The "thing". URL, the range, git repo, etc. +* `hosted` - If type=hosted this will be an object with the following keys: + * `type` - github, bitbucket or gitlab + * `ssh` - The ssh path for this git repo + * `sshurl` - The ssh URL for this git repo + * `https` - The HTTPS URL for this git repo + * `directUrl` - The URL for the package.json in this git repo * `raw` - The original un-modified string that was provided. * `rawSpec` - The part after the `name@...`, as it was originally provided. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/index.js new/package/index.js --- old/package/index.js 2014-10-02 08:12:10.000000000 +0200 +++ new/package/index.js 2015-05-21 20:37:37.000000000 +0200 @@ -14,6 +14,7 @@ catch (e) { return cb(e) } + if ((dep.type == "range" || dep.type == "version") && dep.name != dep.raw) return cb(null, dep) var specpath = dep.type == "local" ? path.resolve(where, dep.spec) : path.resolve(dep.rawSpec? dep.rawSpec: dep.name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/package.json new/package/package.json --- old/package/package.json 2014-10-02 10:26:48.000000000 +0200 +++ new/package/package.json 2015-05-21 20:42:55.000000000 +0200 @@ -1,6 +1,6 @@ { "name": "realize-package-specifier", - "version": "1.2.0", + "version": "3.0.1", "description": "Like npm-package-arg, but more so, producing full file paths and differentiating local tar and directory sources.", "main": "index.js", "scripts": { @@ -15,7 +15,7 @@ "homepage": "https://github.com/npm/realize-package-specifier", "dependencies": { "dezalgo": "^1.0.1", - "npm-package-arg": "^2.1.3" + "npm-package-arg": "^4.0.0" }, "devDependencies": { "require-inject": "^1.1.0", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/basic.js new/package/test/basic.js --- old/package/test/basic.js 2014-10-02 03:42:43.000000000 +0200 +++ new/package/test/basic.js 2015-05-21 20:37:37.000000000 +0200 @@ -4,15 +4,17 @@ var path = require("path") var re = { - tarball: /[\/\\]a.tar.gz$/, - packagedir: /[\/\\]b$/, - packagejson: /[\/\\]b[\/\\]package.json$/, - nonpackagedir: /[\/\\]c$/, - nopackagejson: /[\/\\]c[\/\\]package.json$/, - remotename: /[\/\\]d$/, - packagedirlikegithub: /[\/\\]e[\/\\]1$/, - packagejsonlikegithub: /[\/\\]e[\/\\]1[\/\\]package.json$/, - github: /[\/\\]e[\/\\]2$/ + tarball: /[/\\]a.tar.gz$/, + packagedir: /[/\\]b$/, + packagejson: /[/\\]b[/\\]package.json$/, + nonpackagedir: /[/\\]c$/, + nopackagejson: /[/\\]c[/\\]package.json$/, + remotename: /[/\\]d$/, + packagedirlikegithub: /[/\\]e[/\\]1$/, + packagejsonlikegithub: /[/\\]e[/\\]1[/\\]package.json$/, + github: /[/\\]e[/\\]2$/, + localrangefile: /[/\\]1[.]0[.]0$/, + localverfile: /[/\\]1$/ } var rps = requireInject("../index", { @@ -45,6 +47,12 @@ else if (re.github.test(path)) { callback(new Error("EFILENOTFOUND")) } + else if (re.localverfile.test(path)) { + callback(null,{isDirectory:function(){ return false }}) + } + else if (re.localrangefile.test(path)) { + callback(null,{isDirectory:function(){ return false }}) + } else { throw new Error("Unknown stat fixture path: "+path) } @@ -53,7 +61,7 @@ }) test("realize-package-specifier", function (t) { - t.plan(10) + t.plan(13) rps("a.tar.gz", function (err, result) { t.is(result.type, "local", "local tarball") }) @@ -82,11 +90,18 @@ t.is(result.type, "directory", "local package directory") }) rps("e/2", function (err, result) { - t.is(result.type, "github", "github package dependency") + t.is(result.type, "hosted", "hosted package dependency") + t.is(result.hosted.type, "github", "github package dependency") + }) + rps("1", function (err, result) { + t.is(result.type, "local", "range like local file is still a local file") + }) + rps("1.0.0", function (err, result) { + t.is(result.type, "local", "version like local file is still a local file") }) }) test("named realize-package-specifier", function (t) { - t.plan(10) + t.plan(13) rps("a@a.tar.gz", function (err, result) { t.is(result.type, "local", "named local tarball") @@ -116,6 +131,13 @@ t.is(result.type, "directory", "local package directory") }) rps("e@e/2", function (err, result) { - t.is(result.type, "github", "github package dependency") + t.is(result.type, "hosted", "hosted package dependency") + t.is(result.hosted.type, "github", "github package dependency") + }) + rps("e@1", function (err, result) { + t.is(result.type, "range", "range like specifier is never a local file") + }) + rps("e@1.0.0", function (err, result) { + t.is(result.type, "version", "version like specifier is never a local file") }) }) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/npa-basic.js new/package/test/npa-basic.js --- old/package/test/npa-basic.js 2014-10-01 03:24:48.000000000 +0200 +++ new/package/test/npa-basic.js 2015-05-21 20:37:37.000000000 +0200 @@ -64,11 +64,11 @@ rawSpec: "=v1.2.3" }, - "git+ssh://git@github.com/user/foo#1.2.3": { + "git+ssh://git@notgithub.com/user/foo#1.2.3": { name: null, type: "git", - spec: "ssh://git@github.com/user/foo#1.2.3", - raw: "git+ssh://git@github.com/user/foo#1.2.3" + spec: "ssh://git@notgithub.com/user/foo#1.2.3", + raw: "git+ssh://git@notgithub.com/user/foo#1.2.3" }, "git+file://path/to/repo#1.2.3": { @@ -78,19 +78,19 @@ raw: "git+file://path/to/repo#1.2.3" }, - "git://github.com/user/foo": { + "git://notgithub.com/user/foo": { name: null, type: "git", - spec: "git://github.com/user/foo", - raw: "git://github.com/user/foo" + spec: "git://notgithub.com/user/foo", + raw: "git://notgithub.com/user/foo" }, - "@foo/bar@git+ssh://github.com/user/foo": { + "@foo/bar@git+ssh://notgithub.com/user/foo": { name: "@foo/bar", scope: "@foo", - spec: "ssh://github.com/user/foo", - rawSpec: "git+ssh://github.com/user/foo", - raw: "@foo/bar@git+ssh://github.com/user/foo" + spec: "ssh://notgithub.com/user/foo", + rawSpec: "git+ssh://notgithub.com/user/foo", + raw: "@foo/bar@git+ssh://notgithub.com/user/foo" }, "/path/to/foo": { @@ -99,28 +99,18 @@ spec: "/path/to/foo", raw: "/path/to/foo" }, - "file:path/to/foo": { name: null, type: "local", spec: path.resolve(__dirname,"..","path/to/foo"), raw: "file:path/to/foo" }, - - "file:~/path/to/foo": { - name: null, - type: "local", - spec: path.resolve(__dirname,"..","~/path/to/foo"), - raw: "file:~/path/to/foo" - }, - "file:../path/to/foo": { name: null, type: "local", spec: path.resolve(__dirname,"..","../path/to/foo"), raw: "file:../path/to/foo" }, - "file:///path/to/foo": { name: null, type: "local", @@ -135,41 +125,6 @@ raw: "https://server.com/foo.tgz" }, - "user/foo-js": { - name: null, - type: "github", - spec: "user/foo-js", - raw: "user/foo-js" - }, - - "user/foo-js#bar/baz": { - name: null, - type: "github", - spec: "user/foo-js#bar/baz", - raw: "user/foo-js#bar/baz" - }, - - "user..blerg--/..foo-js# . . . . . some . tags / / /": { - name: null, - type: "github", - spec: "user..blerg--/..foo-js# . . . . . some . tags / / /", - raw: "user..blerg--/..foo-js# . . . . . some . tags / / /" - }, - - "user/foo-js#bar/baz/bin": { - name: null, - type: "github", - spec: "user/foo-js#bar/baz/bin", - raw: "user/foo-js#bar/baz/bin" - }, - - "foo@user/foo-js": { - name: "foo", - type: "github", - spec: "user/foo-js", - raw: "foo@user/foo-js" - }, - "foo@latest": { name: "foo", type: "tag", @@ -189,9 +144,9 @@ Object.keys(tests).forEach(function (arg) { rps(arg, path.resolve(__dirname,'..'), function(err, res) { - t.notOk(err, "No error") - t.type(res, "Result") - t.has(res, tests[arg]) + t.notOk(err, arg + " no error") + t.type(res, "Result", arg + " got right result time") + t.has(res, tests[arg], arg + " result has correct values") }) }) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/npa-bitbucket.js new/package/test/npa-bitbucket.js --- old/package/test/npa-bitbucket.js 1970-01-01 01:00:00.000000000 +0100 +++ new/package/test/npa-bitbucket.js 2015-05-21 20:37:37.000000000 +0200 @@ -0,0 +1,86 @@ +var test = require("tap").test; +var rps = require("../index.js") +var path = require("path") + +test("npa-bitbucket", function (t) { + t.setMaxListeners(999) + + var tests = { + "bitbucket:user/foo-js": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "bitbucket:user/foo-js", + raw: "bitbucket:user/foo-js" + }, + + "bitbucket:user/foo-js#bar/baz": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "bitbucket:user/foo-js#bar/baz", + raw: "bitbucket:user/foo-js#bar/baz" + }, + + "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /", + raw: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /" + }, + + "bitbucket:user/foo-js#bar/baz/bin": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "bitbucket:user/foo-js#bar/baz/bin", + raw: "bitbucket:user/foo-js#bar/baz/bin" + }, + + "foo@bitbucket:user/foo-js": { + name: "foo", + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "bitbucket:user/foo-js", + raw: "foo@bitbucket:user/foo-js" + }, + + "git+ssh://git@bitbucket.org/user/foo#1.2.3": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+ssh://git@bitbucket.org/user/foo.git#1.2.3", + raw: "git+ssh://git@bitbucket.org/user/foo#1.2.3" + }, + + "https://bitbucket.org/user/foo.git": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "https://bitbucket.org/user/foo.git", + raw: "https://bitbucket.org/user/foo.git" + }, + + "@foo/bar@git+ssh://bitbucket.org/user/foo": { + name: "@foo/bar", + scope: "@foo", + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+ssh://git@bitbucket.org/user/foo.git", + rawSpec: "git+ssh://bitbucket.org/user/foo", + raw: "@foo/bar@git+ssh://bitbucket.org/user/foo" + } + } + + t.plan( Object.keys(tests).length * 3 ) + + Object.keys(tests).forEach(function (arg) { + rps(arg, path.resolve(__dirname,'..'), function(err, res) { + t.notOk(err, "No error") + t.type(res, "Result") + t.has(res, tests[arg]) + }) + }) + +}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/npa-github.js new/package/test/npa-github.js --- old/package/test/npa-github.js 1970-01-01 01:00:00.000000000 +0100 +++ new/package/test/npa-github.js 2015-05-21 20:37:37.000000000 +0200 @@ -0,0 +1,110 @@ +var test = require("tap").test; +var rps = require("../index.js") +var path = require("path") + +test("npa-github", function (t) { + t.setMaxListeners(999) + + var tests = { + "user/foo-js": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "github:user/foo-js", + raw: "user/foo-js" + }, + + "user/foo-js#bar/baz": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "github:user/foo-js#bar/baz", + raw: "user/foo-js#bar/baz" + }, + + "user..blerg--/..foo-js# . . . . . some . tags / / /": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "github:user..blerg--/..foo-js# . . . . . some . tags / / /", + raw: "user..blerg--/..foo-js# . . . . . some . tags / / /" + }, + + "user/foo-js#bar/baz/bin": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "github:user/foo-js#bar/baz/bin", + raw: "user/foo-js#bar/baz/bin" + }, + + "foo@user/foo-js": { + name: "foo", + type: "hosted", + hosted: { type: "github" }, + spec: "github:user/foo-js", + raw: "foo@user/foo-js" + }, + + "github:user/foo-js": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "github:user/foo-js", + raw: "github:user/foo-js" + }, + + "git+ssh://git@github.com/user/foo#1.2.3": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "git+ssh://git@github.com/user/foo.git#1.2.3", + raw: "git+ssh://git@github.com/user/foo#1.2.3" + }, + + "git://github.com/user/foo": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "git://github.com/user/foo.git", + raw: "git://github.com/user/foo" + }, + + "https://github.com/user/foo.git": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "https://github.com/user/foo.git", + raw: "https://github.com/user/foo.git" + }, + + "@foo/bar@git+ssh://github.com/user/foo": { + name: "@foo/bar", + scope: "@foo", + type: "hosted", + hosted: { type: "github" }, + spec: "git+ssh://git@github.com/user/foo.git", + rawSpec: "git+ssh://github.com/user/foo", + raw: "@foo/bar@git+ssh://github.com/user/foo" + }, + + "foo@bar/foo": { + name: "foo", + type: "hosted", + hosted: { type: "github" }, + spec: "github:bar/foo", + raw: "foo@bar/foo" + } + } + + t.plan( Object.keys(tests).length * 3 ) + + Object.keys(tests).forEach(function (arg) { + rps(arg, path.resolve(__dirname,'..'), function(err, res) { + t.notOk(err, "No error") + t.type(res, "Result") + t.has(res, tests[arg]) + }) + }) + +}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/npa-gitlab.js new/package/test/npa-gitlab.js --- old/package/test/npa-gitlab.js 1970-01-01 01:00:00.000000000 +0100 +++ new/package/test/npa-gitlab.js 2015-05-21 20:37:37.000000000 +0200 @@ -0,0 +1,86 @@ +var test = require("tap").test; +var rps = require("../index.js") +var path = require("path") + +test("npa-gitlab", function (t) { + t.setMaxListeners(999) + + var tests = { + "gitlab:user/foo-js": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "gitlab:user/foo-js", + raw: "gitlab:user/foo-js" + }, + + "gitlab:user/foo-js#bar/baz": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "gitlab:user/foo-js#bar/baz", + raw: "gitlab:user/foo-js#bar/baz" + }, + + "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /", + raw: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /" + }, + + "gitlab:user/foo-js#bar/baz/bin": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "gitlab:user/foo-js#bar/baz/bin", + raw: "gitlab:user/foo-js#bar/baz/bin" + }, + + "foo@gitlab:user/foo-js": { + name: "foo", + type: "hosted", + hosted: { type: "gitlab" }, + spec: "gitlab:user/foo-js", + raw: "foo@gitlab:user/foo-js" + }, + + "git+ssh://git@gitlab.com/user/foo#1.2.3": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "git+ssh://git@gitlab.com/user/foo.git#1.2.3", + raw: "git+ssh://git@gitlab.com/user/foo#1.2.3" + }, + + "https://gitlab.com/user/foo.git": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "https://gitlab.com/user/foo.git", + raw: "https://gitlab.com/user/foo.git" + }, + + "@foo/bar@git+ssh://gitlab.com/user/foo": { + name: "@foo/bar", + scope: "@foo", + type: "hosted", + hosted: { type: "gitlab" }, + spec: "git+ssh://git@gitlab.com/user/foo.git", + rawSpec: "git+ssh://gitlab.com/user/foo", + raw: "@foo/bar@git+ssh://gitlab.com/user/foo" + } + } + + t.plan( Object.keys(tests).length * 3 ) + + Object.keys(tests).forEach(function (arg) { + rps(arg, path.resolve(__dirname,'..'), function(err, res) { + t.notOk(err, "No error") + t.type(res, "Result") + t.has(res, tests[arg]) + }) + }) + +})