@ms-cloudpack/package-hashes 0.8.17 → 0.8.19

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,4 +1,4 @@
1
- import { appConfigFileName, generatedConfigFileName } from '@ms-cloudpack/config';
1
+ import { appConfigFileName, appConfigFileNamesJS, generatedConfigFileName } from '@ms-cloudpack/config';
2
2
  import { glob } from 'tinyglobby';
3
3
  import { hash } from 'glob-hasher';
4
4
  import { sourceFilesGlobs } from '@ms-cloudpack/path-utilities';
@@ -18,7 +18,7 @@ export async function getSourceHash(options) {
18
18
  // We want to ignore the app config and generated config files because they are not part of the source code.
19
19
  // Ignoring the generated config is especially important because it changes during init,
20
20
  // and it would invalidate the cache for the entry package with the generated config.
21
- ignore: [appConfigFileName, generatedConfigFileName],
21
+ ignore: [appConfigFileName, ...appConfigFileNamesJS, generatedConfigFileName],
22
22
  });
23
23
  const globHash = hash(files, { cwd: packagePath });
24
24
  console.debug(`Hashed source files in ${packagePath} in ${performance.now() - start}ms`);
@@ -1 +1 @@
1
- {"version":3,"file":"getSourceHash.js","sourceRoot":"","sources":["../src/getSourceHash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAIhE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAInC;IACC,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAEhC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAC5C,6EAA6E;IAC7E,MAAM,QAAQ,GAAG,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,gBAAgB,CAAC;IAEpE,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE;QACjC,GAAG,EAAE,WAAW;QAChB,4GAA4G;QAC5G,wFAAwF;QACxF,qFAAqF;QACrF,MAAM,EAAE,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;KACrD,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;IAEnD,OAAO,CAAC,KAAK,CAAC,0BAA0B,WAAW,OAAO,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC;IAEzF,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import { appConfigFileName, generatedConfigFileName } from '@ms-cloudpack/config';\nimport { glob } from 'tinyglobby';\nimport { hash } from 'glob-hasher';\nimport { sourceFilesGlobs } from '@ms-cloudpack/path-utilities';\n\nexport type FilesHash = ReturnType<typeof hash>;\n\n/**\n * Get the hash of the source files in a package.\n * - If there is an `src` folder, hash the files in that folder, the `*.json` files and the `inputPaths`.\n * - If there are `inputPaths`, hash only those files.\n * - Otherwise, hash all files except `node_modules`.\n */\nexport async function getSourceHash(options: {\n packagePath: string;\n /** Input paths from the package settings */\n inputPaths: string[] | undefined;\n}): Promise<FilesHash> {\n const start = performance.now();\n\n const { packagePath, inputPaths } = options;\n // Use the inputPaths if they are defined, otherwise use the default patterns\n const patterns = inputPaths?.length ? inputPaths : sourceFilesGlobs;\n\n const files = await glob(patterns, {\n cwd: packagePath,\n // We want to ignore the app config and generated config files because they are not part of the source code.\n // Ignoring the generated config is especially important because it changes during init,\n // and it would invalidate the cache for the entry package with the generated config.\n ignore: [appConfigFileName, generatedConfigFileName],\n });\n\n const globHash = hash(files, { cwd: packagePath });\n\n console.debug(`Hashed source files in ${packagePath} in ${performance.now() - start}ms`);\n\n return globHash;\n}\n"]}
1
+ {"version":3,"file":"getSourceHash.js","sourceRoot":"","sources":["../src/getSourceHash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACxG,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAIhE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAInC;IACC,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAEhC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAC5C,6EAA6E;IAC7E,MAAM,QAAQ,GAAG,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,gBAAgB,CAAC;IAEpE,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE;QACjC,GAAG,EAAE,WAAW;QAChB,4GAA4G;QAC5G,wFAAwF;QACxF,qFAAqF;QACrF,MAAM,EAAE,CAAC,iBAAiB,EAAE,GAAG,oBAAoB,EAAE,uBAAuB,CAAC;KAC9E,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;IAEnD,OAAO,CAAC,KAAK,CAAC,0BAA0B,WAAW,OAAO,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC;IAEzF,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import { appConfigFileName, appConfigFileNamesJS, generatedConfigFileName } from '@ms-cloudpack/config';\nimport { glob } from 'tinyglobby';\nimport { hash } from 'glob-hasher';\nimport { sourceFilesGlobs } from '@ms-cloudpack/path-utilities';\n\nexport type FilesHash = ReturnType<typeof hash>;\n\n/**\n * Get the hash of the source files in a package.\n * - If there is an `src` folder, hash the files in that folder, the `*.json` files and the `inputPaths`.\n * - If there are `inputPaths`, hash only those files.\n * - Otherwise, hash all files except `node_modules`.\n */\nexport async function getSourceHash(options: {\n packagePath: string;\n /** Input paths from the package settings */\n inputPaths: string[] | undefined;\n}): Promise<FilesHash> {\n const start = performance.now();\n\n const { packagePath, inputPaths } = options;\n // Use the inputPaths if they are defined, otherwise use the default patterns\n const patterns = inputPaths?.length ? inputPaths : sourceFilesGlobs;\n\n const files = await glob(patterns, {\n cwd: packagePath,\n // We want to ignore the app config and generated config files because they are not part of the source code.\n // Ignoring the generated config is especially important because it changes during init,\n // and it would invalidate the cache for the entry package with the generated config.\n ignore: [appConfigFileName, ...appConfigFileNamesJS, generatedConfigFileName],\n });\n\n const globHash = hash(files, { cwd: packagePath });\n\n console.debug(`Hashed source files in ${packagePath} in ${performance.now() - start}ms`);\n\n return globHash;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/package-hashes",
3
- "version": "0.8.17",
3
+ "version": "0.8.19",
4
4
  "description": "Utilities for hashing packages.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,11 +14,11 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@ms-cloudpack/common-types": "^0.26.2",
18
- "@ms-cloudpack/config": "^0.36.0",
19
- "@ms-cloudpack/package-utilities": "^12.3.18",
17
+ "@ms-cloudpack/common-types": "^0.26.3",
18
+ "@ms-cloudpack/config": "^0.37.1",
19
+ "@ms-cloudpack/package-utilities": "^12.3.19",
20
20
  "@ms-cloudpack/path-string-parsing": "^1.2.7",
21
- "@ms-cloudpack/path-utilities": "^3.1.12",
21
+ "@ms-cloudpack/path-utilities": "^3.1.13",
22
22
  "glob-hasher": "^1.4.2",
23
23
  "object-hash": "^3.0.0",
24
24
  "tinyglobby": "^0.2.13"