diff --git a/client/publisher/app.js b/client/publisher/app.js index ac92a5a..a79e40e 100644 --- a/client/publisher/app.js +++ b/client/publisher/app.js @@ -1,5 +1,5 @@ import { substanceGlobals } from 'substance' -import { Archivist, ArchivistConfigurator } from 'archivist' +import { Archivist, ArchivistConfigurator } from 'archivist-js' import Package from './package' substanceGlobals.DEBUG_RENDERING = true; diff --git a/client/publisher/package.js b/client/publisher/package.js index 013db78..023f63a 100644 --- a/client/publisher/package.js +++ b/client/publisher/package.js @@ -1,5 +1,5 @@ import { ProseEditorPackage } from 'substance' -import { ArchivistPackage, ArchivistSubConfigurator, CommentsPackage, DocumentsPackage, IndentationPackage, MetadataEditorPackage, ResourcesPackage, TimecodeAnnotatorPackage, UsersPackage, WhitespacePackage } from 'archivist' +import { ArchivistPackage, ArchivistSubConfigurator, CommentsPackage, DocumentsPackage, IndentationPackage, MetadataEditorPackage, ResourcesPackage, TimecodeAnnotatorPackage, UsersPackage, WhitespacePackage } from 'archivist-js' import InterviewPackage from '../../packages/interview/package' import FormsPackage from '../../packages/forms/package' import DefinitionManagerPackage from '../../packages/definition-manager/package' diff --git a/config/default.json b/config/default.json index c7e4417..b6fa020 100644 --- a/config/default.json +++ b/config/default.json @@ -20,4 +20,4 @@ "sender": "archivist@archivist" }, "db_url": "postgres://archivist_user:archivist_pw@localhost:5432/archivist" -} \ No newline at end of file +} diff --git a/import.js b/import.js index 02ef99e..ee8e312 100644 --- a/import.js +++ b/import.js @@ -14,7 +14,7 @@ let uniq = require('lodash/uniq') let JSONConverter = require('substance').JSONConverter let documentHelpers = require('substance').documentHelpers let Database = require('./packages/server/Database') -let Configurator = require('archivist').ServerConfigurator +let Configurator = require('archivist-js').ServerConfigurator let EnginePackage = require('./packages/engine/package') let IndexerPackage = require('./packages/indexer/package') let InterviewPackage = require('./dist/ost.cjs').InterviewPackage diff --git a/make.js b/make.js index c545ef3..cfd50ce 100644 --- a/make.js +++ b/make.js @@ -55,8 +55,8 @@ function buildApp(app, production) { }], commonjs: { include: [ - 'node_modules/moment/moment.js', - 'node_modules/plyr/src/js/plyr.js', + 'node_modules/moment/moment.js', + 'node_modules/plyr/src/js/plyr.js', 'node_modules/leaflet/dist/leaflet-src.js', 'node_modules/leaflet.markercluster/dist/leaflet.markercluster-src.js', 'node_modules/leaflet-control-geocoder/dist/Control.Geocoder.js' @@ -65,12 +65,12 @@ function buildApp(app, production) { external: ['substance', 'archivist'], globals: { 'substance': 'substance', - 'archivist': 'archivist' + 'archivist-js': 'archivist-js' }, buble: production === true, useStrict: production !== true }) - + b.custom('injecting config', { src: './dist/' + app + '/app.js', dest: './dist/' + app + '/' + app + '.js', @@ -78,7 +78,7 @@ function buildApp(app, production) { const code = fs.readFileSync(file[0], 'utf8') const result = code.replace(/ARCHIVISTCONFIG/g, JSON.stringify(config.get('app'))) fs.writeFileSync(this.outputs[0], result, 'utf8') - } + } }) if(production) { b.minify('./dist/' + app + '/' + app + '.js') @@ -92,10 +92,10 @@ function buildApp(app, production) { function buildServerJS() { b.js('./index.es.js', { - external: ['substance', 'archivist'], + external: ['substance', 'archivist-js'], globals: { 'substance': 'substance', - 'archivist': 'archivist' + 'archivist-js': 'archivist-js' }, targets: [{ dest: 'dist/ost.cjs.js', @@ -106,11 +106,12 @@ function buildServerJS() { /* HELPERS */ +/* HELPERS */ + function _buildDeps(min) { - b.make('substance', 'lib') b.copy('node_modules/substance/dist', './dist/libs/substance') - if(min) { + b.minify('./dist/libs/substance/substance.js', './dist/libs/substance/substance.min.js') b.custom('applying modification', { src: './dist/libs/substance/substance.es5.js', dest: './dist/libs/substance/substance.legacy.js', @@ -118,15 +119,15 @@ function _buildDeps(min) { const code = fs.readFileSync(file[0], 'utf8') const result = code.replace(/(\(ref = this\)._initialize.apply\(ref, args\);)[\s\S]{13}/g, 'var ref;(ref = this)._initialize.apply(ref, args);') fs.writeFileSync(this.outputs[0], result, 'utf8') - } + } }) b.minify('./dist/libs/substance/substance.legacy.js') } - - //if(min) b.minify('./dist/libs/substance/substance.js', './dist/libs/substance/substance.min.js') - b.make('archivist', 'lib') - b.copy('node_modules/archivist/dist', './dist/libs/archivist') - if(min) b.minify('./dist/libs/archivist/archivist.es5.js') -} \ No newline at end of file + b.copy('node_modules/archivist-js/dist', './dist/libs/archivist') + if(min) { + b.minify('./dist/libs/archivist/archivist.js', './dist/libs/archivist/archivist.min.js') + b.minify('./dist/libs/archivist/archivist.es5.js') + } +} diff --git a/package.json b/package.json index 39ba258..4acfd73 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "", "main": "dist/ost.cjs.js", "dependencies": { - "archivist": "archivist/archivist#b9927ef94f4159b5ec8be14abf936d04e6ca4240", + "archivist-js": "preview", "bluebird": "^3.4.7", "body-parser": "^1.15.2", "config": "^1.21.0", @@ -15,7 +15,7 @@ "massive": "^2.5.0", "moment": "^2.17.1", "plyr": "^2.0.11", - "substance": "substance/substance#cafe7eb5a8bccb9c64feee6926b8acfb45c13a5b", + "substance": "container-annos", "ws": "^1.1.1" }, "devDependencies": { diff --git a/packages/definition-manager/DefinitionsPage.js b/packages/definition-manager/DefinitionsPage.js index 92e295c..d520dbc 100644 --- a/packages/definition-manager/DefinitionsPage.js +++ b/packages/definition-manager/DefinitionsPage.js @@ -1,5 +1,5 @@ import { FontAwesomeIcon as Icon } from 'substance' -import { AbstractEntityPage } from 'archivist' +import { AbstractEntityPage } from 'archivist-js' const definitionTypes = [ 'общий комментарий', diff --git a/packages/engine/document/DocumentEngine.js b/packages/engine/document/DocumentEngine.js index fd3eee7..1f21114 100644 --- a/packages/engine/document/DocumentEngine.js +++ b/packages/engine/document/DocumentEngine.js @@ -1,4 +1,4 @@ -let ArchivistDocumentEngine = require('archivist').DocumentEngine +let ArchivistDocumentEngine = require('archivist-js').DocumentEngine let Err = require('substance').SubstanceError let filter = require('lodash/filter') let forEach = require('lodash/forEach') diff --git a/packages/engine/package.js b/packages/engine/package.js index 7833aee..5713948 100644 --- a/packages/engine/package.js +++ b/packages/engine/package.js @@ -1,13 +1,13 @@ -let ArchivistStorePackage = require('archivist').ArchivistStorePackage +let ArchivistStorePackage = require('archivist-js').ArchivistStorePackage module.exports = { name: 'engine', configure: function(config) { config.import(ArchivistStorePackage); config.import(require('./mailer/package')) - config.import(require('archivist').AuthEnginePackage) - config.import(require('archivist').CollabEnginePackage) - config.import(require('archivist').SnapshotEnginePackage) + config.import(require('archivist-js').AuthEnginePackage) + config.import(require('archivist-js').CollabEnginePackage) + config.import(require('archivist-js').SnapshotEnginePackage) config.import(require('./document/package')) config.import(require('./resource/package')) } diff --git a/packages/engine/resource/ResourceEngine.js b/packages/engine/resource/ResourceEngine.js index bc3f373..2479a1a 100644 --- a/packages/engine/resource/ResourceEngine.js +++ b/packages/engine/resource/ResourceEngine.js @@ -1,5 +1,5 @@ let Err = require('substance').SubstanceError -let ArchivistResourceEngine = require('archivist').ResourceEngine +let ArchivistResourceEngine = require('archivist-js').ResourceEngine let each = require('lodash/each') let isEmpty = require('lodash/isEmpty') let isNull = require('lodash/isNull') diff --git a/packages/forms/OstForms.js b/packages/forms/OstForms.js index 735d5a4..900e734 100644 --- a/packages/forms/OstForms.js +++ b/packages/forms/OstForms.js @@ -1,5 +1,5 @@ import { DefaultDOMElement } from 'substance' -import { Forms } from 'archivist' +import { Forms } from 'archivist-js' import GeocodedField from './geocoded-field/GeocodedField' import MapField from './map-field/MapField' diff --git a/packages/forms/OstNodeForm.js b/packages/forms/OstNodeForm.js index d1db06d..d525b56 100644 --- a/packages/forms/OstNodeForm.js +++ b/packages/forms/OstNodeForm.js @@ -1,4 +1,4 @@ -import { NodeForm } from 'archivist' +import { NodeForm } from 'archivist-js' import { each } from 'lodash-es' import OstForms from './OstForms' diff --git a/packages/indexer/Indexer.js b/packages/indexer/Indexer.js index 2506a72..e2e89f1 100644 --- a/packages/indexer/Indexer.js +++ b/packages/indexer/Indexer.js @@ -1,5 +1,5 @@ let Err = require('substance').SubstanceError -let ArchivistIndexer = require('archivist').Indexer +let ArchivistIndexer = require('archivist-js').Indexer let findIndex = require('lodash/findIndex') let forEach = require('lodash/forEach') let isEmpty = require('lodash/isEmpty') diff --git a/packages/interview/Interview.js b/packages/interview/Interview.js index 5481813..ebf70dc 100644 --- a/packages/interview/Interview.js +++ b/packages/interview/Interview.js @@ -1,5 +1,5 @@ import { Document } from 'substance' -import { EntityIndex } from 'archivist' +import { EntityIndex } from 'archivist-js' import { map } from 'lodash-es' /* Archivist Interview model. diff --git a/packages/interview/package.js b/packages/interview/package.js index dac1c44..5c8debe 100644 --- a/packages/interview/package.js +++ b/packages/interview/package.js @@ -3,7 +3,7 @@ import MetaNode from './MetaNode' import InterviewSeed from './InterviewSeed' import { BasePackage, ParagraphPackage, PersistencePackage, HeadingPackage, BlockquotePackage, LinkPackage, EmphasisPackage, StrongPackage} from 'substance' -import { CommentPackage, TimecodePackage } from 'archivist' +import { CommentPackage, TimecodePackage } from 'archivist-js' import SubjectPackage from '../subject/package' import DefinitionPackage from '../definition/package' import PersonPackage from '../person/package' diff --git a/packages/ost-publisher/OstPublisher.js b/packages/ost-publisher/OstPublisher.js index cf8dc15..199b235 100644 --- a/packages/ost-publisher/OstPublisher.js +++ b/packages/ost-publisher/OstPublisher.js @@ -1,7 +1,7 @@ // import { ContainerEditor, Highlights, Layout, ProseEditor, SplitPane, Toolbar } from 'substance' import { findIndex, forEach, map } from 'lodash-es' import OstPublisherContext from './OstPublisherContext' -import { Publisher } from 'archivist' +import { Publisher } from 'archivist-js' class OstPublisher extends Publisher { constructor(...args) { diff --git a/packages/ost-publisher/OstPublisherContext.js b/packages/ost-publisher/OstPublisherContext.js index 7723a71..b5c62e4 100644 --- a/packages/ost-publisher/OstPublisherContext.js +++ b/packages/ost-publisher/OstPublisherContext.js @@ -1,7 +1,7 @@ // import { Component } from 'substance' // import { forEach } from 'lodash-es' -import { PublisherContext } from 'archivist' +import { PublisherContext } from 'archivist-js' class OstPublisherContext extends PublisherContext { diff --git a/packages/ost-publisher/OstPublisherLayout.js b/packages/ost-publisher/OstPublisherLayout.js index faea705..ca26fc3 100644 --- a/packages/ost-publisher/OstPublisherLayout.js +++ b/packages/ost-publisher/OstPublisherLayout.js @@ -1,5 +1,5 @@ import { async, JSONConverter, substanceGlobals } from 'substance' -import { PublisherLayout, PublisherSession } from 'archivist' +import { PublisherLayout, PublisherSession } from 'archivist-js' import OstPublisher from './OstPublisher' const {series} = async diff --git a/packages/ost-publisher/package.js b/packages/ost-publisher/package.js index 98588d9..48518fb 100644 --- a/packages/ost-publisher/package.js +++ b/packages/ost-publisher/package.js @@ -1,5 +1,5 @@ import OstPublisherLayout from './OstPublisherLayout' -import { BracketsPackage, CollaboratorsPackage, TabbedContextPackage } from 'archivist' +import { BracketsPackage, CollaboratorsPackage, TabbedContextPackage } from 'archivist-js' import { ContainerAnnotationPackage, FindAndReplacePackage } from 'substance' export default { diff --git a/packages/person-manager/PersonsPage.js b/packages/person-manager/PersonsPage.js index dfd1ce2..1265313 100644 --- a/packages/person-manager/PersonsPage.js +++ b/packages/person-manager/PersonsPage.js @@ -1,4 +1,4 @@ -import { AbstractEntityPage } from 'archivist' +import { AbstractEntityPage } from 'archivist-js' class PersonsPage extends AbstractEntityPage {} diff --git a/packages/prison-manager/PrisonsPage.js b/packages/prison-manager/PrisonsPage.js index dbe734a..9e76ab4 100644 --- a/packages/prison-manager/PrisonsPage.js +++ b/packages/prison-manager/PrisonsPage.js @@ -1,4 +1,4 @@ -import { AbstractEntityPage } from 'archivist' +import { AbstractEntityPage } from 'archivist-js' class PrisonsPage extends AbstractEntityPage {} diff --git a/packages/reader/package.js b/packages/reader/package.js index b74b147..46507fd 100644 --- a/packages/reader/package.js +++ b/packages/reader/package.js @@ -1,5 +1,5 @@ import { ContainerAnnotationPackage } from 'substance' -import { BracketsPackage, TabbedContextPackage } from 'archivist' +import { BracketsPackage, TabbedContextPackage } from 'archivist-js' import ReaderLayout from './ReaderLayout' export default { diff --git a/packages/scholar/Scholar.js b/packages/scholar/Scholar.js index 998d7fc..5346dcc 100644 --- a/packages/scholar/Scholar.js +++ b/packages/scholar/Scholar.js @@ -1,4 +1,4 @@ -import { AbstractApplication } from 'archivist' +import { AbstractApplication } from 'archivist-js' import { cloneDeep, forEach } from 'lodash-es' import ScholarRouter from './ScholarRouter' diff --git a/packages/scholar/package.js b/packages/scholar/package.js index e8011c2..da0d536 100644 --- a/packages/scholar/package.js +++ b/packages/scholar/package.js @@ -1,5 +1,5 @@ import { BasePackage } from 'substance' -import { DocumentPackage, PagerPackage, SpinnerPackage, ToolboxPackage } from 'archivist' +import { DocumentPackage, PagerPackage, SpinnerPackage, ToolboxPackage } from 'archivist-js' export default { name: 'scholar', diff --git a/packages/server/document/DocumentServer.js b/packages/server/document/DocumentServer.js index 8f93d17..c959c36 100644 --- a/packages/server/document/DocumentServer.js +++ b/packages/server/document/DocumentServer.js @@ -1,4 +1,4 @@ -let ArchivistDocumentServer = require('archivist').DocumentServer +let ArchivistDocumentServer = require('archivist-js').DocumentServer let Promise = require('bluebird') let each = require('lodash/each') diff --git a/packages/server/package.js b/packages/server/package.js index 2caa22c..07edc34 100644 --- a/packages/server/package.js +++ b/packages/server/package.js @@ -7,11 +7,11 @@ let IndexerPackage = require('../indexer/package') let ResourceServerPackage = require('./resource/package') let ConverterServerPackage = require('./converter/package') let DocumentServerPackage = require('./document/package') -let ArchivistSubConfigurator = require('archivist').ArchivistSubConfigurator -let AuthServerPackage = require('archivist').AuthServerPackage -let CollabServerPackage = require('archivist').CollabServerPackage -let UserServerPackage = require('archivist').UserServerPackage -let InspectorPackage = require('archivist').InspectorPackage +let ArchivistSubConfigurator = require('archivist-js').ArchivistSubConfigurator +let AuthServerPackage = require('archivist-js').AuthServerPackage +let CollabServerPackage = require('archivist-js').CollabServerPackage +let UserServerPackage = require('archivist-js').UserServerPackage +let InspectorPackage = require('archivist-js').InspectorPackage let db = new Database() diff --git a/packages/server/resource/ResourceServer.js b/packages/server/resource/ResourceServer.js index b49630c..f0a1c88 100644 --- a/packages/server/resource/ResourceServer.js +++ b/packages/server/resource/ResourceServer.js @@ -1,4 +1,4 @@ -let ArchivistResourceServer = require('archivist').ResourceServer +let ArchivistResourceServer = require('archivist-js').ResourceServer /* ResourceServer module. Can be bound to an express instance @@ -57,7 +57,7 @@ class ResourceServer extends ArchivistResourceServer { filters = filters ? JSON.parse(filters) : {} ///refs = refs ? JSON.parse(refs) : [] - + this.engine.getResourcesTreeFacets(filters, type) .then(function(entities) { res.json(entities) @@ -87,7 +87,7 @@ class ResourceServer extends ArchivistResourceServer { let letter = req.query.letter let options = req.query.options options = options ? JSON.parse(options) : {} - + this.engine.getPersonsList(letter, options) .then(function(persons) { res.json(persons) diff --git a/packages/toponym-manager/ToponymsPage.js b/packages/toponym-manager/ToponymsPage.js index 656ef0c..8972895 100644 --- a/packages/toponym-manager/ToponymsPage.js +++ b/packages/toponym-manager/ToponymsPage.js @@ -1,4 +1,4 @@ -import { AbstractEntityPage } from 'archivist' +import { AbstractEntityPage } from 'archivist-js' class ToponymsPage extends AbstractEntityPage {} diff --git a/seed.js b/seed.js index 84577e8..eef50f5 100644 --- a/seed.js +++ b/seed.js @@ -1,8 +1,8 @@ 'use strict'; var Database = require('./packages/server/Database'); -var Configurator = require('archivist').ServerConfigurator; -var StorePackage = require('archivist').ArchivistStorePackage; +var Configurator = require('archivist-js').ServerConfigurator; +var StorePackage = require('archivist-js').ArchivistStorePackage; var db = new Database(); var configurator = new Configurator().import(StorePackage); diff --git a/server.js b/server.js index 1809944..76bedb2 100644 --- a/server.js +++ b/server.js @@ -19,7 +19,7 @@ app.use(bodyParser.urlencoded({ extended: true, limit: '3mb', parameterLimit: 30 /* Config */ -var ServerConfigurator = require('archivist').ServerConfigurator; +var ServerConfigurator = require('archivist-js').ServerConfigurator; var ServerPackage = require('./packages/server/package'); var configurator = new ServerConfigurator(); configurator.setServerApp(app);