Git Product home page Git Product logo

atomic-algolia's Introduction

Algolia Atomic

An NPM package for running atomic updates to Algolia indices

All Contributors npm

How it works

This package runs atomic updates to Algolia Indices. What does that mean?

Simply put, this package reads your local index, and updates the new or updated records, while removing deleted records.

It does this all at once, so your index is never out of sync with your content, and you use the smallest amount of operations possible.

(Stay on that free plan as long as you can!)

Installation

To install this script, you must have Node & NPM installed. Once installed, run the following command in your terminal:

npm install atomic-algolia

Usage

This package can be used in NPM "scripts" or in Javascript Files.

It reads an array of objects or local JSON file with an array of valid records. For example:

[
    {
        "objectID": "1",
        "title": "An example record"
    }
]

NPM Scripts

To use this package in your NPM scripts, add the command to your script in package.json.

Note, this package can only be used in NPM scripts to update a single index from a local JSON file. To update multiple indices or pass in a Javascript object, create your own script by following the instructions in Javascript Files

E.g:

...
"scripts": {
    "algolia": "atomic-algolia"
}
...

Lastly, run your NPM command. E.g:

ALGOLIA_APP_ID={{ YOUR_APP_ID}} ALGOLIA_ADMIN_KEY={{ YOUR_ADMIN_KEY }} ALGOLIA_INDEX_NAME={{ YOUR_INDEX_NAME }} ALGOLIA_INDEX_FILE={{ YOUR_FILE_PATH }} npm run algolia

Scripts

To use this package in your own local script, require it in your file. E.g:

Using with a local JSON file

var atomicalgolia = require("atomic-algolia")
var indexName = "example_index"
var indexPath = "./index.json"
var cb = function(error, result) {
    if (err) throw error

    console.log(result)
}

atomicalgolia(indexName, indexPath, cb)

Then call the script from your terminal as follows:

ALGOLIA_APP_ID={{ YOUR_APP_ID}} ALGOLIA_ADMIN_KEY={{ YOUR_ADMIN_KEY }} node YOUR_SCRIPT.js

Using with an Array of Objects

var atomicalgolia = require("atomic-algolia")
var indexName = "example_index"

var indexData = [
    {
        objectID: "1",
        title: "An example record"
    }
]

var cb = function(error, result) {
    if (error) throw error

    console.log(result)
}

atomicalgolia(indexName, indexData, cb)

Then call the script from your terminal as follows:

ALGOLIA_APP_ID={{ YOUR_APP_ID}} ALGOLIA_ADMIN_KEY={{ YOUR_ADMIN_KEY }} node YOUR_SCRIPT.js

Using a .env file

A .env file can be added to the root of your project with the required environment variables. This way, you don't have to specify them in package.json or when running the command.

Run the following command:

touch .env && open .env

Then paste in the following contents, and update the placeholder variable marked with braces {{ }}

ALGOLIA_APP_ID={{ YOUR_APP_ID }}
ALGOLIA_ADMIN_KEY={{ YOUR_ADMIN_KEY }}
ALGOLIA_INDEX_NAME={{ YOUR_INDEX_NAME }}
ALGOLIA_INDEX_FILE={{ YOUR_INDEX_FILE }}

ALGOLIA_APP_ID: the ID of the Algolia app instance that contains your index.

ALGOLIA_ADMIN_KEY: the adminstrative key for the Algolia app instance that contains your index.

ALGOLIA_INDEX_NAME: the name of the index you're updating.

ALGOLIA_INDEX_FILE: the relative path to your index file from the root of your project.

Contributors

Thanks goes to these wonderful people (emoji key):


chrisdmacrae

💬 💻 🎨 📖

Tim Carry

💬 💻 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

atomic-algolia's People

Contributors

beckerjohannes avatar chrisdmacrae avatar dependabot[bot] avatar varun-raj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

atomic-algolia's Issues

[RFC] Improved CLI

Use case (user story)

I’d like to convert this project to a monorepo, and:

  • create a core package in typescript
  • create a CLI using ink.js and glue.js

Scenarios

Scenario: new project
Given I am using atomic Algolia for the first time,
When I start my project, I should be able to call an init command,
Then atomic Algolia will be added to my project,
  and package.json will be updated with scripts,
  and package.json will be update with default config.

Scenario: Update a single index
Given I am updating an index,
When I call the atomic Algolia CLI,
Then I should be promoted for a path to the local index,
  And the remote index identifier,
  And Algolia API keys,
  Or be able to pass them directly to the CLI,
And the index is then updated. 

Scenario: interactive feedback
Given I am updating an index,
When the process is running,
Then the CLI should provide real-time feedback,
  And show which hits are being updated,
  And show which hits are being removed,
  And show which hits are being added,
  And show which hits haven’t changed.

Notes

This needs to be done incrementally.

  1. Add basic expanded CLI functionality piece by piece
  2. Add ink and basic reporting
  3. Add expanded reporting
  4. Add verbose reporting with expandable git information

Add tests

Problem's to be solved

I want to make sure that the package works as expected as we increase in complexity.

  • Add Jest tests for each entry point (NPM Script, CLI, Custom Script)

Add support for back to Node 4

Problem's we're trying to solve

This plugin uses some node8 features (async, await and others). Using webpack, we could transpile the codebase to have syntax supported by earlier node versions.

[BUG] Records always determined to require update

This script never sees records as unchanged if the index is configured not to return all attribute by default. This can be fixed by changing getRemoteIndex to this implementation:

async function  getRemoteIndex(index) {
  let hits = [];
  await index.browseObjects({
    query: '', // Empty query will match all records
    batch: batch => {
      hits = hits.concat(batch);
    },
    attributesToRetrieve: ["*"]
  })
  return hits
}

And, of course, bump the algoliasearch version to >=4 on package.json.

[BUG] CloudFlare Pages: EvalError: Code generation from strings disallowed for this context

Description

The package fails on CloudFlare Workers / Cloudflare Pages Functions

Steps to reproduce

Scenario: I'm trying to use atomic-algolia in a CloudFlare Pages Functions
When using atomic-algolia with CF Pages Functions Wrangler throws this error: EvalError: Code generation from strings disallowed for this context
[pages:err] EvalError: Code generation from strings disallowed for this context
    at Function (<anonymous>)
    at node_modules/regenerator-runtime/runtime.js (/Users/regisphilibert/Boulot/tnd/retroreport.org/node_modules/regenerator-runtime/runtime.js:747:3)
    at __require2 (/var/folders/t7/9pbqz9_17llf0v0x7k3nxnkm0000gn/T/functionsWorker-0.9821669927980017.js:16:50)
    at node_modules/@babel/runtime/regenerator/index.js (/Users/regisphilibert/Boulot/tnd/retroreport.org/node_modules/@babel/runtime/regenerator/index.js:1:18)
    at __require2 (/var/folders/t7/9pbqz9_17llf0v0x7k3nxnkm0000gn/T/functionsWorker-0.9821669927980017.js:16:50)
    at node_modules/atomic-algolia/lib/utils/getRemoteIndex.js (/Users/regisphilibert/Boulot/tnd/retroreport.org/node_modules/atomic-algolia/lib/utils/getRemoteIndex.js:5:43)
    at __require2 (/var/folders/t7/9pbqz9_17llf0v0x7k3nxnkm0000gn/T/functionsWorker-0.9821669927980017.js:16:50)
    at node_modules/atomic-algolia/lib/update.js (/Users/regisphilibert/Boulot/tnd/retroreport.org/node_modules/atomic-algolia/lib/update.js:17:22)
    at __require2 (/var/folders/t7/9pbqz9_17llf0v0x7k3nxnkm0000gn/T/functionsWorker-0.9821669927980017.js:16:50)
    at node_modules/atomic-algolia/lib/index.js (/Users/regisphilibert/Boulot/tnd/retroreport.org/node_modules/atomic-algolia/lib/index.js:6:14)

This thread is not about this package, but makes me think there is no workaround.

System information

atomic-algolia version: 0.3.19
node version: v16.14.2
npm version: 8.5.0
system OS: 12.4 (21F79)

More

Note that CloudFlare Pages Functions do not have a log available yet. So I'm not able to see if the error is present outside on local development using Wrangler.

CloudFlare security has this restriction, it seems Vercel as well but not sure.

Add support for chunking

Problem's to be solved

In order to increase search relevancy and deal with yuuuuuge records, @pixelstatic came up with the solution of chunking a record value into parts.

