Skip to content

Find cache dir#5669

Merged
hzoo merged 1 commit intobabel:7.0from
pwmckenna:find-cache-dir
Apr 27, 2017
Merged

Find cache dir#5669
hzoo merged 1 commit intobabel:7.0from
pwmckenna:find-cache-dir

Conversation

@pwmckenna
Copy link
Contributor

Q A
Fixed Tickets Fixes #5198
License MIT
Dependency Changes find-cache-dir

Make the preferred cache location for babel-register ./node_modules/.cache/babel-register to match the convention used by babel-loader, ava, etc

@mention-bot
Copy link

@pwmckenna, thanks for your PR! By analyzing the history of the files in this pull request, we identified @loganfsmyth, @hzoo and @DrewML to be potential reviewers.

@hzoo
Copy link
Member

hzoo commented Apr 26, 2017

I think you need to rebase, and see if we can add a test for this

(it's fine without too), nice work!

@hzoo hzoo added the PR: New Feature 🚀 A type of pull request used for our changelog categories label Apr 26, 2017
@pwmckenna
Copy link
Contributor Author

@hzoo just rebased. Any ideas on how to test this? Couldn't think of anything lighter weight than mocking out the filesystem (and I haven't done that in node)

@codecov
Copy link

codecov bot commented Apr 26, 2017

Codecov Report

Merging #5669 into 7.0 will increase coverage by 0.02%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##              7.0    #5669      +/-   ##
==========================================
+ Coverage   84.39%   84.42%   +0.02%     
==========================================
  Files         284      284              
  Lines        9749     9750       +1     
  Branches     2733     2734       +1     
==========================================
+ Hits         8228     8231       +3     
+ Misses       1009     1006       -3     
- Partials      512      513       +1
Impacted Files Coverage Δ
packages/babel-register/src/cache.js 72.72% <50%> (-3.47%) ⬇️
packages/babel-traverse/src/path/context.js 86.2% <0%> (ø) ⬆️
...bel-plugin-transform-es2015-classes/src/vanilla.js 90.59% <0%> (+0.42%) ⬆️
packages/babel-traverse/src/path/modification.js 74.75% <0%> (+0.97%) ⬆️
packages/babel-helper-call-delegate/src/index.js 68% <0%> (+4%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8895828...a7eba83. Read the comment docs.

@hzoo
Copy link
Member

hzoo commented Apr 26, 2017

If nothing in https://github.com/babel/babel/blob/7.0/packages/babel-register/test/cache.js gives any insights we can skip

@pwmckenna
Copy link
Contributor Author

@hzoo I gave it a quick pass and couldn't figure out a simple way to do it. I'd be up for skipping it, but I can also take another look this weekend when I have more time.

@hzoo hzoo merged commit 48de6b3 into babel:7.0 Apr 27, 2017
@hzoo
Copy link
Member

hzoo commented Apr 27, 2017

Cool, thanks for this @pwmckenna! Should make clearing cache much easier for everyone

@pwmckenna pwmckenna deleted the find-cache-dir branch May 1, 2017 16:59
hulkish added a commit to hulkish/babel that referenced this pull request May 2, 2017
* 'master' of github.com:hulkish/babel: (190 commits)
  Fix incorrect property ordering with obj rest spread on nested (babel#5685)
  Fix PathHoister hoisting before a same-scope variable declaration.
  Updated transform-react-display-name for createReactClass addon (babel#5554)
  Fix PathHoister error attaching after export declarations.
  add .mjs to list of well known extensions
  Remove babel-helper-builder-conditional-assignment-operator-visitor, unused in babel [skip ci] (babel#5676)
  use find-cache-dir for babel-register cache (babel#5669)
  Fix operator processing in object super.
  -> parsedAst
  string -> sourceCode, ast -> generatedCode
  back to babylon
  Switch to pirates for babel-register. (babel#3670)
  [skip ci] babylon -> babel, ast -> parsedAst
  [readme] change code -> string
  Add support for object type spread (babel#5525)
  Fix object destructuring in param arrays (babel#5650)
  Remove merge helper and add more type declarations. (babel#5649)
  Typecheck much more of the config loading process (babel#5642)
  update to alpha.9 (babel#5639)
  v7.0.0-alpha.9
  ...
hulkish added a commit to hulkish/babel that referenced this pull request May 2, 2017
* '7.0' of https://github.com/babel/babel: (190 commits)
  Fix incorrect property ordering with obj rest spread on nested (babel#5685)
  Fix PathHoister hoisting before a same-scope variable declaration.
  Updated transform-react-display-name for createReactClass addon (babel#5554)
  Fix PathHoister error attaching after export declarations.
  add .mjs to list of well known extensions
  Remove babel-helper-builder-conditional-assignment-operator-visitor, unused in babel [skip ci] (babel#5676)
  use find-cache-dir for babel-register cache (babel#5669)
  Fix operator processing in object super.
  -> parsedAst
  string -> sourceCode, ast -> generatedCode
  back to babylon
  Switch to pirates for babel-register. (babel#3670)
  [skip ci] babylon -> babel, ast -> parsedAst
  [readme] change code -> string
  Add support for object type spread (babel#5525)
  Fix object destructuring in param arrays (babel#5650)
  Remove merge helper and add more type declarations. (babel#5649)
  Typecheck much more of the config loading process (babel#5642)
  update to alpha.9 (babel#5639)
  v7.0.0-alpha.9
  ...
@jasonkarns
Copy link

Glad to see this moved out of $HOME but disappointed to see babel still not conforming to the XDG specification for cache files :(

The XDG specification https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html directs cache files to be under ${XDG_CACHE_HOME:-$HOME/.cache}. Respecting the XDG specification would make babel's cache clearable along with all xdg compliant apps/tools, regardless if they are node or not. (Recommended location would then be ${XDG_CACHE_HOME:-$HOME/.cache}/babel.json

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: New Feature 🚀 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants