From 1acd6bedd5b4917b61b798671a6fef9f2e90a42e Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Sun, 2 Apr 2017 20:18:51 +0200 Subject: [PATCH 1/9] chore(all): update for release --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba0b6bf..103def2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ + +## [1.1.1](https://github.com/alan-agius4/speedy-json-extends/compare/v1.1.0...v1.1.1) (2017-04-02) + + + # [1.1.0](https://github.com/alan-agius4/speedy-json-extends/compare/v1.0.2...v1.1.0) (2017-04-01) From 83c6fe9017f50fb4d131cfddb32b979c9d7b4c98 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Sun, 1 Oct 2017 17:55:14 +0200 Subject: [PATCH 2/9] chore(ci): migrate to circleci v2 --- .circleci/config.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ .npmignore | 1 + circle.yml | 11 ----------- 3 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..a6b334d --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,44 @@ +version: 2 +jobs: + build: + working_directory: ~/speedy + docker: + - image: circleci/node:6.10 + steps: + - checkout + - restore_cache: + key: speed-json-extend-{{ .Branch }}-{{ checksum "package.json" }} + - run: + name: Install npm packages + command: npm install + - run: + name: Build + command: npm run build + - save_cache: + key: speed-json-extend-{{ .Branch }}-{{ checksum "package.json" }} + paths: + - node_modules + test: + docker: + - image: circleci/node:6.10 + steps: + - checkout + - restore_cache: + key: speed-json-extend-{{ .Branch }}-{{ checksum "package.json" }} + - run: + name: Install npm packages + command: npm install + - run: + name: Test + command: npm t + - save_cache: + key: speed-json-extend-{{ .Branch }}-{{ checksum "package.json" }} + paths: + - node_modules + +workflows: + version: 2 + default_workflow: + jobs: + - build + - test \ No newline at end of file diff --git a/.npmignore b/.npmignore index 4ce06b0..970fd38 100644 --- a/.npmignore +++ b/.npmignore @@ -7,6 +7,7 @@ node_modules /test /tsconfig.json /tslint.json +/.circleci .npmignore .editorconfig diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 5d95fff..0000000 --- a/circle.yml +++ /dev/null @@ -1,11 +0,0 @@ -machine: - node: - version: 6.9.5 - post: - - npm install -g npm@3.x.x -compile: - override: - - npm run build -test: - override: - - npm run test \ No newline at end of file From 5d622c8300d0f20ce78b1e4336f4fdc670901937 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Sun, 1 Oct 2017 18:01:33 +0200 Subject: [PATCH 3/9] chore(packages): update `@types/node` to `8.x.x` --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2e6e166..2f413c3 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@types/jasmine": "^2.5.41", "@types/lodash": "^4.14.51", "@types/mock-fs": "^3.6.30", - "@types/node": "^7.0.5", + "@types/node": "^8.0.31", "conventional-changelog-cli": "^1.3.1", "jasmine": "^2.5.3", "mock-fs": "^4.1.0", From a98adf2151534428114f632bfaf45d7ba2213e8a Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Sun, 1 Oct 2017 21:17:42 +0200 Subject: [PATCH 4/9] chore(ci): change circleci cache key --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a6b334d..a4851d5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,15 +7,15 @@ jobs: steps: - checkout - restore_cache: - key: speed-json-extend-{{ .Branch }}-{{ checksum "package.json" }} + key: speed-{{ .Branch }}-{{ checksum "package.json" }} - run: - name: Install npm packages + name: Installing npm packages command: npm install - run: name: Build command: npm run build - save_cache: - key: speed-json-extend-{{ .Branch }}-{{ checksum "package.json" }} + key: speed-{{ .Branch }}-{{ checksum "package.json" }} paths: - node_modules test: @@ -24,15 +24,15 @@ jobs: steps: - checkout - restore_cache: - key: speed-json-extend-{{ .Branch }}-{{ checksum "package.json" }} + key: speed-{{ .Branch }}-{{ checksum "package.json" }} - run: - name: Install npm packages + name: Installing npm packages command: npm install - run: name: Test command: npm t - save_cache: - key: speed-json-extend-{{ .Branch }}-{{ checksum "package.json" }} + key: speed-{{ .Branch }}-{{ checksum "package.json" }} paths: - node_modules From 4ff86fb7147aa379479711cb7a84f62c05661457 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Sun, 1 Oct 2017 21:23:15 +0200 Subject: [PATCH 5/9] chore(ci): change cache key --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a4851d5..9ad5161 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ jobs: steps: - checkout - restore_cache: - key: speed-{{ .Branch }}-{{ checksum "package.json" }} + key: speedy-{{ .Branch }}-{{ checksum "package.json" }} - run: name: Installing npm packages command: npm install @@ -15,7 +15,7 @@ jobs: name: Build command: npm run build - save_cache: - key: speed-{{ .Branch }}-{{ checksum "package.json" }} + key: speedy-{{ .Branch }}-{{ checksum "package.json" }} paths: - node_modules test: @@ -24,7 +24,7 @@ jobs: steps: - checkout - restore_cache: - key: speed-{{ .Branch }}-{{ checksum "package.json" }} + key: speedy-{{ .Branch }}-{{ checksum "package.json" }} - run: name: Installing npm packages command: npm install @@ -32,7 +32,7 @@ jobs: name: Test command: npm t - save_cache: - key: speed-{{ .Branch }}-{{ checksum "package.json" }} + key: speedy-{{ .Branch }}-{{ checksum "package.json" }} paths: - node_modules From f013382417d16e348d5e97f5dd51ec0e54854f8a Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Sun, 1 Oct 2017 21:24:49 +0200 Subject: [PATCH 6/9] chore(ci): remove workin g directory --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9ad5161..a02904c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,6 @@ version: 2 jobs: build: - working_directory: ~/speedy docker: - image: circleci/node:6.10 steps: From b7fdf5d2d86e4060690b46476d2f11e0b1df6a5a Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 28 Nov 2017 20:08:51 +0100 Subject: [PATCH 7/9] fix(json): relative extends path failure when not in cwd --- src/json.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/json.ts b/src/json.ts index 4ce9322..465c02b 100644 --- a/src/json.ts +++ b/src/json.ts @@ -1,5 +1,6 @@ import * as _ from "lodash"; import * as fs from "fs"; +import { resolve, dirname } from "path"; export namespace json { @@ -63,9 +64,9 @@ export namespace json { } } - contentUnmerged.push(readSync(path, namedExtends)); + contentUnmerged.push(readSync(resolve(dirname(filePath), path), namedExtends)); } - return _.merge({}, ...contentUnmerged, content); + return _.merge({}, ...contentUnmerged, content); } } \ No newline at end of file From 5349cfb27f26c96cea77f4a24ee42cafda4aa0c2 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 28 Nov 2017 20:24:16 +0100 Subject: [PATCH 8/9] test(json): fix unit tests --- src/json.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/json.spec.ts b/src/json.spec.ts index 866eb1d..444048f 100644 --- a/src/json.spec.ts +++ b/src/json.spec.ts @@ -29,7 +29,7 @@ describe("jsonSpec", () => { }; const PRIMARY_EXTEND_FILE = { - extends: "./config/secondary-extend.json", + extends: "./secondary-extend.json", rules: { message: { minLength: 1, @@ -105,7 +105,7 @@ describe("jsonSpec", () => { }); }); - describe("and have nested extends", () => { + fdescribe("and have nested extends", () => { it("should merge properties of nested json", async done => { const result = await json.read("speedy-commit-msg-hook.json"); expect(result.rules.message.noDashes).toBe(true); From cbc1e35eae47399ff3d11f115dbe4f0615228dff Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 28 Nov 2017 20:25:35 +0100 Subject: [PATCH 9/9] 1.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2f413c3..89bd789 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@speedy/json-extends", - "version": "1.1.1", + "version": "1.2.0", "description": "Extend a JSON file with one or many existing files.", "main": "./dist/json.js", "repository": {