@jpmorganchase/mosaic-types 0.1.0-beta.4 → 0.1.0-beta.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @jpmorganchase/mosaic-types
2
2
 
3
+ ## 0.1.0-beta.6
4
+
5
+ ### Patch Changes
6
+
7
+ - c103b24: Release fixes for snapshot serve
8
+
9
+ ## 0.1.0-beta.5
10
+
11
+ ### Patch Changes
12
+
13
+ - 61a246c: This releases add support for generate / build and serve snapshots
14
+
3
15
  ## 0.1.0-beta.4
4
16
 
5
17
  ### Patch Changes
@@ -6,12 +6,12 @@ import type Stats from 'memfs/lib/Stats';
6
6
  import type { TStatNumber } from 'memfs/lib/Stats';
7
7
  import type { IStatOptions } from 'memfs/lib/volume';
8
8
  import type { PathLike, symlink } from 'fs';
9
- import type Page from './Page';
9
+ import type { Page } from './Page';
10
10
  import type { Options, Pattern, Entry } from 'fast-glob';
11
11
  /**
12
12
  * This is the core underlying filesystem, which directly interfaces with a memfs Volume to mutate the filesystem
13
13
  */
14
- export default interface IFileAccess {
14
+ export interface IFileAccess {
15
15
  glob(pattern: Pattern, options?: Omit<Options, 'absolute' | 'fs'>): Promise<string[] | Entry[]>;
16
16
  mkdir(dir: PathLike, options?: TMode | IMkdirOptions): Promise<void>;
17
17
  readdir(dir: PathLike, options?: string | IReaddirOptions): Promise<TDataOut[] | Dirent[]>;
@@ -26,7 +26,7 @@ export default interface IFileAccess {
26
26
  exists(file: PathLike): Promise<boolean>;
27
27
  $$reset(): void;
28
28
  $$freeze(): void;
29
- get $$frozen(): boolean;
29
+ readonly $$frozen: boolean;
30
30
  $$unfreeze(): void;
31
31
  $$clearCache(): void;
32
32
  $$symlinksFromJSON(page: {
package/dist/Meta.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- declare type Meta<AdditionalProps> = {
1
+ export declare type Meta<AdditionalProps> = {
2
2
  title?: string;
3
3
  route: string;
4
4
  lastModified: Date;
5
5
  } & Record<string, unknown> & AdditionalProps;
6
- export default Meta;
@@ -1,4 +1,22 @@
1
- declare type MutableData<T = {}> = ImmutableData<T> & {
1
+ export interface Aliases {
2
+ [key: string]: Set<string>;
3
+ }
4
+ export interface FSRef {
5
+ $$path?: string | string[];
6
+ $$value?: string;
7
+ }
8
+ export interface GlobalRefs {
9
+ [key: string]: FSRef;
10
+ }
11
+ export interface ScopedRefs {
12
+ [key: string]: FSRef;
13
+ }
14
+ export interface BaseData {
15
+ refs?: ScopedRefs | [];
16
+ globalRefs?: GlobalRefs | [];
17
+ aliases?: Aliases | [];
18
+ }
19
+ export declare type MutableData<T = {}> = ImmutableData<T> & {
2
20
  /**
3
21
  * Set arbitrary data onto the config object. This value will persist across plugins and
4
22
  * also be sent to the parent process when it executes plugins there as well.
@@ -54,4 +72,3 @@ export declare type ImmutableData<T = {}> = {
54
72
  }>;
55
73
  }>;
56
74
  };
57
- export default MutableData;
package/dist/Page.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * `Page` is a type, which at a minimum has a `fullPath`, but can also contain metadata and `content`
3
3
  */
4
- declare type Page<AdditionalProps = {}> = {
4
+ export declare type Page<AdditionalProps = {}> = {
5
5
  fullPath: string;
6
6
  title?: string;
7
7
  /**
@@ -18,4 +18,3 @@ declare type Page<AdditionalProps = {}> = {
18
18
  type?: string;
19
19
  content?: string;
20
20
  } & Record<string, unknown> & AdditionalProps;
21
- export default Page;
package/dist/Plugin.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- import type Page from './Page';
2
- import type MutableData from './MutableData';
3
- import type PluginModuleDefinition from './PluginModuleDefinition';
1
+ import type { Page } from './Page';
2
+ import type { MutableData } from './MutableData';
3
+ import type { PluginModuleDefinition } from './PluginModuleDefinition';
4
4
  import type { ImmutableData } from './MutableData';
5
5
  import type { IUnionVolume, IVolumeImmutable, IVolumeMutable, IVolumePartiallyMutable } from './Volume';
6
- import type Serialiser from './Serialiser';
6
+ import type { Serialiser } from './Serialiser';
7
7
  export declare type LoadedPlugin = Partial<Plugin> & PluginModuleDefinition;
8
8
  /**
9
9
  * Plugins are lifecycle-based hooks that are called on every source at different stages.
10
10
  * Consumers will never need to invoke a lifecycle method; but for technical clarity - when a lifecycle method is called,
11
11
  * it will trigger `pluginRunner` which executes it on every source automatically.
12
12
  */
13
- declare type Plugin<ConfigData = {}, PluginOptions = {}, GlobalConfigData = ConfigData> = {
13
+ export declare type Plugin<ConfigData = {}, PluginOptions = {}, GlobalConfigData = ConfigData> = {
14
14
  /**
15
15
  * Plugin lifecycle method that triggers inside child processes.
16
16
  * The first lifecycle hook to trigger after receiving pages from a source. The pages can safely be mutated and will be reflected in the final
@@ -89,4 +89,3 @@ declare type Plugin<ConfigData = {}, PluginOptions = {}, GlobalConfigData = Conf
89
89
  }, options?: Pick<PluginModuleDefinition, 'options'> & PluginOptions): Promise<boolean>;
90
90
  };
91
91
  export declare type LifecycleMethod = keyof Plugin;
92
- export default Plugin;
@@ -1,4 +1,4 @@
1
- export default interface PluginModuleDefinition {
1
+ export interface PluginModuleDefinition {
2
2
  /**
3
3
  * Options to pass to the plugin lifecycle methods.
4
4
  */
@@ -1,6 +1,6 @@
1
- import PluginModuleDefinition from './PluginModuleDefinition';
2
- import SerialiserModuleDefinition from './SerialiserModuleDefinition';
3
- import SourceModuleDefinition from './SourceModuleDefinition';
1
+ import type { PluginModuleDefinition } from './PluginModuleDefinition';
2
+ import type { SerialiserModuleDefinition } from './SerialiserModuleDefinition';
3
+ import type { SourceModuleDefinition } from './SourceModuleDefinition';
4
4
  export interface PullDocsConfig {
5
5
  pageExtensions: Array<string>;
6
6
  ignorePages?: Array<string>;
@@ -1,6 +1,6 @@
1
1
  import type { TDataOut } from 'memfs/lib/encoding';
2
- import type Page from './Page';
3
- import type SerialiserModuleDefinition from './SerialiserModuleDefinition';
2
+ import type { Page } from './Page';
3
+ import type { SerialiserModuleDefinition } from './SerialiserModuleDefinition';
4
4
  /**
5
5
  * Serialisers are a form of plugin that tells PullDocs how to turn a file from/to a storable form for the filesystem
6
6
  * or a `Page` object.
@@ -24,4 +24,3 @@ export declare type Serialiser = {
24
24
  serialise: (fullPath: string, page: Page) => Promise<TDataOut>;
25
25
  };
26
26
  export declare type LoadedSerialiser = Serialiser & SerialiserModuleDefinition;
27
- export default Serialiser;
@@ -1,5 +1,4 @@
1
- import PluginModuleDefinition from './PluginModuleDefinition';
2
- declare type SerialiserModuleDefinition = PluginModuleDefinition & {
1
+ import type { PluginModuleDefinition } from './PluginModuleDefinition';
2
+ export declare type SerialiserModuleDefinition = PluginModuleDefinition & {
3
3
  filter: RegExp;
4
4
  };
5
- export default SerialiserModuleDefinition;
package/dist/Source.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  import type { Observable } from 'rxjs';
2
- import type Serialiser from './Serialiser';
3
- import type Page from './Page';
4
- declare type Source<Options = {}> = {
2
+ import type { Serialiser } from './Serialiser';
3
+ import type { Page } from './Page';
4
+ export declare type Source<Options = {}> = {
5
5
  create(options: Options, { serialiser, pageExtensions }: {
6
6
  pageExtensions: string[];
7
7
  serialiser: Serialiser;
8
8
  }): Observable<Page[]>;
9
9
  };
10
- export default Source;
@@ -1,6 +1,5 @@
1
- import type PluginModuleDefinition from './PluginModuleDefinition';
2
- declare type SourceModuleDefinition = PluginModuleDefinition & {
1
+ import type { PluginModuleDefinition } from './PluginModuleDefinition';
2
+ export declare type SourceModuleDefinition = PluginModuleDefinition & {
3
3
  namespace: string;
4
4
  cache?: boolean;
5
5
  };
6
- export default SourceModuleDefinition;
package/dist/Volume.d.ts CHANGED
@@ -11,7 +11,7 @@ import type { Options, Pattern, Entry } from 'fast-glob';
11
11
  * Volumes are lightweight decorators which wrap `FileAccess` and limit access to the underlying API for different use-cases
12
12
  * Examples include disallowing mutation or allowing underlying functions like resetting
13
13
  */
14
- interface IVolume {
14
+ export interface IVolume {
15
15
  namespace: string;
16
16
  reset?(): void;
17
17
  toJSON(): DirectoryJSON;
@@ -107,7 +107,7 @@ export interface IVolumeMutable extends IVolume {
107
107
  * Is this filesystem frozen/mutable?
108
108
  * @returns {boolean}
109
109
  */
110
- get frozen(): boolean;
110
+ readonly frozen: boolean;
111
111
  /**
112
112
  * Appends content to the filesystem
113
113
  * @param json A JSON blob in the form of {[fullPath]: "{fullPath: '', content: ''}"}
@@ -128,4 +128,3 @@ export interface IVolumeMutable extends IVolume {
128
128
  export interface IVolumeImmutable extends Omit<IVolumePartiallyMutable, 'fromJSON' | 'reset' | 'promises' | '__internal_do_not_use_addReadFileHook'> {
129
129
  promises: Omit<IVolume['promises'], 'writeFile' | 'symlink' | 'mkdir' | 'unlink' | 'rmdir' | 'rm' | 'rename'>;
130
130
  }
131
- export {};
@@ -1,7 +1,7 @@
1
- import type SerialiserModuleDefinition from './SerialiserModuleDefinition';
2
- import type PluginModuleDefinition from './PluginModuleDefinition';
3
- import type SourceModuleDefinition from './SourceModuleDefinition';
4
- declare type WorkerData<Options = {}> = {
1
+ import type { SerialiserModuleDefinition } from './SerialiserModuleDefinition';
2
+ import type { PluginModuleDefinition } from './PluginModuleDefinition';
3
+ import type { SourceModuleDefinition } from './SourceModuleDefinition';
4
+ export declare type WorkerData<Options = {}> = {
5
5
  options: Options & Pick<PluginModuleDefinition, 'options'> & Pick<SourceModuleDefinition, 'options'> & {
6
6
  pageExtensions: string[];
7
7
  };
@@ -13,4 +13,3 @@ declare type WorkerData<Options = {}> = {
13
13
  serialisers: SerialiserModuleDefinition[];
14
14
  modulePath: string;
15
15
  };
16
- export default WorkerData;
@@ -0,0 +1,13 @@
1
+ export * from './IFileAccess';
2
+ export * from './Meta';
3
+ export * from './MutableData';
4
+ export * from './Page';
5
+ export * from './Plugin';
6
+ export * from './PluginModuleDefinition';
7
+ export * from './PullDocsConfig';
8
+ export * from './Serialiser';
9
+ export * from './SerialiserModuleDefinition';
10
+ export * from './Source';
11
+ export * from './SourceModuleDefinition';
12
+ export * from './Volume';
13
+ export * from './WorkerData';
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@jpmorganchase/mosaic-types",
3
- "version": "0.1.0-beta.4",
3
+ "version": "0.1.0-beta.6",
4
4
  "author": "",
5
5
  "description": "Mosaic BitBucket source for core file system",
6
6
  "license": "Apache-2.0",
7
- "types": "./dist/**",
7
+ "types": "./dist/index.d.ts",
8
8
  "engines": {
9
9
  "node": ">= 12.0.0"
10
10
  },
@@ -22,4 +22,4 @@
22
22
  "devDependencies": {
23
23
  "rxjs": "^7.5.5"
24
24
  }
25
- }
25
+ }