From ada787d100ecf3a82be9e53d5749661625289e2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 16:07:49 +0000 Subject: [PATCH 1/7] Bump lodash from 4.17.20 to 4.17.21 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4a1c2b4..1ed3e12 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3434,9 +3434,9 @@ lodash.sortby@^4.7.0: integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= lodash@^4.17.19, lodash@^4.17.20: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== log-driver@^1.2.7: version "1.2.7" From 952c11e7710d16a05f4b82d3ab79ed5f9f864c4e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 19:08:28 +0000 Subject: [PATCH 2/7] Bump hosted-git-info from 2.8.8 to 2.8.9 Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9. - [Release notes](https://github.com/npm/hosted-git-info/releases) - [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md) - [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4a1c2b4..dac7972 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2513,9 +2513,9 @@ has@^1.0.3: function-bind "^1.1.1" hosted-git-info@^2.1.4: - version "2.8.8" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" - integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== + version "2.8.9" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== html-encoding-sniffer@^2.0.1: version "2.0.1" From 4fba5a9dc9af1be2be687d2c31a27038c0959c39 Mon Sep 17 00:00:00 2001 From: cpcwood Date: Tue, 11 May 2021 21:10:41 +0100 Subject: [PATCH 3/7] issue: transformer fails when ruby not installed. fix: check child.strerr present. --- index.js | 2 +- test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 8cec367..6c923d4 100755 --- a/index.js +++ b/index.js @@ -108,7 +108,7 @@ function erbTransformer (fileContent, filePath, config) { if (child.error && child.error.code === 'ETIMEDOUT') { throw new Error(`Compilation of '${filePath}' timed out after ${config.timeout}ms!`) } else { - throw new Error(`Error compiling '${filePath}', status: '${child.status}', signal: '${child.signal}', error: ${child.stderr.toString()}!`) + throw new Error(`Error compiling '${filePath}', status: '${child.status}', signal: '${child.signal}', error: ${child.stderr ? child.stderr.toString() : 'undefined'}`) } } const compiledFile = bufferToString(child.stdout, config.args.delimiter) diff --git a/test.js b/test.js index d751e15..a0edc22 100755 --- a/test.js +++ b/test.js @@ -149,5 +149,5 @@ test('user config - warning - could not be loaded', () => { test('error - general failure of childProcess.spawnSync', () => { expect(() => { transformErb('./tests/rubyError.js.erb') - }).toThrow("Error compiling './tests/rubyError.js.erb', status: '1', signal: 'null', error: (erb):1:in `
': A ruby error (RuntimeError)") + }).toThrow("Error compiling './tests/rubyError.js.erb', status: '1', signal: 'null', error: (erb):1:in `
': A ruby error (RuntimeError)") }) From 0c3c106d1cc51a88d86df334be8a802d5cb0b9a9 Mon Sep 17 00:00:00 2001 From: cpcwood Date: Tue, 11 May 2021 21:34:54 +0100 Subject: [PATCH 4/7] issue: travis no longer free. fix: add circleci --- .circleci/config.yml | 33 +++++++++++++++++++++++++++++++++ .travis.yml | 21 --------------------- Gemfile | 6 +----- package.json | 2 +- 4 files changed, 35 insertions(+), 27 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 .travis.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..85264c2 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,33 @@ +version: 2.1 + +orbs: + node: circleci/node@4.3.0 + ruby: circleci/ruby@1.1.3 + +workflows: + test: + jobs: + - test + +jobs: + test: + docker: + - image: 'cimg/base:stable' + steps: + - checkout + - node/install: + install-yarn: true + - node/install-packages: + pkg-manager: yarn + - ruby/install: + version: '2.7' + - ruby/install-deps + - run: + name: 'Specs' + command: yarn test + - run: + name: 'Lint' + command: yarn lint + - run: + name: 'Coverage' + command: yarn coveralls \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c1e0383..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: node_js -cache: - yarn: true -node_js: - - "12" -install: - - gem install bundler -v 2.1.4 - - bundle install - - yarn install -script: - - yarn test - - yarn eslint --fix - - yarn coveralls -deploy: - provider: npm - email: - secure: "OLsZlbIiNvdC2WwT+PserWHzU9iMu3FVg3ZuaQuA19csfHUnqChY7hu9Koh7NkpFMzObNJdMRbWya8MvGSXUMYy7HMlZhv4FDsNu5WWoSM52NlmY2PeDA2/7Bl2errbImSptkG91heHK+FFjqts0DR2MEuFItF9FKn/me9SIhdgHkak6HwaB//4uAvUaFA1QjITH7ZluYxtlHnsA8/SC1FsmE5qAZGB7RK83xgwvXr0CpyjjhxhYfu84ZwfKJzAmeRWQonVvIEZXFKcBMDClO7kkxJpSdhE2JjEDWPVl23MDO623KO1N/buYw3cBmHmz9LoAH5Vks3WAYeH16xB4SuHRbtsZMPWBMTkyELWVv6wS7BApb07rWq8YAO0A1yKBwBcSYInGOuDv/tyeIxsIfda3+EcpqS2SpnZKCthCNOBVc8quV1DWZRKe1OZJykpkrws2iJ0bNhPgLAed9QjaL1gBVbJGeCbtfVphPA2dnnYp8uZjRlYYCcDuNJJWekOA4R3ax/iMHHvZdzqSJ8hKklwgRcO+D1ExESuYvqQGbE/goAD0UsiLSKmUjXD79v72esEen7hSqDxLnlKMuYuS6VPS0qJZZYJW0BmoevxIZhvWehjQ4qr5erxeKw/7Lsib7TvmY1BzowRkWgTbLfzxGw7k9JofDwjD16edYqqufeg=" - api_key: - secure: "B+UhEmObCITPfqZwpGpZ3X2eM+asGj0mwx18T61I2W/k4FmTHZLksaGsJeDrZDXc+Plzc0U5tjKpczzWX5CLCiOpJz4WL/19/rDCTSVuKDslFuJq/C0xBJZmFjJegA34EcQP7LLCyjFmpesdcmgp8bbFjFVWNZzDh8aepi/BYRbP/qrfGNPyQUz/HuaN/4FVj5MHrYyp/BrZG1UD7bI5opMuXP0ZLe8HdDUZ02KcXrYg4ptDF9UnpRK4En5vMjT62xajozMxMfBHfgWQGHDwB+IIde43xwTR2WUBpyorHrGAn7DxfsGaK4+5YHuknR3zjXzHQM8pqpFXZmwZVy5CalCHZxLpySx6OjyV/lDlvmwtxUs0s0Rh+oRb6PMTo/gKF6RVxrEGprv6fV4v/fDy86+quvA0n9EGmHBSse/dD9pIVdbvRLFyoaE+qjIRZt0CI+2LUu0M2yLqvBWGc/WBhg0kT0+n0WkvDJw2XQfUBCT1JAKzl/bJld4qjGsmtGMBbgZ5ltUp8f8RmtJsuYGZFhu897f53F1Kp0JrQSht1lpn1tsBExJEGW/EiB4XjW7A5fXa5KyA8OPL3JXnmfl4KjUALRX5PbJ5JrQBqWgfD3833t6F81SdafBexlqezypj36mu/P4Mb2vrHbMsX5giQOj2ThYzKJVZFVBQaotqCoA=" - on: - branch: master \ No newline at end of file diff --git a/Gemfile b/Gemfile index 4d405af..4e0a749 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,3 @@ source 'https://rubygems.org' -gem 'erubi' - -group :development do - gem 'travis' -end \ No newline at end of file +gem 'erubi' \ No newline at end of file diff --git a/package.json b/package.json index a220f4f..13bc751 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jest-erb-transformer", - "version": "1.2.1", + "version": "1.2.2", "description": "Jest transformer for Embedded Ruby (`.erb`) files in Ruby projects", "main": "index.js", "scripts": { From 02dd4a0ea4a9c932cc9bce52ab8c3ee0c576ee53 Mon Sep 17 00:00:00 2001 From: cpcwood Date: Tue, 11 May 2021 21:45:31 +0100 Subject: [PATCH 5/7] update build status badge from travisci to circleci --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25c8a97..51fb221 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Jest ERB Transformer -[![npm-version](https://img.shields.io/npm/v/jest-erb-transformer.svg?color=blueviolet&style=flat-square)](https://www.npmjs.com/package/jest-erb-transformer) [![build-status](https://img.shields.io/travis/com/cpcwood/jest-erb-transformer/master.svg?style=flat-square)](https://travis-ci.com/github/cpcwood/jest-erb-transformer) [![code-coverage](https://img.shields.io/coveralls/github/cpcwood/jest-erb-transformer.svg?style=flat-square)](https://coveralls.io/github/cpcwood/jest-erb-transformer) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](https://standardjs.com) +[![npm-version](https://img.shields.io/npm/v/jest-erb-transformer.svg?color=blueviolet&style=flat-square)](https://www.npmjs.com/package/jest-erb-transformer) [![build-status](https://img.shields.io/circleci/build/gh/cpcwood/jest-erb-transformer?style=flat-square)](https://app.circleci.com/pipelines/github/cpcwood/jest-erb-transformer) [![code-coverage](https://img.shields.io/coveralls/github/cpcwood/jest-erb-transformer.svg?style=flat-square)](https://coveralls.io/github/cpcwood/jest-erb-transformer) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](https://standardjs.com) ## Overview From c090c8f34870675c068ebcf4b963f295737fb162 Mon Sep 17 00:00:00 2001 From: cpcwood Date: Tue, 11 May 2021 21:49:35 +0100 Subject: [PATCH 6/7] update gemfile --- Gemfile.lock | 54 ---------------------------------------------------- 1 file changed, 54 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e5d748b..783342f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,67 +1,13 @@ GEM remote: https://rubygems.org/ specs: - activesupport (5.2.4.3) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - addressable (2.7.0) - public_suffix (>= 2.0.2, < 5.0) - concurrent-ruby (1.1.6) erubi (1.9.0) - ethon (0.12.0) - ffi (>= 1.3.0) - faraday (1.0.1) - multipart-post (>= 1.2, < 3) - faraday_middleware (1.0.0) - faraday (~> 1.0) - ffi (1.13.0) - gh (0.17.0) - activesupport (~> 5.0) - addressable (~> 2.4) - faraday (~> 1.0) - faraday_middleware (~> 1.0) - multi_json (~> 1.0) - net-http-persistent (~> 2.9) - net-http-pipeline - highline (2.0.3) - i18n (1.8.3) - concurrent-ruby (~> 1.0) - json (2.3.0) - launchy (2.4.3) - addressable (~> 2.3) - minitest (5.14.1) - multi_json (1.14.1) - multipart-post (2.1.1) - net-http-persistent (2.9.4) - net-http-pipeline (1.0.1) - public_suffix (4.0.5) - pusher-client (0.6.2) - json - websocket (~> 1.0) - thread_safe (0.3.6) - travis (1.9.1) - faraday (~> 1.0) - faraday_middleware (~> 1.0) - gh (~> 0.13) - highline (~> 2.0) - json (~> 2.3) - launchy (~> 2.1, < 2.5.0) - pusher-client (~> 0.4) - typhoeus (~> 0.6, >= 0.6.8) - typhoeus (0.8.0) - ethon (>= 0.8.0) - tzinfo (1.2.7) - thread_safe (~> 0.1) - websocket (1.2.8) PLATFORMS ruby DEPENDENCIES erubi - travis BUNDLED WITH 2.1.4 From 3497018376fe2c3b843f56635fc9e80741327849 Mon Sep 17 00:00:00 2001 From: cpcwood Date: Tue, 11 May 2021 22:32:02 +0100 Subject: [PATCH 7/7] add package deploy to circleci --- .circleci/config.yml | 47 +++++++++++++++++++++++++++++++++++++++----- .gitignore | 3 ++- Gemfile | 2 +- Gemfile.lock | 4 ++-- 4 files changed, 47 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 85264c2..f75f904 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,14 +5,27 @@ orbs: ruby: circleci/ruby@1.1.3 workflows: + version: 2 test: jobs: - test + - deploy: + requires: + - test + filters: + branches: + only: master + +defaults: &defaults + working_directory: ~/repo + docker: + - image: cimg/base:stable jobs: test: - docker: - - image: 'cimg/base:stable' + <<: *defaults + environment: + GEM_HOME: ~/bundle steps: - checkout - node/install: @@ -20,8 +33,17 @@ jobs: - node/install-packages: pkg-manager: yarn - ruby/install: - version: '2.7' - - ruby/install-deps + version: '2.7.2' + - restore_cache: + keys: + - gems-v1-{{ checksum "./Gemfile.lock" }}-{{ .Branch }} + - run: + name: 'Bundle install' + command: bundle install + - save_cache: + key: gems-v1-{{ checksum "./Gemfile.lock" }}-{{ .Branch }} + paths: + - ~/bundle - run: name: 'Specs' command: yarn test @@ -30,4 +52,19 @@ jobs: command: yarn lint - run: name: 'Coverage' - command: yarn coveralls \ No newline at end of file + command: yarn coveralls + - persist_to_workspace: + root: ~/repo + paths: . + deploy: + <<: *defaults + steps: + - attach_workspace: + at: ~/repo + - run: + name: Authenticate with registry + command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc + - run: + name: Publish package + command: npm publish + diff --git a/.gitignore b/.gitignore index 660f7aa..d43e743 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.DS_Store node_modules temp-files -coverage \ No newline at end of file +coverage +process.yml \ No newline at end of file diff --git a/Gemfile b/Gemfile index 4e0a749..ffbd288 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ source 'https://rubygems.org' -gem 'erubi' \ No newline at end of file +gem 'erubi', '~> 1.10' \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 783342f..0ab1f41 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,13 +1,13 @@ GEM remote: https://rubygems.org/ specs: - erubi (1.9.0) + erubi (1.10.0) PLATFORMS ruby DEPENDENCIES - erubi + erubi (~> 1.10) BUNDLED WITH 2.1.4