Skip to content

Commit

Permalink
feat: experimental modules compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroenv committed Jul 5, 2019
1 parent 4efcd01 commit 4f31ab3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/config.js
@@ -1,5 +1,5 @@
import { config } from 'dotenv';
config();
import dotenv from 'dotenv';
dotenv.config();
import ms from 'ms';

const defaultConfig = {
Expand Down
2 changes: 1 addition & 1 deletion src/formatPkg.js
Expand Up @@ -8,7 +8,7 @@ import traverse from 'traverse';
import truncate from 'truncate-utf8-bytes';
import hostedGitInfo from 'hosted-git-info';

import c from './config';
import c from './config.js';

export default function formatPkg(pkg) {
const cleaned = new NicePackage(pkg);
Expand Down
10 changes: 5 additions & 5 deletions src/index.js
@@ -1,14 +1,14 @@
import PouchDB from 'pouchdb-http';
import ms from 'ms';
import cargo from 'async/cargo.js';
import queue from 'async/queue.js';
import createStateManager from './createStateManager.js';
import saveDocs from './saveDocs.js';
import createAlgoliaIndex from './createAlgoliaIndex.js';
import c from './config.js';
import PouchDB from 'pouchdb-http';
import * as npm from './npm.js';
import log from './log.js';
import ms from 'ms';
import cargo from 'async/cargo';
import queue from 'async/queue';
import { loadHits } from './jsDelivr';
import { loadHits } from './jsDelivr.js';

log.info('🗿 npm ↔️ Algolia replication starts ⛷ 🐌 🛰');

Expand Down
4 changes: 1 addition & 3 deletions src/log.js
@@ -1,9 +1,7 @@
import bunyan from 'bunyan';
import bunyanDebugStream from 'bunyan-debug-stream';

const stream = bunyanDebugStream({
basepath: __dirname,
});
const stream = bunyanDebugStream();

const logger = bunyan.createLogger({
name: 'npm-search',
Expand Down
3 changes: 1 addition & 2 deletions src/npm.js
@@ -1,5 +1,4 @@
import got from 'got';
import { chunk } from 'lodash';
import chunk from 'lodash/chunk.js';
import numeral from 'numeral';

import c from './config.js';
Expand Down
4 changes: 2 additions & 2 deletions src/saveDocs.js
Expand Up @@ -2,8 +2,8 @@ import formatPkg from './formatPkg.js';
import log from './log.js';
import { getDownloads, getDependents } from './npm.js';
import { getChangelogs } from './changelog.js';
import { getHits } from './jsDelivr';
import { getTSSupport } from './typescriptSupport';
import { getHits } from './jsDelivr.js';
import { getTSSupport } from './typescriptSupport.js';

export default function saveDocs({ docs, index }) {
const rawPkgs = docs
Expand Down

0 comments on commit 4f31ab3

Please sign in to comment.