@ms-cloudpack/bundler 0.11.27 → 0.11.29

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,2 +1,9 @@
1
+ /**
2
+ * Returns true if the file path is a valid bundle-able file extension. This is used to filter exports maps out
3
+ * to ensure we prevent trying to bundle things that bundlers don't support. We can bundle things like TS,
4
+ * JS, CSS, SCSS, JSON, and even text extensions like .txt and .html. These formats all will produce javascript
5
+ * modules. "Valid" is defined by what the bundler abstraction expects. In the future we may want this code to be
6
+ * provided by the plugin itself so that it owns what's "supported".
7
+ */
1
8
  export declare function isValidBundleEntry(filePath: string): boolean;
2
9
  //# sourceMappingURL=isValidBundleEntry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isValidBundleEntry.d.ts","sourceRoot":"","sources":["../src/isValidBundleEntry.ts"],"names":[],"mappings":"AAqBA,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE5D"}
1
+ {"version":3,"file":"isValidBundleEntry.d.ts","sourceRoot":"","sources":["../src/isValidBundleEntry.ts"],"names":[],"mappings":"AAyBA;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAK5D"}
@@ -17,7 +17,19 @@ const resourceExtensions = [
17
17
  const sourceExtensions = ['.mts', '.cts', '.mjs', '.cjs', '.js', '.tsx', '.ts', '.json', '.css', '.scss'];
18
18
  const textExtensions = ['.htm', '.html', '.txt'];
19
19
  const supportedExtensions = [...resourceExtensions, ...sourceExtensions, ...textExtensions];
20
+ // Note: excluded extensions only need to contain things that are allowed by supportedExtensions but using
21
+ // an extended syntax that we don't want to support. For example, we want to support .ts files but not .d.ts.
22
+ const excludedExtensions = ['.d.ts'];
23
+ /**
24
+ * Returns true if the file path is a valid bundle-able file extension. This is used to filter exports maps out
25
+ * to ensure we prevent trying to bundle things that bundlers don't support. We can bundle things like TS,
26
+ * JS, CSS, SCSS, JSON, and even text extensions like .txt and .html. These formats all will produce javascript
27
+ * modules. "Valid" is defined by what the bundler abstraction expects. In the future we may want this code to be
28
+ * provided by the plugin itself so that it owns what's "supported".
29
+ */
20
30
  export function isValidBundleEntry(filePath) {
21
- return supportedExtensions.indexOf(path.extname(filePath).toLowerCase()) >= 0;
31
+ const isSupported = supportedExtensions.includes(path.extname(filePath).toLowerCase());
32
+ const isExcluded = excludedExtensions.some((excludedExt) => filePath.endsWith(excludedExt));
33
+ return isSupported && !isExcluded;
22
34
  }
23
35
  //# sourceMappingURL=isValidBundleEntry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isValidBundleEntry.js","sourceRoot":"","sources":["../src/isValidBundleEntry.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,kBAAkB,GAAG;IACzB,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,OAAO;IACP,QAAQ;CACT,CAAC;AACF,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAC1G,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AACjD,MAAM,mBAAmB,GAAG,CAAC,GAAG,kBAAkB,EAAE,GAAG,gBAAgB,EAAE,GAAG,cAAc,CAAC,CAAC;AAE5F,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,OAAO,mBAAmB,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC;AAChF,CAAC","sourcesContent":["import path from 'path';\n\nconst resourceExtensions = [\n '.bmp',\n '.gif',\n '.jpeg',\n '.jpg',\n '.mp3',\n '.mp4',\n '.otf',\n '.png',\n '.svg',\n '.ttf',\n '.webp',\n '.woff',\n '.woff2',\n];\nconst sourceExtensions = ['.mts', '.cts', '.mjs', '.cjs', '.js', '.tsx', '.ts', '.json', '.css', '.scss'];\nconst textExtensions = ['.htm', '.html', '.txt'];\nconst supportedExtensions = [...resourceExtensions, ...sourceExtensions, ...textExtensions];\n\nexport function isValidBundleEntry(filePath: string): boolean {\n return supportedExtensions.indexOf(path.extname(filePath).toLowerCase()) >= 0;\n}\n"]}
1
+ {"version":3,"file":"isValidBundleEntry.js","sourceRoot":"","sources":["../src/isValidBundleEntry.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,kBAAkB,GAAG;IACzB,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,OAAO;IACP,QAAQ;CACT,CAAC;AACF,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAC1G,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AACjD,MAAM,mBAAmB,GAAG,CAAC,GAAG,kBAAkB,EAAE,GAAG,gBAAgB,EAAE,GAAG,cAAc,CAAC,CAAC;AAE5F,0GAA0G;AAC1G,6GAA6G;AAC7G,MAAM,kBAAkB,GAAG,CAAC,OAAO,CAAC,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,MAAM,WAAW,GAAG,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IACvF,MAAM,UAAU,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;IAE5F,OAAO,WAAW,IAAI,CAAC,UAAU,CAAC;AACpC,CAAC","sourcesContent":["import path from 'path';\n\nconst resourceExtensions = [\n '.bmp',\n '.gif',\n '.jpeg',\n '.jpg',\n '.mp3',\n '.mp4',\n '.otf',\n '.png',\n '.svg',\n '.ttf',\n '.webp',\n '.woff',\n '.woff2',\n];\nconst sourceExtensions = ['.mts', '.cts', '.mjs', '.cjs', '.js', '.tsx', '.ts', '.json', '.css', '.scss'];\nconst textExtensions = ['.htm', '.html', '.txt'];\nconst supportedExtensions = [...resourceExtensions, ...sourceExtensions, ...textExtensions];\n\n// Note: excluded extensions only need to contain things that are allowed by supportedExtensions but using\n// an extended syntax that we don't want to support. For example, we want to support .ts files but not .d.ts.\nconst excludedExtensions = ['.d.ts'];\n\n/**\n * Returns true if the file path is a valid bundle-able file extension. This is used to filter exports maps out\n * to ensure we prevent trying to bundle things that bundlers don't support. We can bundle things like TS,\n * JS, CSS, SCSS, JSON, and even text extensions like .txt and .html. These formats all will produce javascript\n * modules. \"Valid\" is defined by what the bundler abstraction expects. In the future we may want this code to be\n * provided by the plugin itself so that it owns what's \"supported\".\n */\nexport function isValidBundleEntry(filePath: string): boolean {\n const isSupported = supportedExtensions.includes(path.extname(filePath).toLowerCase());\n const isExcluded = excludedExtensions.some((excludedExt) => filePath.endsWith(excludedExt));\n\n return isSupported && !isExcluded;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/bundler",
3
- "version": "0.11.27",
3
+ "version": "0.11.29",
4
4
  "description": "An abstraction to bundle source code.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,10 +14,10 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@ms-cloudpack/json-utilities": "^0.0.6",
17
- "@ms-cloudpack/bundler-plugin-ori": "^0.8.7",
18
- "@ms-cloudpack/bundler-plugin-rollup": "^0.6.15",
19
- "@ms-cloudpack/bundler-types": "^0.12.1",
20
- "@ms-cloudpack/package-utilities": "^2.4.1",
17
+ "@ms-cloudpack/bundler-plugin-ori": "^0.8.9",
18
+ "@ms-cloudpack/bundler-plugin-rollup": "^0.6.17",
19
+ "@ms-cloudpack/bundler-types": "^0.12.2",
20
+ "@ms-cloudpack/package-utilities": "^2.4.3",
21
21
  "@ms-cloudpack/path-string-parsing": "^1.0.1",
22
22
  "@ms-cloudpack/path-utilities": "^2.2.1"
23
23
  },