In his scenario, he chunks by paragraph on Jekyll's end.

In our case, we can't do that easily. But we can chunk records somewhat, and add documentation for more complex examples!

[RFC]Upgrade to algoliasearch>4

Use case (user story)
I would like to update the algoliasearch > 4.

Notes
Some functions on the index need to be updated. Since Algolia might stop the support for 3 in the future, when are you planning to upgrade?

As a developer, I'm using this library in our production environment, I want to help upgrade

[BUG]

Description

Steps to reproduce

Scenario:
Given ,
When ,
Then ,

System information

atomic-algolia version:

node version:

npm version:

system OS:

system OS version:

Notes

[RFC] Multiple index path .env

Use case (user story)

Hi there I'm dealing with multilingual site so I have multiple json output with different path. In this case public/algolia.json public/en/algolia.json public/su/algolia.json

So it would be nice if i can add multiple ALGOLIA_INDEX_FILE= in the .env

Scenarios

ALGOLIA_INDEX_FILE=  public/algolia.json
ALGOLIA_INDEX_FILE=  public/en/algolia.json
ALGOLIA_INDEX_FILE=  public/su/algolia.json

TypeError: cb is not a function

I get this when running via a local JSON file. The index seems to update, but throws this error.

I believe this is on line 72 update.js

(node:12840) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: cb is not a function
(node:12840) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

fuller error:

/node_modules/atomic-algolia/lib/update.js:72
                        cb(null, res)
                        ^

TypeError: cb is not a function
    at Object.callback (/Users/budparr/code/projects/thenewdynamic.org/thenewdynamic.org/node_modules/atomic-algolia/lib/update.js:72:25)
    at Timeout._onTimeout (/Users/budparr/code/projects/thenewdynamic.org/thenewdynamic.org/node_modules/algoliasearch/src/AlgoliaSearchCore.js:456:21)
    at ontimeout (timers.js:475:11)
    at tryOnTimeout (timers.js:310:5)
    at Timer.listOnTimeout (timers.js:270:5)

Add CLI support

Problem's to be solved

Make it possible to use this as a CLI, and enable updating multiple indices that way as well

[RFC] Typescript Support

Use case (user story)

Convert the existing project to typescript classes to:

  • Make things easier to maintain
  • Make things easier to document
  • Make the project type safe

Scenarios

Scenario: Making API changes
Given I am updating the API surface of the CLI,
When I update the CLI methods,
Then I want type safety to ensure the CLI commands are collecting the correct data for the underlying API.

Notes

A little question

If you have time, could you comment or advise me on the following?

  1. Are you willing to update or continue to maintain this library? Or are you looking for a maintainer?
  2. I am currently trying to rebuild this project in TypeScript, can I partially copy (not exactly the same) the processing content of the code in this project?

Just to be safe, I intend to make one that meets the following items

  • Completely non-commercial library
  • I will put in the README.md that I was impressed with this library: atomic-algolia

Feature Request: Multiple Indices

I'm not even sure at this point how important multiple indices are, but thought it worth throwing out to you for consideration.

A few common use cases where several indices are needed:
You need to index different “kind of things”: index_people, index_products, …
You need to clear and re-index a complete index. To avoid negative transition effects like having an empty index at some point, we advise you to create a new temporary index and then replace the old one. You want to have multiple development environments: dev_products, staging_products, prod_products, … You want to have different indices for different languages: products_en, products_fr, products_it, …

[BUG] ReferenceError: hits is not defined

Description

Fix ReferenceError in getRemoteIndex.js

ReferenceError: hits is not defined
atomic-algolia\lib\utils\getRemoteIndex.js:50:10

System information

atomic-algolia version: 0.3.18
node-version: 10.15.3

npm run algolia if (err) throw err

Hi

I'm usiing Hugo & windows

Here is my package.json

{
  "name": "yes",
  "version": "1.0.0",
  "description": "build xxx.com",
  "main": "gulpfile.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "algolia": "atomic-algolia"
  },
  "repository": {
    "type": "git",
    "url": ""
  },
  "keywords": [
    "blog"
  ],
  "author": "yudy ananda",
  "license": "MIT",
  "bugs": {
    "url": ""
  },
  "homepage": "",
  "devDependencies": {
    "atomic-algolia": "^0.3.11",
    "gulp": "^3.9.1",
    "gulp-clean-css": "^3.9.2",
    "gulp-css-purge": "^3.0.3",
    "gulp-html-prettify": "0.0.1",
    "gulp-minify-inline": "^1.0.0",
    "gulp-remove-empty-lines": "^0.1.0"
  },
  "dependencies": {
    
  }
}

I'm not sure what's wrong but npm run algolia throw me an error

