@static-suite/static-suite-data-server 1.0.1 → 1.0.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"includeParser.d.ts","sourceRoot":"","sources":["../../../../src/lib/store/include/includeParser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAWtD,eAAO,MAAM,aAAa,EAAE,aAyC3B,CAAC"}
1
+ {"version":3,"file":"includeParser.d.ts","sourceRoot":"","sources":["../../../../src/lib/store/include/includeParser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAUtD,eAAO,MAAM,aAAa,EAAE,aAyC3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"storeManager.d.ts","sourceRoot":"","sources":["../../../src/lib/store/storeManager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AA+H7C,eAAO,MAAM,YAAY,EAAE,YAmG1B,CAAC"}
1
+ {"version":3,"file":"storeManager.d.ts","sourceRoot":"","sources":["../../../src/lib/store/storeManager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAgI7C,eAAO,MAAM,YAAY,EAAE,YAmG1B,CAAC"}
@@ -25,6 +25,7 @@ const setFileIntoStore = (relativeFilepath) => {
25
25
  relativeFilepath,
26
26
  fileContent,
27
27
  });
28
+ // Used to return the contents of the previously stored file
28
29
  let previousStoredData = null;
29
30
  const dataToStore = fileContent.json || fileContent.raw;
30
31
  const currentData = _1.store.data.get(relativeFilepath);
@@ -80,12 +81,12 @@ const setFileIntoStore = (relativeFilepath) => {
80
81
  if (uuid && langcode) {
81
82
  const langcodeMap = _1.store.index.uuid.get(langcode) ||
82
83
  _1.store.index.uuid.set(langcode, new Map()).get(langcode);
83
- langcodeMap.set(uuid, dataToStore);
84
+ langcodeMap.set(uuid, skipUpdating ? currentData : dataToStore);
84
85
  }
85
86
  // Add data to URL index.
86
87
  const url = dataToStore.data?.content?.url?.path;
87
88
  if (url) {
88
- _1.store.index.url.set(url, dataToStore);
89
+ _1.store.index.url.set(url, skipUpdating ? currentData : dataToStore);
89
90
  }
90
91
  // Add include dependencies.
91
92
  dependencyFileHelper_1.dependencyIncludeHelper.addIncludeDependencies(relativeFilepath, dataToStore);
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.57.7"
8
+ "packageVersion": "7.58.7"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@static-suite/static-suite-data-server",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "A flexible, fast and developer friendly Data Server for Static Suite",
5
5
  "main": "./dist/lib/index.js",
6
6
  "typings": "./dist/lib/index.d.ts",
@@ -27,7 +27,7 @@
27
27
  "pug": "^3.0.3",
28
28
  "simple-datatables": "^10.0.0",
29
29
  "tsc-watch": "^7.1.1",
30
- "typescript": "^5.9.2",
30
+ "typescript": "^6.0.2",
31
31
  "winston": "^3.8.2",
32
32
  "yargs": "^18.0.0"
33
33
  },
@@ -6,7 +6,6 @@ import {
6
6
  entityIncludeParser,
7
7
  localeIncludeParser,
8
8
  queryIncludeParser,
9
- // queryIncludeParser,
10
9
  } from './parsers';
11
10
  import { store } from '..';
12
11
 
@@ -32,6 +32,7 @@ const setFileIntoStore = (
32
32
  fileContent,
33
33
  });
34
34
 
35
+ // Used to return the contents of the previously stored file
35
36
  let previousStoredData: any = null;
36
37
 
37
38
  const dataToStore = fileContent.json || fileContent.raw;
@@ -99,13 +100,13 @@ const setFileIntoStore = (
99
100
  const langcodeMap =
100
101
  store.index.uuid.get(langcode) ||
101
102
  store.index.uuid.set(langcode, new Map<string, any>()).get(langcode);
102
- langcodeMap.set(uuid, dataToStore);
103
+ langcodeMap.set(uuid, skipUpdating ? currentData : dataToStore);
103
104
  }
104
105
 
105
106
  // Add data to URL index.
106
107
  const url = dataToStore.data?.content?.url?.path;
107
108
  if (url) {
108
- store.index.url.set(url, dataToStore);
109
+ store.index.url.set(url, skipUpdating ? currentData : dataToStore);
109
110
  }
110
111
 
111
112
  // Add include dependencies.
package/tsconfig.json CHANGED
@@ -25,35 +25,19 @@
25
25
  // "removeComments": true, /* Do not emit comments to output. */
26
26
  // "noEmit": true, /* Do not emit outputs. */
27
27
  // "importHelpers": true, /* Import emit helpers from 'tslib'. */
28
- "downlevelIteration": true /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */,
28
+ // "downlevelIteration": true /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */,
29
29
  // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
30
30
 
31
31
  /* Strict Type-Checking Options */
32
32
  "strict": true /* Enable all strict type-checking options. */,
33
- // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
34
- // "strictNullChecks": true, /* Enable strict null checks. */
35
- // "strictFunctionTypes": true, /* Enable strict checking of function types. */
36
- // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
37
- // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
38
- // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
39
- // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
40
-
41
- /* Additional Checks */
42
- // "noUnusedLocals": true, /* Report errors on unused locals. */
43
- // "noUnusedParameters": true, /* Report errors on unused parameters. */
44
- // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
45
- // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
46
- // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
47
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an 'override' modifier. */
48
- // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */
49
-
50
- /* Module Resolution Options */
51
- // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
52
- "baseUrl": "./src" /* Base directory to resolve non-absolute module names. */,
53
- "paths": {} /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */,
33
+ "paths": {
34
+ "*": ["./src/*"]
35
+ } /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */,
54
36
  // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
55
37
  // "typeRoots": [], /* List of folders to include type definitions from. */
56
- // "types": [], /* Type declaration files to be included in compilation. */
38
+ "types": [
39
+ "jest"
40
+ ] /* Type declaration files to be included in compilation. */,
57
41
  // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
58
42
  "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
59
43
  // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
@@ -74,5 +58,5 @@
74
58
  "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
75
59
  },
76
60
  "include": ["src"]
77
- // "exclude": ["mocks", "**/__tests__/*", "**/*.test.ts"]
61
+ //"exclude": ["mocks", "**/__tests__/*", "**/*.test.ts"]
78
62
  }