Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: egoist/joycon
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.1
Choose a base ref
...
head repository: egoist/joycon
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.1.0
Choose a head ref
  • 2 commits
  • 4 files changed
  • 2 contributors

Commits on Nov 28, 2021

  1. Copy the full SHA
    3c25ed1 View commit details
  2. Update ci.yml

    egoist authored Nov 28, 2021
    Copy the full SHA
    fdb6a94 View commit details
Showing with 7 additions and 7 deletions.
  1. +3 −3 .github/workflows/ci.yml
  2. +1 −1 README.md
  3. +2 −2 lib/index.js
  4. +1 −1 src/index.js
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node_version: [10.x,12.x,14.x]
node_version: [12.x,14.x,16.x]

runs-on: ${{ matrix.os }}

@@ -50,7 +50,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 16.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -64,7 +64,7 @@ jobs:
- name: Install
run: yarn
- name: Release
run: npx semantic-release
run: npx -y semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ joycon.load(['package-lock.json', 'yarn.lock'])
})
```

By default only `.js` and `.json` file are parsed, otherwise raw data will be returned, so you can add custom loader to parse them:
By default only `.js`, `.cjs`, and `.json` file are parsed, otherwise raw data will be returned, so you can add custom loader to parse them:

```js
const joycon = new JoyCon()
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -158,7 +158,7 @@ class JoyCon {
loadSync: filepath => {
const extname = _path.default.extname(filepath).slice(1);

if (extname === 'js') {
if (extname === 'js' || extname === 'cjs') {
delete require.cache[filepath];
return require(filepath);
}
@@ -204,7 +204,7 @@ class JoyCon {
loadSync: filepath => {
const extname = _path.default.extname(filepath).slice(1);

if (extname === 'js') {
if (extname === 'js' || extname === 'cjs') {
delete require.cache[filepath];
return require(filepath);
}
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -152,7 +152,7 @@ export default class JoyCon {
test: /\.+/,
loadSync: (filepath) => {
const extname = path.extname(filepath).slice(1)
if (extname === 'js') {
if (extname === 'js' || extname === 'cjs') {
delete require.cache[filepath]
return require(filepath)
}