feat: export data into dist folder for easier debugging during dev
This commit is contained in:
Родитель
1d592fd9e6
Коммит
ffcd83b74c
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1 @@
|
|||
module.exports = require('require-directory')(module, './dist')
|
|
@ -6,16 +6,21 @@
|
|||
"repository": "https://github.com/electron/algolia-indices",
|
||||
"author": "zeke",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"echo": "script/echo.js",
|
||||
"build": "script/build.js",
|
||||
"preupload": "npm run test",
|
||||
"upload": "script/upload.js",
|
||||
"update": "script/update.sh",
|
||||
"pretest": "npm run build",
|
||||
"test": "tape test.js | tap-spec && standard --fix",
|
||||
"lint": "standard --fix",
|
||||
"start": "budo demo.js --live --no-debug --open --css demo.css",
|
||||
"repl": "local-repl"
|
||||
},
|
||||
"dependencies": {
|
||||
"require-directory": "^2.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"algoliasearch": "^3.27.1",
|
||||
"budo": "^11.2.0",
|
||||
|
@ -32,7 +37,6 @@
|
|||
"lodash": "^4.17.10",
|
||||
"nanohtml": "^1.2.4",
|
||||
"prettier-standard": "^8.0.1",
|
||||
"require-directory": "^2.1.1",
|
||||
"standard": "^11.0.1",
|
||||
"tap-spec": "^4.1.1",
|
||||
"tape": "^4.9.0"
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const indices = require('../indices')
|
||||
|
||||
Object.keys(indices).forEach(key => {
|
||||
fs.writeFileSync(
|
||||
path.join(__dirname, `../dist/${key}.json`),
|
||||
JSON.stringify(indices[key], null, 2)
|
||||
)
|
||||
})
|
|
@ -1,3 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
process.stdout.write(JSON.stringify(require('../indices'), null, 2))
|
5
test.js
5
test.js
|
@ -1,8 +1,13 @@
|
|||
const test = require('tape')
|
||||
const isURL = require('is-url')
|
||||
const indices = require('./indices')
|
||||
const exportedIndices = require('.')
|
||||
|
||||
test('electron-search', t => {
|
||||
// ensure the object exported by `require('electron-algolia-indices')`
|
||||
// is the same as what we are testing in this file
|
||||
t.deepEqual(indices, exportedIndices, 'exports and indices object')
|
||||
|
||||
// All Indices
|
||||
// ----------------------------------------------------------------------
|
||||
const indexNames = ['apis', 'apps', 'packages', 'tutorials']
|
||||
|
|
Загрузка…
Ссылка в новой задаче