`0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\Yudy\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'algolia' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prealgolia', 'algolia', 'postalgolia' ]
5 info lifecycle [email protected]~prealgolia: [email protected]
6 info lifecycle [email protected]~algolia: [email protected]
7 verbose lifecycle [email protected]~algolia: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~algolia: PATH: C:\Users\Yudy\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\YUDY\WEB PROJECT\TIA\PROD\mm\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Python34\;C:\Python34\Scripts;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Python36;C:\Python36\Scripts;C:\Program Files\Git\cmd;C:\Go\bin;C:\Hugo\bin;C:\cygwin64\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\PuTTY\;C:\Program Files (x86)\Common Files\Apple\Internet Services\;C:\Program Files\wkhtmltopdf\bin\;C:\filemanager\;C:\xampp\php;C:\ProgramData\ComposerSetup\bin;C:\Ruby24-x64\bin;C:\Users\Yudy\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Users\Yudy\AppData\Local\atom\bin;C:\Users\Yudy\AppData\Roaming\npm;C:\Users\Yudy\AppData\Local\GitHubDesktop\bin;C:\Users\Yudy\AppData\Roaming\Composer\vendor\bin;C:\Program Files (x86)\Yarn\bin;C:\xampp\mysql\bin;C:\Program Files (x86)\Brackets\command;C:\Program Files\nodejs\;C:\HashiCorp\Vagrant\bin;%SUBLIMEHOME%;C:\Ruby24-x64\bin;C:\Users\Yudy\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Users\Yudy\AppData\Local\atom\bin;C:\Users\Yudy\AppData\Local\GitHubDesktop\bin;C:\Users\Yudy\AppData\Roaming\Composer\vendor\bin;C:\Users\Yudy\AppData\Local\Yarn\bin;C:\Users\Yudy\AppData\Roaming\npm;C:\Program Files\Sublime Text 3;C:\Program Files (x86)\OpenShift;C:\Program Files\Heroku\bin
9 verbose lifecycle [email protected]~algolia: CWD: E:\YUDY\WEB PROJECT\TIA\PROD\mm
10 silly lifecycle [email protected]~algolia: Args: [ '/d /s /c', 'atomic-algolia' ]
11 silly lifecycle [email protected]~algolia: Returned: code: 1  signal: null
12 info lifecycle [email protected]~algolia: Failed to exec algolia script
13 verbose stack Error: [email protected] algolia: `atomic-algolia`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\Yudy\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack     at EventEmitter.emit (events.js:159:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\Yudy\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:159:13)
13 verbose stack     at maybeClose (internal/child_process.js:943:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid [email protected]
15 verbose cwd E:\YUDY\WEB PROJECT\TIA\PROD\mm
16 verbose Windows_NT 10.0.15063
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Yudy\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "algolia"
18 verbose node v9.3.0
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] algolia: `atomic-algolia`
22 error Exit status 1
23 error Failed at the [email protected] algolia script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Dis I missed something?

[RFC] Support meilisearch

Use case (user story)

Meilisearch is an open source Algolia-like search engine.

Scenarios

N/A

Notes

  • This comes after the re-write

Add examples

Problem's to be solved

I'd like to see some examples for generating indexes for various tools/services. Some examples:

Static Site Generators

  • Hugo
  • Jekyll
  • GatsbyJS

API-driven CMS'

  • Contentful
  • DatoCMS
    ...

[BUG]

Last login: Fri Apr 10 20:51:12 on console
You have mail.
  ~ ······················································· 20:52:37  ─╮
❯ j hugo ─╯
/Users/iamwlb/Documents/Workspace/hugo

cd blog
 blog/  .DS_Store

  ~/Documents/Workspace/hugo ······························ 20:52:44  ─╮
❯ cd blog ─╯

  .git/            layouts/        .DS_Store
  archetypes/      resources/      config.toml
  content/         static/         config.yaml
  data/            themes/

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ······· 20:52:45  ─╮
❯ npm install hugo-algolia -g ─╯
/usr/local/Cellar/node/13.12.0/bin/hugo-algolia -> /usr/local/Cellar/node/13.12.0/lib/node_modules/hugo-algolia/bin/index.js

  ~/Documents/Workspace/hugo/blog   master !1 ?1 · 5s  20:52:55  ─╮
❯ hugo-algolia -s ─╯
zsh: command not found: hugo-algolia

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ···················································· 20:53:08  ─╮
❯ /usr/local/Cellar/node/13.12.0/bin/hugo-algolia -s ─╯
JSON index file was created in public/algolia.json
events.js:292
throw er; // Unhandled 'error' event
^
config.yaml    buffers

Error: ENOENT: no such file or directory, open 'public/algolia.json'
Emitted 'error' event on WriteStream instance at:
at internal/fs/streams.js:399:14
at FSReqCallback.oncomplete (fs.js:159:23) {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: 'public/algolia.json'
}

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ·············································· 4s  20:53:45  ─╮
❯ ls ─╯
archetypes config.toml config.yaml content data layouts resources static themes

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ···················································· 20:53:56  ─╮
❯ vim config.yml ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ·············································· 4s  20:54:30  ─╮
❯ ls ─╯
archetypes config.toml config.yaml content data layouts resources static themes

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ···················································· 20:54:35  ─╮
❯ vim config.yaml ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ············································· 28s  20:55:07  ─╮
❯ /usr/local/Cellar/node/13.12.0/bin/hugo-algolia -s ─╯
JSON index file was created in public/algolia.json
events.js:292
throw er; // Unhandled 'error' event
^

Error: ENOENT: no such file or directory, open 'public/algolia.json'
Emitted 'error' event on WriteStream instance at:
at internal/fs/streams.js:399:14
at FSReqCallback.oncomplete (fs.js:159:23) {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: 'public/algolia.json'
}

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ·············································· 3s  20:55:14  ─╮
❯ ls ─╯
archetypes config.toml config.yaml content data layouts resources static themes

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ···················································· 20:56:03  ─╮
❯ cd content ─╯

  post/      .DS_Store       about.md       resoure.md

  ~/Documents/Workspace/hugo/blog/content   master !1 ?1 ············································ 20:56:18  ─╮
❯ cd .. ─╯

  .git/            data/           static/         config.toml
  archetypes/      layouts/        themes/         config.yaml
  content/         resources/      .DS_Store

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ···················································· 20:56:25  ─╮
❯ cd layouts ─╯

  partials/      .DS_Store

  ~/Documents/Workspace/hugo/blog/layouts   master !1 ?1 ············································ 20:56:29  ─╮
❯ cd partials ─╯

  .DS_Store       footer.html

  ~/Documents/Workspace/hugo/blog/layouts/partials   master !1 ?1 ··································· 20:56:32  ─╮
❯ cd .. ─╯

  partials/      .DS_Store

  ~/Documents/Workspace/hugo/blog/layouts   master !1 ?1 ············································ 20:56:36  ─╮
❯ ls ─╯
config.toml    buffers
partials

  ~/Documents/Workspace/hugo/blog/layouts   master !1 ?1 ············································ 20:56:38  ─╮
❯ cd .. ─╯

  .git/            data/           static/         config.toml
  archetypes/      layouts/        themes/         config.yaml
  content/         resources/      .DS_Store

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ···················································· 20:56:40  ─╮
❯ cd static ─╯

Nothing to show here

  ~/Documents/Workspace/hugo/blog/static   master !1 ?1 ············································· 20:56:44  ─╮
❯ cd .. ─╯
list.algolia.json    buffers

  .git/            data/           static/         config.toml
  archetypes/      layouts/        themes/         config.yaml
  content/         resources/      .DS_Store

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ···················································· 20:56:46  ─╮
❯ vim config.toml ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ············································· 47s  21:00:44  ─╮
❯ cd layouts ─╯

  partials/      .DS_Store

  ~/Documents/Workspace/hugo/blog/layouts   master !1 ?1 ············································ 21:01:17  ─╮
❯ mkdir _default ─╯
config.toml    buffers

  ~/Documents/Workspace/hugo/blog/layouts   master !1 ?1 ············································ 21:01:28  ─╮
❯ cd _default ─╯

Nothing to show here

  ~/Documents/Workspace/hugo/blog/layouts/_default   master !1 ?1 ··································· 21:01:31  ─╮
❯ vim list.algolia.json ─╯

  ~/Documents/Workspace/hugo/blog/layouts/_default   master !1 ?2 ···························· 11s  21:01:46  ─╮
❯ cd .. ─╯

  _default/      partials/      .DS_Store

  ~/Documents/Workspace/hugo/blog/layouts   master !1 ?2 ············································ 21:02:05  ─╮
❯ cd .. ─╯

  .git/            data/           static/         config.toml
  archetypes/      layouts/        themes/         config.yaml
  content/         resources/      .DS_Store

  ~/Documents/Workspace/hugo/blog   master !1 ?2 ···················································· 21:02:07  ─╮
❯ vim config.toml ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?2 ·········································· 1m 12s  21:03:24  ─╮
❯ npm install atomic-algolia --save ─╯
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

[email protected] install /Users/iamwlb/node_modules/leveldown
prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=13.12.0 runtime=node arch=x64 platform=darwin)
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/builder.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/db_impl.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/db_iter.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/filename.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/dbformat.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/log_reader.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/log_writer.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/memtable.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/repair.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/table_cache.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/version_edit.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/version_set.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/write_batch.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/helpers/memenv/memenv.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/port/port_posix_sse.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/block.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/block_builder.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/filter_block.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/format.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/iterator.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/merger.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/table.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/table_builder.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/two_level_iterator.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/arena.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/bloom.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/cache.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/coding.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/comparator.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/crc32c.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/env.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/filter_policy.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/hash.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/logging.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/options.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/status.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/port/port_posix.o
CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/env_posix.o
LIBTOOL-STATIC Release/leveldb.a
CXX(target) Release/obj.target/snappy/deps/snappy/snappy-1.1.4/snappy-sinksource.o
CXX(target) Release/obj.target/snappy/deps/snappy/snappy-1.1.4/snappy-stubs-internal.o
CXX(target) Release/obj.target/snappy/deps/snappy/snappy-1.1.4/snappy.o
LIBTOOL-STATIC Release/snappy.a
CXX(target) Release/obj.target/leveldown/src/batch.o
In file included from ../src/batch.cc:3:
In file included from ../node_modules/nan/nan.h:192:
../node_modules/nan/nan_maybe_43_inl.h:112:15: error: no member named 'ForceSet' in 'v8::Object'
return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
~~~ ^
In file included from ../src/batch.cc:3:
In file included from ../node_modules/nan/nan.h:197:
In file included from ../node_modules/nan/nan_converters.h:67:
../node_modules/nan/nan_converters_43_inl.h:22:1: error: no viable conversion from 'Localv8::Context' to 'v8::Isolate '
X(Boolean)
^~~~~~~~~~
../node_modules/nan/nan_converters_43_inl.h:18:23: note: expanded from macro 'X'
val->To ## TYPE(v8::Isolate::GetCurrent()->GetCurrentContext())
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:2762:37: note: passing argument to parameter 'isolate' here
Local ToBoolean(Isolate
isolate) const;
^
In file included from ../src/batch.cc:3:
In file included from ../node_modules/nan/nan.h:197:
In file included from ../node_modules/nan/nan_converters.h:67:
../node_modules/nan/nan_converters_43_inl.h:40:1: error: no viable conversion from 'Localv8::Context' to 'v8::Isolate '
X(bool, Boolean)
^~~~~~~~~~~~~~~~
../node_modules/nan/nan_converters_43_inl.h:37:29: note: expanded from macro 'X'
return val->NAME ## Value(isolate->GetCurrentContext());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:2771:30: note: passing argument to parameter 'isolate' here
bool BooleanValue(Isolate
isolate) const;
^
In file included from ../src/batch.cc:3:
In file included from ../node_modules/nan/nan.h:198:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:103:42: error: no viable conversion from 'v8::Isolate *' to
'Localv8::Context'
return scope.Escape(v8::Function::New( isolate
^~~~~~~
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:189:7: note: candidate constructor
(the implicit copy constructor) not viable: no known conversion from 'v8::Isolate *' to
'const v8::Localv8::Context &' for 1st argument
class Local {
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:189:7: note: candidate constructor
(the implicit move constructor) not viable: no known conversion from 'v8::Isolate *' to 'v8::Localv8::Context &&' for
1st argument
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:193:13: note: candidate template ignored: could not match
'Local' against 'v8::Isolate '
V8_INLINE Local(Local that)
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:4313:22: note: passing argument to parameter 'context' here
Local context, FunctionCallback callback,
^
In file included from ../src/batch.cc:3:
In file included from ../node_modules/nan/nan.h:198:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:337:37: error: too few arguments to function call, expected 2, have 1
return v8::StringObject::New(value).Asv8::StringObject();
~~~~~~~~~~~~~~~~~~~~~ ^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:5688:3: note: 'New' declared here
static Local New(Isolate
isolate, Local value);
^
In file included from ../src/batch.cc:3:
../node_modules/nan/nan.h:834:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context)
[-Wdeprecated-declarations]
return node::MakeCallback(
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/node.h:187:1: note: 'MakeCallback' has been explicitly marked
deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/node.h:107:20: note: expanded from macro 'NODE_DEPRECATED'
attribute((deprecated(message))) declarator
^
In file included from ../src/batch.cc:3:
../node_modules/nan/nan.h:849:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context)
[-Wdeprecated-declarations]
return node::MakeCallback(
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/node.h:180:1: note: 'MakeCallback' has been explicitly marked
deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/node.h:107:20: note: expanded from macro 'NODE_DEPRECATED'
attribute((deprecated(message))) declarator
^
In file included from ../src/batch.cc:3:
../node_modules/nan/nan.h:864:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context)
[-Wdeprecated-declarations]
return node::MakeCallback(
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/node.h:173:1: note: 'MakeCallback' has been explicitly marked
deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/node.h:107:20: note: expanded from macro 'NODE_DEPRECATED'
attribute((deprecated(message))) declarator
^
In file included from ../src/batch.cc:3:
../node_modules/nan/nan.h:911:53: error: too few arguments to function call, single argument 'context' was not specified
v8::Localv8::String string = from->ToString();
~~~~~~~~~~~~~~ ^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:2750:3: note: 'ToString' declared here
V8_WARN_UNUSED_RESULT MaybeLocal ToString(
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8config.h:419:31: note: expanded from macro
'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT attribute((warn_unused_result))
^
In file included from ../src/batch.cc:3:
../node_modules/nan/nan.h:921:37: error: cannot initialize a parameter of type 'v8::Isolate ' with an lvalue of type
'char '
length_ = string->WriteUtf8(str_, static_cast(len), 0, flags);
^~~~
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:2947:26: note: passing argument to parameter 'isolate' here
int WriteUtf8(Isolate
isolate, char
buffer, int length = -1,
^
In file included from ../src/batch.cc:3:
../node_modules/nan/nan.h:1473:31: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context)
[-Wdeprecated-declarations]
return scope.Escape(node::MakeCallback(
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/node.h:187:1: note: 'MakeCallback' has been explicitly marked
deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/node.h:107:20: note: expanded from macro 'NODE_DEPRECATED'
attribute((deprecated(message))) declarator
^
In file included from ../src/batch.cc:3:
../node_modules/nan/nan.h:1533:28: error: no matching member function for call to 'Set'
New(persistentHandle)->Set(New(key).ToLocalChecked(), value);
~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:3547:37: note: candidate function not viable: requires 3
arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:3550:37: note: candidate function not viable: requires 3
arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^
In file included from ../src/batch.cc:3:
../node_modules/nan/nan.h:1539:28: error: no matching member function for call to 'Set'
New(persistentHandle)->Set(key, value);
~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:3547:37: note: candidate function not viable: requires 3
arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:3550:37: note: candidate function not viable: requires 3
arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^
In file included from ../src/batch.cc:3:
../node_modules/nan/nan.h:1545:28: error: no matching member function for call to 'Set'
New(persistentHandle)->Set(index, value);
~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:3547:37: note: candidate function not viable: requires 3
arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:3550:37: note: candidate function not viable: requires 3
arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^
In file included from ../src/batch.cc:3:
../node_modules/nan/nan.h:1551:32: error: no matching member function for call to 'Get'
New(persistentHandle)->Get(New(key).ToLocalChecked()));
~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:3594:43: note: candidate function not viable: requires 2
arguments, but 1 was provided
V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:3597:43: note: candidate function not viable: requires 2
arguments, but 1 was provided
V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
^
In file included from ../src/batch.cc:3:
../node_modules/nan/nan.h:1557:48: error: no matching member function for call to 'Get'
return scope.Escape(New(persistentHandle)->Get(key));
~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:3594:43: note: candidate function not viable: requires 2
arguments, but 1 was provided
V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:3597:43: note: candidate function not viable: requires 2
arguments, but 1 was provided
V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
^
In file included from ../src/batch.cc:3:
../node_modules/nan/nan.h:1562:48: error: no matching member function for call to 'Get'
return scope.Escape(New(persistentHandle)->Get(index));
~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:3594:43: note: candidate function not viable: requires 2
arguments, but 1 was provided
V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:3597:43: note: candidate function not viable: requires 2
arguments, but 1 was provided
V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
^
In file included from ../src/batch.cc:3:
In file included from ../node_modules/nan/nan.h:2222:
../node_modules/nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object,
v8::NonCopyablePersistentTraitsv8::Object >'
assert(persistent().IsNearDeath());
~~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note:
expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? _assert_rtn(func, FILE, LINE, #e) : (void)0)
^
In file included from ../src/batch.cc:3:
In file included from ../node_modules/nan/nan.h:2222:
../node_modules/nan/nan_object_wrap.h:67:18: error: no member named 'MarkIndependent' in 'Nan::Persistent<v8::Object,
v8::NonCopyablePersistentTraitsv8::Object >'
persistent().MarkIndependent();
~~~~~~~~~~~~ ^
../node_modules/nan/nan_object_wrap.h:124:26: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object,
v8::NonCopyablePersistentTraitsv8::Object >'
assert(wrap->handle
.IsNearDeath());
~~~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note:
expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(func, FILE, LINE, #e) : (void)0)
^
In file included from ../src/batch.cc:5:
In file included from ../src/database.h:18:
../src/leveldown.h:16:26: error: too few arguments to function call, single argument 'context' was not specified
return (!obj->ToObject().IsEmpty()
~~~~~~~~~~~~~ ^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:2754:3: note: 'ToObject' declared here
V8_WARN_UNUSED_RESULT MaybeLocal ToObject(
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8config.h:419:31: note: expanded from macro
'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT attribute((warn_unused_result))
^
In file included from ../src/batch.cc:5:
In file included from ../src/database.h:18:
../src/leveldown.h:17:48: error: too few arguments to function call, single argument 'context' was not specified
&& node::Buffer::HasInstance(obj->ToObject()))
~~~~~~~~~~~~~ ^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:2754:3: note: 'ToObject' declared here
V8_WARN_UNUSED_RESULT MaybeLocal ToObject(
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8config.h:419:31: note: expanded from macro
'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT attribute((warn_unused_result))
^
In file included from ../src/batch.cc:5:
In file included from ../src/database.h:18:
../src/leveldown.h:18:42: error: too few arguments to function call, single argument 'context' was not specified
? node::Buffer::Length(obj->ToObject())
~~~~~~~~~~~~~ ^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8.h:2754:3: note: 'ToObject' declared here
V8_WARN_UNUSED_RESULT MaybeLocal ToObject(
^
/Users/iamwlb/Library/Caches/node-gyp/13.12.0/include/node/v8config.h:419:31: note: expanded from macro
'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT attribute((warn_unused_result))
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
4 warnings and 20 errors generated.
make: *** [Release/obj.target/leveldown/src/batch.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.4.0
gyp ERR! command "/usr/local/Cellar/node/13.12.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
config.toml    buffers
gyp ERR! cwd /Users/iamwlb/node_modules/leveldown
gyp ERR! node -v v13.12.0
gyp ERR! node-gyp -v v5.0.5
config.toml    buffers
gyp ERR! not ok
npm WARN [email protected] requires a peer of gulp@^3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/leveldown):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: prebuild-install || node-gyp rebuild
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

3 packages are looking for funding
list.algolia.json    buffers
run npm fund for details

  ~/Documents/Workspace/hugo/blog   master !1 ?2 ············································· 49s  21:04:15  ─╮
❯ vim config.yaml ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?2 ·············································· 8s  21:07:37  ─╮
❯ vim config.toml ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?2 ·········································· 3m 44s  21:11:26  ─╮
❯ vim config.toml ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?2 ·········································· 1m 33s  21:13:23  ─╮
❯ cd layouts ─╯

  _default/      partials/      .DS_Store

  ~/Documents/Workspace/hugo/blog/layouts   master !1 ?2 ············································ 21:13:28  ─╮
❯ cd _default ─╯

  list.algolia.json

  ~/Documents/Workspace/hugo/blog/layouts/_default   master !1 ?2 ··································· 21:13:33  ─╮
❯ vim list.algolia.json ─╯

  ~/Documents/Workspace/hugo/blog/layouts/_default   master !1 ?2 ···························· 49s  21:14:28  ─╮
❯ cd .. ─╯

  _default/      partials/      .DS_Store

  ~/Documents/Workspace/hugo/blog/layouts   master !1 ?2 ············································ 21:14:35  ─╮
❯ cd .. ─╯

  .git/            data/           static/         config.toml
  archetypes/      layouts/        themes/         config.yaml
  content/         resources/      .DS_Store

  ~/Documents/Workspace/hugo/blog   master !1 ?2 ···················································· 21:14:37  ─╮
❯ rm -rf config.yaml ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ···················································· 21:14:49  ─╮
❯ huxo server ─╯
zsh: command not found: huxo

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ···················································· 21:15:01  ─╮
❯ hugo server ─╯
Building sites … WARN 2020/04/10 21:15:07 "/Users/iamwlb/Documents/Workspace/hugo/blog/content/resoure.md:1:1": duplicate menu entry with identifier "About" in menu "main"

               | EN

-------------------+------
Pages | 923
Paginator pages | 68
Non-page files | 0
Static files | 47
Processed images | 0
Aliases | 319
Sitemaps | 1
Cleaned | 0

Built in 1306 ms
Watching for changes in /Users/iamwlb/Documents/Workspace/hugo/blog/{archetypes,content,data,layouts,static,themes}
Watching for config changes in /Users/iamwlb/Documents/Workspace/hugo/blog/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
^C%

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ············································· 36s  21:15:43  ─╮
❯ hugo server -D ─╯
Building sites … WARN 2020/04/10 21:15:46 "/Users/iamwlb/Documents/Workspace/hugo/blog/content/resoure.md:1:1": duplicate menu entry with identifier "About" in menu "main"

               | EN

-------------------+------
Pages | 923
Paginator pages | 68
Non-page files | 0
Static files | 47
Processed images | 0
Aliases | 319
Sitemaps | 1
Cleaned | 0

Built in 1308 ms
Watching for changes in /Users/iamwlb/Documents/Workspace/hugo/blog/{archetypes,content,data,layouts,static,themes}
Watching for config changes in /Users/iamwlb/Documents/Workspace/hugo/blog/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
^C%

  ~/Documents/Workspace/hugo/blog   master !1 ?1 ·········································· 3m 32s  21:19:18  ─╮
❯ hugo ─╯
Building sites … WARN 2020/04/10 21:19:20 "/Users/iamwlb/Documents/Workspace/hugo/blog/content/resoure.md:1:1": duplicate menu entry with identifier "About" in menu "main"

               | EN

-------------------+------
Pages | 923
Paginator pages | 68
Non-page files | 0
Static files | 47
Processed images | 0
Aliases | 319
Sitemaps | 1
Cleaned | 0

Total in 1974 ms

  ~/Documents/Workspace/hugo/blog   master !1 ?2 ···················································· 21:19:22  ─╮
❯ ls ─╯
archetypes config.toml content data layouts public resources static themes

  ~/Documents/Workspace/hugo/blog   master !1 ?2 ···················································· 21:19:30  ─╮
❯ ls ─╯
archetypes config.toml content data layouts public resources static themes

  ~/Documents/Workspace/hugo/blog   master !1 ?2 ···················································· 21:27:59  ─╮
❯ npm init ─╯
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See npm help json for definitive documentation on these fields
and exactly what they do.

Use npm install <pkg> afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (blog)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository: (https://e.coding.net/wanglibing/hugo.git)
keywords:
author:
license: (ISC)
About to write to /Users/iamwlb/Documents/Workspace/hugo/blog/package.json:

{
"name": "blog",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"repository": {
"type": "git",
"url": "https://e.coding.net/wanglibing/hugo.git"
},
"author": "",
"license": "ISC"
}

Is this OK? (yes) yes

  ~/Documents/Workspace/hugo/blog   master !1 ?3 ············································· 29s  21:28:31  ─╮
❯ npm install atomic-algolia --save ─╯
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

[email protected] install /Users/iamwlb/Documents/Workspace/hugo/blog/node_modules/fsevents
node-gyp rebuild

SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
SOLINK_MODULE(target) Release/fse.node

[email protected] postinstall /Users/iamwlb/Documents/Workspace/hugo/blog/node_modules/core-js
node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
package.json    buffers

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:

https://opencollective.com/core-js
https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

npm notice created a lockfile as package-lock.json. You should commit this file.
.env    buffers
npm WARN [email protected] No description

6 packages are looking for funding
run npm fund for details

  ~/Documents/Workspace/hugo/blog   master !1 ?5 ············································· 27s  21:29:05  ─╮
❯ ls ─╯
archetypes content layouts package-lock.json public static
config.toml data node_modules package.json resources themes

  ~/Documents/Workspace/hugo/blog   master !1 ?5 ···················································· 21:29:12  ─╮
❯ vim package.json ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?5 ·········································· 1m 41s  21:31:01  ─╮
❯ ls ─╯
archetypes content layouts package-lock.json public static
config.toml data node_modules package.json resources themes

  ~/Documents/Workspace/hugo/blog   master !1 ?5 ···················································· 21:31:06  ─╮
❯ vim .env ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?6 ·········································· 1m 11s  21:32:22  ─╮
❯ npm run algolia ─╯

[email protected] algolia /Users/iamwlb/Documents/Workspace/hugo/blog
atomic-algolia

/Users/iamwlb/Documents/Workspace/hugo/blog/node_modules/atomic-algolia/lib/utils/getRemoteIndex.js:61
content.hits.forEach(function (hit) {
^

TypeError: Cannot read property 'hits' of undefined
at Object.browseDone [as callback] (/Users/iamwlb/Documents/Workspace/hugo/blog/node_modules/atomic-algolia/lib/utils/getRemoteIndex.js:61:15)
at Timeout._onTimeout (/Users/iamwlb/Documents/Workspace/hugo/blog/node_modules/algoliasearch/src/AlgoliaSearchCore.js:487:23)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] algolia: atomic-algolia
.env    buffers
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] algolia script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/iamwlb/.npm/_logs/2020-04-10T13_32_44_310Z-debug.log

  ~/Documents/Workspace/hugo/blog   master !1 ?6 ·············································· 7s  21:32:44  ─╮
❯ vim /Users/iamwlb/.npm/_logs/2020-04-10T13_32_44_310Z-debug.log ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?6 ············································· 39s  21:34:01  ─╮
❯ vim package.json ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?6 ·········································· 1m 17s  21:35:33  ─╮
❯ vs package.json ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?6 ···················································· 21:35:43  ─╮
❯ ls ─╯
archetypes content layouts package-lock.json public static
config.toml data node_modules package.json resources themes

  ~/Documents/Workspace/hugo/blog   master !1 ?6 ···················································· 21:37:04  ─╮
❯ vim .env ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?6 ············································· 53s  21:38:09  ─╮
❯ npm run algolia ─╯

[email protected] algolia /Users/iamwlb/Documents/Workspace/hugo/blog
atomic-algolia

/Users/iamwlb/Documents/Workspace/hugo/blog/node_modules/atomic-algolia/lib/utils/getRemoteIndex.js:61
content.hits.forEach(function (hit) {
^

TypeError: Cannot read property 'hits' of undefined
at Object.browseDone [as callback] (/Users/iamwlb/Documents/Workspace/hugo/blog/node_modules/atomic-algolia/lib/utils/getRemoteIndex.js:61:15)
at Timeout._onTimeout (/Users/iamwlb/Documents/Workspace/hugo/blog/node_modules/algoliasearch/src/AlgoliaSearchCore.js:487:23)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] algolia: atomic-algolia
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] algolia script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/iamwlb/.npm/_logs/2020-04-10T13_38_21_241Z-debug.log

  ~/Documents/Workspace/hugo/blog   master !1 ?6 ·············································· 4s  21:38:21  ─╮
❯ npm install ─╯
npm WARN [email protected] No description

up to date in 2.125s

6 packages are looking for funding
run npm fund for details

  ~/Documents/Workspace/hugo/blog   master !1 ?6 ···················································· 21:40:37  ─╮
❯ npm run algolia ─╯

[email protected] algolia /Users/iamwlb/Documents/Workspace/hugo/blog
/.n/_/2020-04-10T13_40_44_899Z-debug.log    buffers
1 0 info it worked if it ends with ok
2 1 verbose cli [
3 1 verbose cli '/usr/local/Cellar/node/13.12.0/bin/node',
4 1 verbose cli '/usr/local/bin/npm',
5 1 verbose cli 'run',
6 1 verbose cli 'algolia'
7 1 verbose cli ]
8 2 info using [email protected]
9 3 info using [email protected]
10 4 verbose run-script [ 'prealgolia', 'algolia', 'postalgolia' ]
11 5 info lifecycle [email protected]
prealgolia: [email protected]
12 6 info lifecycle [email protected]algolia: [email protected]
13 7 verbose lifecycle [email protected]
algolia: unsafe-perm in lifecycle true
14 8 verbose lifecycle [email protected]algolia: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Us ers/iamwlb/Documents/Workspace/hugo/blog/node_modules/.bin:/usr/local/Cellar/zplug/2.4.2/bin:/Users/iamwlb/development/fl utter/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/iamwlb/Documents/Workspace/go/src/github.com/cosmt rek/air/bin/darwin:/usr/local/opt/openresty/nginx/sbin:/usr/local/mysql/bin:/usr/local/maven/bin:/usr/local/opt/icu4c/sbi n:/usr/local/opt/icu4c/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Applications/Wireshark.ap p/Contents/MacOS:/Users/iamwlb/Documents/Workspace/go/bin:/Users/iamwlb/Library/Android/sdk//platform-tools:/Users/iamwlb /Library/Android/sdk//tools
15 9 verbose lifecycle [email protected]
algolia: CWD: /Users/iamwlb/Documents/Workspace/hugo/blog
16 10 silly lifecycle [email protected]algolia: Args: [ '-c', 'atomic-algolia' ]
NORMAL  /Users/iamwlb/.npm/_logs/2020-04-10T13_40_44_899Z-debug.log    utf-8   2% ☰ 1/39  : 1 
"
/.npm/_logs/2020-04-10T13_40_44_899Z-debug.log" 39L, 2730C
atomic-algolia

/Users/iamwlb/Documents/Workspace/hugo/blog/node_modules/atomic-algolia/lib/utils/getRemoteIndex.js:61
content.hits.forEach(function (hit) {
^

TypeError: Cannot read property 'hits' of undefined
at Object.browseDone [as callback] (/Users/iamwlb/Documents/Workspace/hugo/blog/node_modules/atomic-algolia/lib/utils/getRemoteIndex.js:61:15)
at Timeout._onTimeout (/Users/iamwlb/Documents/Workspace/hugo/blog/node_modules/algoliasearch/src/AlgoliaSearchCore.js:487:23)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] algolia: atomic-algolia
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] algolia script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/iamwlb/.npm/_logs/2020-04-10T13_40_44_899Z-debug.log

  ~/Documents/Workspace/hugo/blog   master !1 ?6 ···················································· 21:40:44  ─╮
❯ vim /Users/iamwlb/.npm/_logs/2020-04-10T13_40_44_899Z-debug.log ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?6 ····························································································· 2m 31s  21:44:37  ─╮
❯ ls ─╯
archetypes content layouts package-lock.json public static
config.toml data node_modules package.json resources themes
.env    buffers

  ~/Documents/Workspace/hugo/blog   master !1 ?6 ······································································································· 21:44:39  ─╮
❯ l ─╯
total 328
drwxr-xr-x 17 iamwlb staff 544B 4 10 21:32 .
drwxr-xr-x@ 4 iamwlb staff 128B 4 10 14:20 ..
-rw-r--r--@ 1 iamwlb staff 8.0K 4 10 18:30 .DS_Store
-rw-r--r-- 1 iamwlb staff 145B 4 10 21:38 .env
drwxr-xr-x 12 iamwlb staff 384B 4 10 21:42 .git
drwxr-xr-x 3 iamwlb staff 96B 4 10 14:20 archetypes
-rw-r--r-- 1 iamwlb staff 12K 4 10 21:13 config.toml
drwxr-xr-x 6 iamwlb staff 192B 4 10 18:53 content
drwxr-xr-x 2 iamwlb staff 64B 4 10 14:20 data
drwxr-xr-x 5 iamwlb staff 160B 4 10 21:01 layouts
drwxr-xr-x 189 iamwlb staff 5.9K 4 10 21:29 node_modules
-rw-r--r-- 1 iamwlb staff 127K 4 10 21:29 package-lock.json
-rw-r--r-- 1 iamwlb staff 386B 4 10 21:35 package.json
drwxr-xr-x 29 iamwlb staff 928B 4 10 21:19 public
drwxr-xr-x 3 iamwlb staff 96B 4 10 14:25 resources
drwxr-xr-x 2 iamwlb staff 64B 4 10 14:20 static
drwxr-xr-x 4 iamwlb staff 128B 4 10 18:56 themes

  ~/Documents/Workspace/hugo/blog   master !1 ?6 ······································································································· 21:44:40  ─╮
❯ rm -rf .env ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?5 ······································································································· 21:44:47  ─╮
❯ l ─╯
total 320
drwxr-xr-x 16 iamwlb staff 512B 4 10 21:44 .
.env    buffers
drwxr-xr-x@ 4 iamwlb staff 128B 4 10 14:20 ..
-rw-r--r--@ 1 iamwlb staff 8.0K 4 10 18:30 .DS_Store
drwxr-xr-x 12 iamwlb staff 384B 4 10 21:42 .git
drwxr-xr-x 3 iamwlb staff 96B 4 10 14:20 archetypes
-rw-r--r-- 1 iamwlb staff 12K 4 10 21:13 config.toml
drwxr-xr-x 6 iamwlb staff 192B 4 10 18:53 content
drwxr-xr-x 2 iamwlb staff 64B 4 10 14:20 data
drwxr-xr-x 5 iamwlb staff 160B 4 10 21:01 layouts
drwxr-xr-x 189 iamwlb staff 5.9K 4 10 21:29 node_modules
-rw-r--r-- 1 iamwlb staff 127K 4 10 21:29 package-lock.json
-rw-r--r-- 1 iamwlb staff 386B 4 10 21:35 package.json
drwxr-xr-x 29 iamwlb staff 928B 4 10 21:19 public
drwxr-xr-x 3 iamwlb staff 96B 4 10 14:25 resources
drwxr-xr-x 2 iamwlb staff 64B 4 10 14:20 static
drwxr-xr-x 4 iamwlb staff 128B 4 10 18:56 themes

  ~/Documents/Workspace/hugo/blog   master !1 ?5 ······································································································· 21:44:49  ─╮
❯ vim .env ─╯

  ~/Documents/Workspace/hugo/blog   master !1 ?6 ····························································································· 1m 44s  21:46:40  ─╮
❯ npm run algolia ─╯

[email protected] algolia /Users/iamwlb/Documents/Workspace/hugo/blog
atomic-algolia

/Users/iamwlb/Documents/Workspace/hugo/blog/node_modules/atomic-algolia/lib/utils/getRemoteIndex.js:61
content.hits.forEach(function (hit) {
^

/.n/_/2020-04-10T13_47_23_917Z-debug.log    buffers
1 0 info it worked if it ends with ok
2 1 verbose cli [
3 1 verbose cli '/usr/local/Cellar/node/13.12.0/bin/node',
4 1 verbose cli '/usr/local/bin/npm',
5 1 verbose cli 'run',
6 1 verbose cli 'algolia'
7 1 verbose cli ]
8 2 info using [email protected]
9 3 info using [email protected]
10 4 verbose run-script [ 'prealgolia', 'algolia', 'postalgolia' ]
11 5 info lifecycle [email protected]
prealgolia: [email protected]
12 6 info lifecycle [email protected]algolia: [email protected]
13 7 verbose lifecycle [email protected]
algolia: unsafe-perm in lifecycle true
14 8 verbose lifecycle [email protected]algolia: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/iamwlb/Documents/Workspace/hugo/blog/node_modul es/.bin:/usr/local/Cellar/zplug/2.4.2/bin:/Users/iamwlb/development/flutter/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/iamwlb/Documents/Workspace/go/s rc/github.com/cosmtrek/air/bin/darwin:/usr/local/opt/openresty/nginx/sbin:/usr/local/mysql/bin:/usr/local/maven/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/ local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/Users/iamwlb/Documents/Workspace/go/bin:/Users/iamwlb/Library/And roid/sdk//platform-tools:/Users/iamwlb/Library/Android/sdk//tools
15 9 verbose lifecycle [email protected]
algolia: CWD: /Users/iamwlb/Documents/Workspace/hugo/blog
16 10 silly lifecycle [email protected]algolia: Args: [ '-c', 'atomic-algolia' ]
17 11 silly lifecycle [email protected]
algolia: Returned: code: 1 signal: null
18 12 info lifecycle [email protected]algolia: Failed to exec algolia script
19 13 verbose stack Error: [email protected] algolia: atomic-algolia
20 13 verbose stack Exit status 1
21 13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
22 13 verbose stack at EventEmitter.emit (events.js:315:20)
23 13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
24 13 verbose stack at ChildProcess.emit (events.js:315:20)
25 13 verbose stack at maybeClose (internal/child_process.js:1026:16)
26 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
27 14 verbose pkgid [email protected]
28 15 verbose cwd /Users/iamwlb/Documents/Workspace/hugo/blog
29 16 verbose Darwin 19.4.0
30 17 verbose argv "/usr/local/Cellar/node/13.12.0/bin/node" "/usr/local/bin/npm" "run" "algolia"
31 18 verbose node v13.12.0
32 19 verbose npm v6.13.4
33 20 error code ELIFECYCLE
34 21 error errno 1
35 22 error [email protected] algolia: atomic-algolia
36 22 error Exit status 1
37 23 error Failed at the [email protected] algolia script.
38 23 error This is probably not a problem with npm. There is likely additional logging output above.
39 24 verbose exit [ 1, true ]
~
~
NORMAL  /Users/iamwlb/.npm/_logs/2020-04-10T13_47_23_917Z-debug.log    utf-8   35% ☰ 14/39  : 1 
"
/.npm/_logs/2020-04-10T13_47_23_917Z-debug.log" 39L, 2730C

Cannot find module 'source-map-support/register'

Given I update atomic-algolia package from 0.3.12 to 0.3.13
When I run npm run algolia
Then the following error message is displayed:

> atomic-algolia

internal/modules/cjs/loader.js:550
    throw err;
    ^

Error: Cannot find module 'source-map-support/register'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.Module._load (internal/modules/cjs/loader.js:475:25)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.<anonymous> (/Users/frank/code/jamstatic.fr/node_modules/atomic-algolia/lib/index.js:4:1)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'sort' of undefined

Output:

> [email protected] algolia /path/to/project
> atomic-algolia

(node:42184) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'sort' of undefined
    at idsFromIndex (/usr/local/lib/node_modules/atomic-algolia/lib/utils/idsFromIndex.js:15:9)
    at calculateOperations (/usr/local/lib/node_modules/atomic-algolia/lib/utils/calculateOperations.js:23:23)
    at /usr/local/lib/node_modules/atomic-algolia/lib/update.js:34:30
(node:42184) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id:1)
(node:42184) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Part of my algolia.json, I can post the full json if you need it:

[
      {
        "title": "测试用文档",
        "permalink": "http://0.0.0.0:4321/docs/test-doc/",
        "link": "/docs/test-doc/",
        "url": "/docs/test-doc/",
        "date": null,
        
          "modified": "2018-08-31T23:43:53+08:00",
        
        "author": {
          "name": "OpenBayes",
          "url": "https://openbayes.com/",
          "email": "[email protected]"
        },
        "html": "<h2 id=\"准备\">准备</h2>\n\n<h3 id=\"安装-kubectl\">安装 <code class=\"highlighter-rouge\">kubectl</code></h3>\n\n<p>在 mac 下:</p>\n\n<div class=\"highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>brew install kubectl\n</code></pre></div></div>\n\n<p>更多系统安装方式见 <a href=\"https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl\">Install and Set Up kubectl | Kubernetes</a>。</p>\n\n<p>执行 <code class=\"highlighter-rouge\">kubectl version --client</code> 测试 <code class=\"highlighter-rouge\">kubectl</code> 安装成功。</p>\n\n<div class=\"language-shell highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$ </span>kubectl version <span class=\"nt\">--client</span>\n\nClient Version: version.Info<span class=\"o\">{</span>Major:<span class=\"s2\">\"1\"</span>, Minor:<span class=\"s2\">\"10\"</span>, GitVersion:<span class=\"s2\">\"v1.10.0\"</span>, GitCommit:<span class=\"s2\">\"fc32d2f3698e36b93322a3465f63a14e9f0eaead\"</span>, GitTreeState:<span class=\"s2\">\"clean\"</span>, BuildDate:<span class=\"s2\">\"2018-03-27T00:13:02Z\"</span>, GoVersion:<span class=\"s2\">\"go1.9.4\"</span>, Compiler:<span class=\"s2\">\"gc\"</span>, Platform:<span class=\"s2\">\"darwin/amd64\"</span><span class=\"o\">}</span>\n</code></pre></div></div>\n\n<h3 id=\"获取-adminconf\">获取 <code class=\"highlighter-rouge\">admin.conf</code></h3>\n\n<p>如果没有 kubernetes master 的登录权限,请向 Kubernetes 管理员索要 <code class=\"highlighter-rouge\">admin.conf</code> 文件并命名为 <code class=\"highlighter-rouge\">~/.kube/config</code>。</p>\n\n<p>如果有 kubernetes master 登录权限,将 <code class=\"highlighter-rouge\">/etc/kubernetes/admin.conf</code> 拷贝到本地 <code class=\"highlighter-rouge\">~/.kube</code> 并重命名为 <code class=\"highlighter-rouge\">config</code>。<strong>注意</strong>,如果<code class=\"highlighter-rouge\">admin.conf</code> 下 <code class=\"highlighter-rouge\">clusters.cluster.server</code> 的地址为内网地址(如 aws 环境下的默认 ip 地址)而不是公网可以访问的外网地址,需要将其修改为外网地址才能从本地访问集群。</p>\n\n<p>执行命令 <code class=\"highlighter-rouge\">kubectl cluster-info</code> 测试集群链接成功。</p>\n\n<div class=\"language-shell highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$ </span>kubectl cluster-info\n\nKubernetes master is running at https://xxxx:6443\nKubeDNS is running at https://xxxx:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy\n\nTo further debug and diagnose cluster problems, use <span class=\"s1\">'kubectl cluster-info dump'</span><span class=\"nb\">.</span>\n</code></pre></div></div>\n\n<h2 id=\"用-kubectl-部署-tf-job\">用 kubectl 部署 tf-job</h2>\n\n<h3 id=\"准备-docker\">准备 docker</h3>\n\n<p>参见 <a href=\"https://github.com/kubeflow/tf-operator/tree/master/examples/tf_sample\">tf-operator/examples/tf_sample at master · kubeflow/tf-operator · GitHub</a> 准备模型训练所使用的 docker,其中应当包含:</p>\n\n<ol>\n  <li>训练数据的下载</li>\n  <li>数据的预处理</li>\n  <li>模型的训练</li>\n  <li>模型的保存和上传</li>\n</ol>\n\n<p><strong>注意</strong> 目前,kubeflow 集群不提供任何的存储服务,而只提供计算资源。一个训练使用的 docker 内需要提供数据的下载以及模型的上传,与 s3 等存储服务的对接将在近期展开。</p>\n\n<h3 id=\"部署-tf-job\">部署 tf-job</h3>\n\n<p>创建 <code class=\"highlighter-rouge\">tf_sample.yaml</code>:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">apiVersion</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">kubeflow.org/v1alpha1\"</span>\n<span class=\"na\">kind</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">TFJob\"</span>\n<span class=\"na\">metadata</span><span class=\"pi\">:</span>\n  <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">example-job\"</span>\n<span class=\"na\">spec</span><span class=\"pi\">:</span>\n  <span class=\"na\">replicaSpecs</span><span class=\"pi\">:</span>\n    <span class=\"pi\">-</span> <span class=\"na\">replicas</span><span class=\"pi\">:</span> <span class=\"s\">1</span>\n      <span class=\"na\">tfReplicaType</span><span class=\"pi\">:</span> <span class=\"s\">MASTER</span>\n      <span class=\"na\">template</span><span class=\"pi\">:</span>\n        <span class=\"na\">spec</span><span class=\"pi\">:</span>\n          <span class=\"na\">containers</span><span class=\"pi\">:</span>\n            <span class=\"pi\">-</span> <span class=\"na\">image</span><span class=\"pi\">:</span> <span class=\"s\">eisenxu/tf_sample:d4ef871-dirty-991dde4</span>\n              <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">tensorflow</span>\n          <span class=\"na\">restartPolicy</span><span class=\"pi\">:</span> <span class=\"s\">Never</span>\n    <span class=\"pi\">-</span> <span class=\"na\">replicas</span><span class=\"pi\">:</span> <span class=\"s\">1</span>\n      <span class=\"na\">tfReplicaType</span><span class=\"pi\">:</span> <span class=\"s\">WORKER</span>\n      <span class=\"na\">template</span><span class=\"pi\">:</span>\n        <span class=\"na\">spec</span><span class=\"pi\">:</span>\n          <span class=\"na\">containers</span><span class=\"pi\">:</span>\n            <span class=\"pi\">-</span> <span class=\"na\">image</span><span class=\"pi\">:</span> <span class=\"s\">eisenxu/tf_sample:d4ef871-dirty-991dde4</span>\n              <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">tensorflow</span>\n          <span class=\"na\">restartPolicy</span><span class=\"pi\">:</span> <span class=\"s\">Never</span>\n    <span class=\"pi\">-</span> <span class=\"na\">replicas</span><span class=\"pi\">:</span> <span class=\"s\">2</span>\n      <span class=\"na\">tfReplicaType</span><span class=\"pi\">:</span> <span class=\"s\">PS</span>\n      <span class=\"na\">template</span><span class=\"pi\">:</span>\n        <span class=\"na\">spec</span><span class=\"pi\">:</span>\n          <span class=\"na\">containers</span><span class=\"pi\">:</span>\n            <span class=\"pi\">-</span> <span class=\"na\">image</span><span class=\"pi\">:</span> <span class=\"s\">eisenxu/tf_sample:d4ef871-dirty-991dde4</span>\n              <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">tensorflow</span>\n          <span class=\"na\">restartPolicy</span><span class=\"pi\">:</span> <span class=\"s\">Never</span>\n</code></pre></div></div>\n\n<p>执行命令部署 tfjob</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl <span class=\"nt\">-f</span> tf_sample.yaml\n</code></pre></div></div>\n\n<p>通过命令</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl get <span class=\"nt\">-o</span> yaml tfjobs example-job\n</code></pre></div></div>\n\n<p>查看任务执行进度。</p>\n\n<p>更多有关创建 tfjob 的细节请见 <a href=\"https://github.com/kubeflow/tf-operator/blob/master/README.md\">tf-operator/README.md at master · kubeflow/tf-operator · GitHub</a>。</p>\n\n<h2 id=\"参考\">参考</h2>\n\n<ol>\n  <li><a href=\"https://kubernetes.io/\">Kubernetes | Production-Grade Container Orchestration</a></li>\n  <li><a href=\"https://github.com/kubeflow/kubeflow/blob/master/user_guide.md#submitting-a-tensorflow-training-job\">kubeflow/user_guide.md at master · kubeflow/kubeflow · GitHub</a></li>\n  <li><a href=\"https://www.youtube.com/watch?v=xMaCC3uzBU8\">KubeFlow CPU/GPU Demo</a></li>\n</ol>",
        "content": "准备\n\n安装 kubectl\n\n在 mac 下:\n\nbrew install kubectl\n\n\n更多系统安装方式见 Install and Set Up kubectl | Kubernetes。\n\n执行 kubectl version --client 测试 kubectl 安装成功。\n\n$ kubectl version --client\n\nClient Version: version.Info{Major:\"1\", Minor:\"10\", GitVersion:\"v1.10.0\", GitCommit:\"fc32d2f3698e36b93322a3465f63a14e9f0eaead\", GitTreeState:\"clean\", BuildDate:\"2018-03-27T00:13:02Z\", GoVersion:\"go1.9.4\", Compiler:\"gc\", Platform:\"darwin/amd64\"}\n\n\n获取 admin.conf\n\n如果没有 kubernetes master 的登录权限,请向 Kubernetes 管理员索要 admin.conf 文件并命名为 ~/.kube/config。\n\n如果有 kubernetes master 登录权限,将 /etc/kubernetes/admin.conf 拷贝到本地 ~/.kube 并重命名为 config。注意,如果admin.conf 下 clusters.cluster.server 的地址为内网地址(如 aws 环境下的默认 ip 地址)而不是公网可以访问的外网地址,需要将其修改为外网地址才能从本地访问集群。\n\n执行命令 kubectl cluster-info 测试集群链接成功。\n\n$ kubectl cluster-info\n\nKubernetes master is running at https://xxxx:6443\nKubeDNS is running at https://xxxx:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy\n\nTo further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.\n\n\n用 kubectl 部署 tf-job\n\n准备 docker\n\n参见 tf-operator/examples/tf_sample at master · kubeflow/tf-operator · GitHub 准备模型训练所使用的 docker,其中应当包含:\n\n\n  训练数据的下载\n  数据的预处理\n  模型的训练\n  模型的保存和上传\n\n\n注意 目前,kubeflow 集群不提供任何的存储服务,而只提供计算资源。一个训练使用的 docker 内需要提供数据的下载以及模型的上传,与 s3 等存储服务的对接将在近期展开。\n\n部署 tf-job\n\n创建 tf_sample.yaml:\n\napiVersion: \"kubeflow.org/v1alpha1\"\nkind: \"TFJob\"\nmetadata:\n  name: \"example-job\"\nspec:\n  replicaSpecs:\n    - replicas: 1\n      tfReplicaType: MASTER\n      template:\n        spec:\n          containers:\n            - image: eisenxu/tf_sample:d4ef871-dirty-991dde4\n              name: tensorflow\n          restartPolicy: Never\n    - replicas: 1\n      tfReplicaType: WORKER\n      template:\n        spec:\n          containers:\n            - image: eisenxu/tf_sample:d4ef871-dirty-991dde4\n              name: tensorflow\n          restartPolicy: Never\n    - replicas: 2\n      tfReplicaType: PS\n      template:\n        spec:\n          containers:\n            - image: eisenxu/tf_sample:d4ef871-dirty-991dde4\n              name: tensorflow\n          restartPolicy: Never\n\n\n执行命令部署 tfjob\n\nkubectl -f tf_sample.yaml\n\n\n通过命令\n\nkubectl get -o yaml tfjobs example-job\n\n\n查看任务执行进度。\n\n更多有关创建 tfjob 的细节请见 tf-operator/README.md at master · kubeflow/tf-operator · GitHub。\n\n参考\n\n\n  Kubernetes | Production-Grade Container Orchestration\n  kubeflow/user_guide.md at master · kubeflow/kubeflow · GitHub\n  KubeFlow CPU/GPU Demo",
        "excerpt_html": "<h2 id=\"准备\">准备</h2>",
        "excerpt_text": "准备",
        "languages": null,
        "categories": [],
        "custom_ranking": {
          "position": null,
          "heading": null
        },
        "tags": [],
        "type": "doc"
      }

...
$ node -v
v10.9.0

[BUG] Changes in sub item not considered

Description

I have a structure with sub items, like this:

[
    {
        "objectID": "1",
        "title": "An example record",
        "illustration": {
          "src": "https://example.com/image1.png",
          "alt": "my beautiful image"
        }
    }
]

If I change only the illustration's src or alt, atomic-algolia considers there is no change.

Steps to reproduce

Scenario: I have a structure with sub items
Given I have a structure with sub items,
When I update deep content but not first level content,
Then atomic-algolia considers there's no change,

System information

atomic-algolia version: 0.3.19

node version: 13.14.0

npm version: 6.14.8

system OS: macOS

system OS version: 10.15.6

Notes

N/A

getRemoteIndex does not seem to resolve on > 1000 entries indices

It seems getRemoteIndex does not resolve with indices holding over 1000 entries.

Therefore, oldIndex remains undefined and the script will then assume there is no entry in the oldIndex and push every entries from the newIndex to Algolia without checking for changes first.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.