@ms-cloudpack/bundler-utilities 0.7.2 → 0.7.4

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/lib/index.d.ts CHANGED
@@ -4,4 +4,5 @@ export { getSwcConfig } from './getSwcConfig.js';
4
4
  export { shouldExternalizePackage } from './shouldExternalizePackage.js';
5
5
  export { getCssRule } from './getCssRule.js';
6
6
  export { processAssetInlineExtensions } from './processAssetInlineExtensions.js';
7
+ export { requiresTranspile } from './requiresTranspile.js';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
package/lib/index.js CHANGED
@@ -4,4 +4,5 @@ export { getSwcConfig } from './getSwcConfig.js';
4
4
  export { shouldExternalizePackage } from './shouldExternalizePackage.js';
5
5
  export { getCssRule } from './getCssRule.js';
6
6
  export { processAssetInlineExtensions } from './processAssetInlineExtensions.js';
7
+ export { requiresTranspile } from './requiresTranspile.js';
7
8
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC","sourcesContent":["export { defaultTargetSyntax, base64AssetExtensions } from './constants.js';\nexport { getModuleSearchPaths } from './getModuleSearchPaths.js';\nexport { getSwcConfig } from './getSwcConfig.js';\nexport { shouldExternalizePackage } from './shouldExternalizePackage.js';\nexport { getCssRule } from './getCssRule.js';\nexport { processAssetInlineExtensions } from './processAssetInlineExtensions.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["export { defaultTargetSyntax, base64AssetExtensions } from './constants.js';\nexport { getModuleSearchPaths } from './getModuleSearchPaths.js';\nexport { getSwcConfig } from './getSwcConfig.js';\nexport { shouldExternalizePackage } from './shouldExternalizePackage.js';\nexport { getCssRule } from './getCssRule.js';\nexport { processAssetInlineExtensions } from './processAssetInlineExtensions.js';\nexport { requiresTranspile } from './requiresTranspile.js';\n"]}
@@ -0,0 +1,8 @@
1
+ import type { BundleContext, BundleOptions } from '@ms-cloudpack/common-types';
2
+ /**
3
+ * Returns whether the package needs to be transpiled before bundling (see `BundleContext.requiresTranspile`).
4
+ *
5
+ * (This is in a shared location so it can be used by tests too.)
6
+ */
7
+ export declare function requiresTranspile(bundleOptions: Pick<BundleOptions, 'inputPath' | 'entries' | 'bundlerCapabilities'>): BundleContext['requiresTranspile'];
8
+ //# sourceMappingURL=requiresTranspile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requiresTranspile.d.ts","sourceRoot":"","sources":["../src/requiresTranspile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI/E;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,SAAS,GAAG,qBAAqB,CAAC,GAClF,aAAa,CAAC,mBAAmB,CAAC,CAMpC"}
@@ -0,0 +1,13 @@
1
+ import { isExternalPackage, sourceExtensions } from '@ms-cloudpack/path-utilities';
2
+ import path from 'path';
3
+ /**
4
+ * Returns whether the package needs to be transpiled before bundling (see `BundleContext.requiresTranspile`).
5
+ *
6
+ * (This is in a shared location so it can be used by tests too.)
7
+ */
8
+ export function requiresTranspile(bundleOptions) {
9
+ return (!isExternalPackage(bundleOptions.inputPath) ||
10
+ !!bundleOptions.bundlerCapabilities?.relay ||
11
+ Object.values(bundleOptions.entries).some((fileName) => sourceExtensions.includes(path.extname(fileName))));
12
+ }
13
+ //# sourceMappingURL=requiresTranspile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requiresTranspile.js","sourceRoot":"","sources":["../src/requiresTranspile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,aAAmF;IAEnF,OAAO,CACL,CAAC,iBAAiB,CAAC,aAAa,CAAC,SAAS,CAAC;QAC3C,CAAC,CAAC,aAAa,CAAC,mBAAmB,EAAE,KAAK;QAC1C,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC3G,CAAC;AACJ,CAAC","sourcesContent":["import type { BundleContext, BundleOptions } from '@ms-cloudpack/common-types';\nimport { isExternalPackage, sourceExtensions } from '@ms-cloudpack/path-utilities';\nimport path from 'path';\n\n/**\n * Returns whether the package needs to be transpiled before bundling (see `BundleContext.requiresTranspile`).\n *\n * (This is in a shared location so it can be used by tests too.)\n */\nexport function requiresTranspile(\n bundleOptions: Pick<BundleOptions, 'inputPath' | 'entries' | 'bundlerCapabilities'>,\n): BundleContext['requiresTranspile'] {\n return (\n !isExternalPackage(bundleOptions.inputPath) ||\n !!bundleOptions.bundlerCapabilities?.relay ||\n Object.values(bundleOptions.entries).some((fileName) => sourceExtensions.includes(path.extname(fileName)))\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/bundler-utilities",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "description": "Utilities used by multiple Cloudpack bundlers implementations",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,31 +13,31 @@
13
13
  "import": "./lib/index.js"
14
14
  }
15
15
  },
16
+ "scripts": {
17
+ "api": "cloudpack-scripts api",
18
+ "build:watch": "cloudpack-scripts build-watch",
19
+ "build": "cloudpack-scripts build",
20
+ "lint:update": "cloudpack-scripts lint-update",
21
+ "lint": "cloudpack-scripts lint",
22
+ "test:update": "cloudpack-scripts test-update",
23
+ "test:watch": "cloudpack-scripts test-watch",
24
+ "test": "cloudpack-scripts test"
25
+ },
16
26
  "dependencies": {
17
27
  "@ms-cloudpack/json-utilities": "^0.1.11",
18
- "@ms-cloudpack/package-utilities": "^13.2.2",
28
+ "@ms-cloudpack/package-utilities": "^13.2.3",
19
29
  "@ms-cloudpack/path-string-parsing": "^1.2.7",
20
- "@ms-cloudpack/path-utilities": "^3.1.34",
30
+ "@ms-cloudpack/path-utilities": "^3.2.0",
21
31
  "get-tsconfig": "^4.7.2",
22
32
  "tsconfig-to-swcconfig": "^2.7.0"
23
33
  },
24
34
  "devDependencies": {
25
- "@ms-cloudpack/common-types": "^0.32.2",
35
+ "@ms-cloudpack/common-types": "^0.33.0",
26
36
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
27
37
  "@ms-cloudpack/scripts": "^0.0.1",
28
38
  "@ms-cloudpack/test-utilities": "^0.5.0",
29
39
  "@swc/core": "^1.3.0"
30
40
  },
31
- "scripts": {
32
- "api": "cloudpack-scripts api",
33
- "build:watch": "cloudpack-scripts build-watch",
34
- "build": "cloudpack-scripts build",
35
- "lint:update": "cloudpack-scripts lint-update",
36
- "lint": "cloudpack-scripts lint",
37
- "test:update": "cloudpack-scripts test-update",
38
- "test:watch": "cloudpack-scripts test-watch",
39
- "test": "cloudpack-scripts test"
40
- },
41
41
  "files": [
42
42
  "lib/**/!(*.test.*)"
43
43
  ]