@riboseinc/paneron-registry-kit 2.0.11 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +8 -14
- package/index.js.map +1 -1
- package/migrations/initial.d.ts +3 -3
- package/migrations/initial.js +8 -12
- package/migrations/initial.js.map +1 -1
- package/package.json +3 -3
- package/site-builder/index.js +5 -3
- package/site-builder/index.js.map +1 -1
package/index.js
CHANGED
|
@@ -9,28 +9,22 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _paneronExtensionKit = require("@riboseinc/paneron-extension-kit");
|
|
11
11
|
|
|
12
|
+
var _initial = _interopRequireDefault(require("./migrations/initial"));
|
|
13
|
+
|
|
12
14
|
var _views = require("./views");
|
|
13
15
|
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
-
|
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
-
|
|
20
18
|
const makeRegistryExtension = function (opts) {
|
|
21
19
|
const {
|
|
22
20
|
name
|
|
23
21
|
} = opts;
|
|
24
22
|
|
|
25
|
-
const mainView =
|
|
26
|
-
return {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
subregisters: opts.subregisters
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
};
|
|
23
|
+
const mainView = function () {
|
|
24
|
+
return _react.default.createElement(_views.RegistryView, {
|
|
25
|
+
itemClassConfiguration: opts.itemClassConfiguration,
|
|
26
|
+
subregisters: opts.subregisters
|
|
27
|
+
});
|
|
34
28
|
};
|
|
35
29
|
|
|
36
30
|
return (0, _paneronExtensionKit.makeExtension)({
|
|
@@ -38,7 +32,7 @@ const makeRegistryExtension = function (opts) {
|
|
|
38
32
|
name,
|
|
39
33
|
requiredHostAppVersion: '2.0.0',
|
|
40
34
|
datasetMigrations: {},
|
|
41
|
-
datasetInitializer:
|
|
35
|
+
datasetInitializer: _initial.default
|
|
42
36
|
});
|
|
43
37
|
};
|
|
44
38
|
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAIjE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAQvC,MAAM,CAAC,MAAM,qBAAqB,GAA2B,UAAU,IAAI;IACzE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAEtB,MAAM,QAAQ,GAAoC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAIjE,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAQvC,MAAM,CAAC,MAAM,qBAAqB,GAA2B,UAAU,IAAI;IACzE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAEtB,MAAM,QAAQ,GAAoC;QAChD,OAAO,CACL,oBAAC,YAAY,IACX,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,EACnD,YAAY,EAAE,IAAI,CAAC,YAAY,GAC/B,CACH,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,aAAa,CAAC;QACnB,QAAQ;QACR,IAAI;QACJ,sBAAsB,EAAE,OAAO;QAC/B,iBAAiB,EAAE,EAAE;QACrB,kBAAkB;KACnB,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { makeExtension } from '@riboseinc/paneron-extension-kit';\nimport type { Extension } from '@riboseinc/paneron-extension-kit/types';\nimport type { ExtensionMakerProps } from '@riboseinc/paneron-extension-kit/types/extension-maker';\nimport type { RegistryViewProps } from './types';\nimport datasetInitializer from './migrations/initial';\nimport { RegistryView } from './views';\n\nexport type RegistryExtensionMakerProps =\n Pick<ExtensionMakerProps, 'name'> & RegistryViewProps\n\nexport type RegistryExtensionMaker =\n (opts: RegistryExtensionMakerProps) => Promise<Extension>;\n\nexport const makeRegistryExtension: RegistryExtensionMaker = function (opts) {\n const { name } = opts;\n\n const mainView: ExtensionMakerProps[\"mainView\"] = function () {\n return (\n <RegistryView\n itemClassConfiguration={opts.itemClassConfiguration}\n subregisters={opts.subregisters}\n />\n );\n };\n\n return makeExtension({\n mainView,\n name,\n requiredHostAppVersion: '2.0.0',\n datasetMigrations: {},\n datasetInitializer,\n });\n};\n"]}
|
package/migrations/initial.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
1
|
+
import type { MigrationInfo } from '@riboseinc/paneron-extension-kit/types/migrations';
|
|
2
|
+
declare const initialMigration: MigrationInfo;
|
|
3
|
+
export default initialMigration;
|
package/migrations/initial.js
CHANGED
|
@@ -24,17 +24,13 @@ version:
|
|
|
24
24
|
timestamp: "${new Date().toISOString()}"
|
|
25
25
|
contentSummary: "<content summary goes here>"
|
|
26
26
|
`);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
27
|
+
const initialMigration = {
|
|
28
|
+
versionAfter: '1.0.0',
|
|
29
|
+
migrator: async function* initialRegistryMigration() {
|
|
30
|
+
yield {
|
|
31
|
+
[_common.REGISTER_METADATA_FILENAME]: metadata
|
|
32
|
+
};
|
|
33
|
+
}
|
|
37
34
|
};
|
|
38
|
-
|
|
39
|
-
var _default = initializeDataset;
|
|
35
|
+
var _default = initialMigration;
|
|
40
36
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initial.js","sourceRoot":"","sources":["../../src/migrations/initial.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAGvD,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;AAE9B,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC;;;;;;;;;;;;;gBAaZ,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE;;CAEzC,CAAC,CAAC;AAGH,MAAM,
|
|
1
|
+
{"version":3,"file":"initial.js","sourceRoot":"","sources":["../../src/migrations/initial.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAGvD,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;AAE9B,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC;;;;;;;;;;;;;gBAaZ,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE;;CAEzC,CAAC,CAAC;AAGH,MAAM,gBAAgB,GAAkB;IACtC,YAAY,EAAE,OAAO;IACrB,QAAQ,EAAE,KAAK,SAAS,CAAC,CAAC,wBAAwB;QAChD,MAAM;YACJ,CAAC,0BAA0B,CAAC,EAAE,QAAQ;SACvC,CAAC;IACJ,CAAC;CACF,CAAA;AAED,eAAe,gBAAgB,CAAC","sourcesContent":["import type { MigrationInfo } from '@riboseinc/paneron-extension-kit/types/migrations';\nimport { REGISTER_METADATA_FILENAME } from '../common';\n\n\nconst enc = new TextEncoder();\n\nconst metadata = enc.encode(`\nname: \"Unnamed registry\"\nstakeholders:\n - role: owner\n name: \"<owner entity name here>\"\n gitServerUsername: \"<VCS username here>\"\n parties:\n - name: \"<owner entity party name here>\"\n contacts:\n - label: email\n value: \"<owner entity party contact email here>\"\nversion:\n id: \"1\"\n timestamp: \"${(new Date()).toISOString()}\"\ncontentSummary: \"<content summary goes here>\"\n`);\n\n\nconst initialMigration: MigrationInfo = {\n versionAfter: '1.0.0',\n migrator: async function* initialRegistryMigration () {\n yield {\n [REGISTER_METADATA_FILENAME]: metadata,\n };\n },\n}\n\nexport default initialMigration;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riboseinc/paneron-registry-kit",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"author": "Ribose Inc. <open.source@ribose.com>",
|
|
6
6
|
"scripts": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"@blueprintjs/select": "~4.9.10",
|
|
29
29
|
"@emotion/react": "^11.10.6",
|
|
30
30
|
"@emotion/styled": "^11.10.6",
|
|
31
|
-
"@riboseinc/paneron-extension-kit": "2.0
|
|
31
|
+
"@riboseinc/paneron-extension-kit": "2.1.0",
|
|
32
32
|
"@types/node": "^16.11.7",
|
|
33
|
-
"@types/
|
|
33
|
+
"@types/object-hash": "~3.0.2",
|
|
34
34
|
"@types/react": "17.0.53",
|
|
35
35
|
"@types/react-dom": "^17.0.2",
|
|
36
36
|
"@types/react-helmet": "^6.1.2",
|
package/site-builder/index.js
CHANGED
|
@@ -11,6 +11,8 @@ var _page = _interopRequireDefault(require("./page"));
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
+
const enc = new TextEncoder();
|
|
15
|
+
|
|
14
16
|
async function* exportPublicSite({
|
|
15
17
|
getObjectData
|
|
16
18
|
}) {
|
|
@@ -18,10 +20,10 @@ async function* exportPublicSite({
|
|
|
18
20
|
objectPaths: [`/${_common.REGISTER_METADATA_FILENAME}`]
|
|
19
21
|
})).data[`/${_common.REGISTER_METADATA_FILENAME}`];
|
|
20
22
|
yield {
|
|
21
|
-
'/hello.txt':
|
|
22
|
-
'/index.html':
|
|
23
|
+
'/hello.txt': enc.encode('hello'),
|
|
24
|
+
'/index.html': enc.encode((0, _page.default)({
|
|
23
25
|
title: "Register"
|
|
24
26
|
})),
|
|
25
|
-
'/register-meta.json':
|
|
27
|
+
'/register-meta.json': enc.encode(JSON.stringify(registerMeta))
|
|
26
28
|
};
|
|
27
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/site-builder/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,OAAO,MAAM,QAAQ,CAAC;AAG7B,MAAM,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,gBAAgB,CAAC,EAAE,aAAa,EAG9D;IACC,MAAM,YAAY,GAAG,CAAC,MAAM,aAAa,CAAC;QACxC,WAAW,EAAE,CAAC,IAAI,0BAA0B,EAAE,CAAC;KAChD,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,0BAA0B,EAAE,CAAC,CAAC;IAE3C,MAAM;QACJ,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/site-builder/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,OAAO,MAAM,QAAQ,CAAC;AAG7B,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;AAG9B,MAAM,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,gBAAgB,CAAC,EAAE,aAAa,EAG9D;IACC,MAAM,YAAY,GAAG,CAAC,MAAM,aAAa,CAAC;QACxC,WAAW,EAAE,CAAC,IAAI,0BAA0B,EAAE,CAAC;KAChD,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,0BAA0B,EAAE,CAAC,CAAC;IAE3C,MAAM;QACJ,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC;QACjC,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;QACzD,qBAAqB,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;KAChE,CAAC;AACJ,CAAC","sourcesContent":["import type { BufferDataset } from '@riboseinc/paneron-extension-kit/types/buffers';\nimport type { DatasetContext } from '@riboseinc/paneron-extension-kit/types/renderer';\nimport { REGISTER_METADATA_FILENAME } from '../common'; \nimport getHTML from './page';\n\n\nconst enc = new TextEncoder();\n\n\nexport default async function* exportPublicSite({ getObjectData }: {\n getObjectData: DatasetContext[\"getObjectData\"],\n onProgress?: (message: string) => void,\n}): AsyncGenerator<BufferDataset, void, void> {\n const registerMeta = (await getObjectData({\n objectPaths: [`/${REGISTER_METADATA_FILENAME}`],\n })).data[`/${REGISTER_METADATA_FILENAME}`];\n\n yield {\n '/hello.txt': enc.encode('hello'),\n '/index.html': enc.encode(getHTML({ title: \"Register\" })),\n '/register-meta.json': enc.encode(JSON.stringify(registerMeta)),\n };\n}\n"]}
|