eklem / designing-with-search-data

Plugin for Adobe XD - A search engine running inside XD to easily populate your search application design.
MIT License
3 stars 0 forks source link

Make search-index work with memdown #4

Closed eklem closed 5 years ago

eklem commented 6 years ago

Todo:

eklem commented 6 years ago

It may be as simple as referencing both scripts since search-index refer to indexeddb, but not sure if I need to browserify fake-indexeddb.

eklem commented 6 years ago

Hmm, seems indexedDBShim is already browserified, so I'll start with that.

eklem commented 5 years ago

Need to be webpack or rollup. I'll start with webpack. If search-index could be a dependency and then altered so that indexedDBShim is a sub dep it would only take one webpack-step to get it working.

eklem commented 5 years ago

So, search-index with the indexedDBShim dependency, webpack'ed and running inside the XD plugin with one

const si = require('./search-index.js')

Here's how make it build automatically from package.json, and an example on how it can work from the xd-template-project.

eklem commented 5 years ago

Search-index test with working memdown example.

eklem commented 5 years ago

Try to webpack something like this:

import encode from 'encoding-down'
import fii from 'fergies-inverted-index'
import levelup from 'levelup'
import memdown from 'memdown'
import si from '../../dist/search-index.esm.js'

levelup(encode(memdown('myDB'), {
  valueEncoding: 'json'
}), (err, store) => {
  t.error(err)
  db = si({
    fii: fii({ store: store })
  })
})
eklem commented 5 years ago

Got it working w/memdown in the browser

eklem commented 5 years ago

Error in XD because of eval. Try the configuration file from one of the boilerplate projects.

eklem commented 5 years ago

https://github.com/pklaschka/xd-plugin-boilerplate/blob/master/webpack.config.js

Or just base it on the he boilerplate...

eklem commented 5 years ago

Need to use sval to skip evaluse. Check out @kerrishotts pointers at Adobe XD Platform forums

eklem commented 5 years ago

Skip sval and see if webpack with --devtool false works. If so, I think it's a matter of setting up the Adobe XD plugin correctly.

eklem commented 5 years ago

Now, this needs to happen in XD plugin environment =)