@ms-cloudpack/bundler-rollup 0.2.2 → 0.2.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,5 +1,5 @@
1
1
  import { shouldExternalizePackage } from '@ms-cloudpack/bundler-utilities';
2
- import { isExternalPackage } from '@ms-cloudpack/package-utilities';
2
+ import { isExternalPackage } from '@ms-cloudpack/path-utilities';
3
3
  import fs from 'fs';
4
4
  import path from 'path';
5
5
  import { getRollupPlugins } from './getRollupPlugins.js';
@@ -1 +1 @@
1
- {"version":3,"file":"getRollupOptions.js","sourceRoot":"","sources":["../src/getRollupOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAG3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,wFAAwF;AACxF,mDAAmD;AACnD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC;AAEnE,yCAAyC;AACzC,MAAM,eAAe,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAE2C;IAO3C,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACvC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,cAAc,GAAG,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IACnH,MAAM,UAAU,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAChD,MAAM,gBAAgB,GAAG,CAAC,UAAU,IA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AAC,CAAC,SAAS;YACjF,MAAM,EAAE,IAAI;SACb;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { shouldExternalizePackage } from '@ms-cloudpack/bundler-utilities';\nimport type { BundleOptions } from '@ms-cloudpack/common-types';\nimport type { WriteESMStubsResult } from '@ms-cloudpack/esm-stub-utilities';\nimport { isExternalPackage } from '@ms-cloudpack/package-utilities';\nimport fs from 'fs';\nimport path from 'path';\nimport type { InputOptions, OutputOptions, RollupLog, RollupOptions } from 'rollup';\nimport { getRollupPlugins } from './getRollupPlugins.js';\n\n// These are the polyfills that we support from the 'rollup-plugin-polyfill-node' plugin\n// that are not included in the node builtins list.\nconst polyfills = new Set(['global', '_inherits', '_buffer_list']);\n\n// Spammy, usually non-actionable warning\nconst ignoredWarnings = ['Circular dependency:'];\n\n/**\n * Converts BundlerOptions to Rollup-specific options.\n */\nexport async function getRollupOptions(\n params: {\n options: Omit<BundleOptions, 'entries'>;\n } & Pick<WriteESMStubsResult, 'newEntries'>,\n): Promise<{\n inputOptions: RollupOptions;\n outputOptions: OutputOptions;\n /** Warnings will be pushed to this array (rollup handles warnings with a callback) */\n warnings: RollupLog[];\n}> {\n const { options, newEntries } = params;\n const { inputPath, minify, external = [], inlined = [], bundlerOptions = {}, dynamicImports, sourcemap } = options;\n const isExternal = isExternalPackage(inputPath);\n const enableTypescript = !isExternal && fs.existsSync(path.resolve(inputPath, 'tsconfig.json'));\n const warnings: RollupLog[] = [];\n\n return {\n warnings,\n inputOptions: {\n external: (id) => shouldExternalizePackage({ id, inlined, external, polyfills, shouldInlineNodeBuiltins: true }),\n ...(bundlerOptions.inputOptions as InputOptions),\n // Don't allow overriding the options below\n\n // Rollup requires entry keys without a leading ./\n input: Object.fromEntries(Object.entries(newEntries).map(([key, value]) => [key.replace(/^\\.\\//, ''), value])),\n // These are not possible to override properly via JSON config\n plugins: await getRollupPlugins({\n isProduction: minify,\n packagePath: inputPath,\n enableTypescript,\n dynamicImports,\n sourcemap,\n }),\n onwarn: (warning) => {\n if (!ignoredWarnings.some((ignored) => warning.message.includes(ignored))) {\n warnings.push(warning);\n }\n },\n },\n outputOptions: {\n sourcemap,\n ...(bundlerOptions.outputOptions as OutputOptions),\n // No overriding these options\n dir: options.outputPath ? path.resolve(inputPath, options.outputPath) : inputPath,\n format: 'es',\n },\n };\n}\n"]}
1
+ {"version":3,"file":"getRollupOptions.js","sourceRoot":"","sources":["../src/getRollupOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAG3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,wFAAwF;AACxF,mDAAmD;AACnD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC;AAEnE,yCAAyC;AACzC,MAAM,eAAe,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAE2C;IAO3C,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACvC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,cAAc,GAAG,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IACnH,MAAM,UAAU,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAChD,MAAM,gBAAgB,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC;IAChG,MAAM,QAAQ,GAAgB,EAAE,CAAC;IAEjC,OAAO;Q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cloudpack/common-types';\nimport type { WriteESMStubsResult } from '@ms-cloudpack/esm-stub-utilities';\nimport { isExternalPackage } from '@ms-cloudpack/path-utilities';\nimport fs from 'fs';\nimport path from 'path';\nimport type { InputOptions, OutputOptions, RollupLog, RollupOptions } from 'rollup';\nimport { getRollupPlugins } from './getRollupPlugins.js';\n\n// These are the polyfills that we support from the 'rollup-plugin-polyfill-node' plugin\n// that are not included in the node builtins list.\nconst polyfills = new Set(['global', '_inherits', '_buffer_list']);\n\n// Spammy, usually non-actionable warning\nconst ignoredWarnings = ['Circular dependency:'];\n\n/**\n * Converts BundlerOptions to Rollup-specific options.\n */\nexport async function getRollupOptions(\n params: {\n options: Omit<BundleOptions, 'entries'>;\n } & Pick<WriteESMStubsResult, 'newEntries'>,\n): Promise<{\n inputOptions: RollupOptions;\n outputOptions: OutputOptions;\n /** Warnings will be pushed to this array (rollup handles warnings with a callback) */\n warnings: RollupLog[];\n}> {\n const { options, newEntries } = params;\n const { inputPath, minify, external = [], inlined = [], bundlerOptions = {}, dynamicImports, sourcemap } = options;\n const isExternal = isExternalPackage(inputPath);\n const enableTypescript = !isExternal && fs.existsSync(path.resolve(inputPath, 'tsconfig.json'));\n const warnings: RollupLog[] = [];\n\n return {\n warnings,\n inputOptions: {\n external: (id) => shouldExternalizePackage({ id, inlined, external, polyfills, shouldInlineNodeBuiltins: true }),\n ...(bundlerOptions.inputOptions as InputOptions),\n // Don't allow overriding the options below\n\n // Rollup requires entry keys without a leading ./\n input: Object.fromEntries(Object.entries(newEntries).map(([key, value]) => [key.replace(/^\\.\\//, ''), value])),\n // These are not possible to override properly via JSON config\n plugins: await getRollupPlugins({\n isProduction: minify,\n packagePath: inputPath,\n enableTypescript,\n dynamicImports,\n sourcemap,\n }),\n onwarn: (warning) => {\n if (!ignoredWarnings.some((ignored) => warning.message.includes(ignored))) {\n warnings.push(warning);\n }\n },\n },\n outputOptions: {\n sourcemap,\n ...(bundlerOptions.outputOptions as OutputOptions),\n // No overriding these options\n dir: options.outputPath ? path.resolve(inputPath, options.outputPath) : inputPath,\n format: 'es',\n },\n };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/bundler-rollup",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "A cloudpack plugin for abstracting rollup.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -19,13 +19,13 @@
19
19
  }
20
20
  },
21
21
  "dependencies": {
22
- "@ms-cloudpack/bundler-capabilities": "^0.2.3",
23
- "@ms-cloudpack/bundler-utilities": "^0.1.16",
24
- "@ms-cloudpack/common-types": "^0.23.6",
25
- "@ms-cloudpack/esm-stub-utilities": "^0.13.20",
26
- "@ms-cloudpack/package-utilities": "^10.4.2",
27
- "@ms-cloudpack/path-string-parsing": "^1.2.5",
28
- "@ms-cloudpack/path-utilities": "^2.7.56",
22
+ "@ms-cloudpack/bundler-capabilities": "^0.2.4",
23
+ "@ms-cloudpack/bundler-utilities": "^0.1.17",
24
+ "@ms-cloudpack/common-types": "^0.23.7",
25
+ "@ms-cloudpack/esm-stub-utilities": "^0.13.21",
26
+ "@ms-cloudpack/package-utilities": "^11.0.0",
27
+ "@ms-cloudpack/path-string-parsing": "^1.2.6",
28
+ "@ms-cloudpack/path-utilities": "^2.8.0",
29
29
  "@rollup/plugin-dynamic-import-vars": "^2.0.0",
30
30
  "@rollup/plugin-json": "^6.0.0",
31
31
  "@rollup/plugin-node-resolve": "^15.0.0",
@@ -48,6 +48,7 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@ms-cloudpack/bundler-tests": "^0.1.0",
51
+ "@ms-cloudpack/environment": "^0.1.1",
51
52
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
52
53
  "@ms-cloudpack/scripts": "^0.0.1",
53
54
  "@ms-cloudpack/test-utilities": "^0.5.0",
@@ -1,11 +0,0 @@
1
- // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
- // It should be published with your NPM package. It should not be tracked by Git.
3
- {
4
- "tsdocVersion": "0.12",
5
- "toolPackages": [
6
- {
7
- "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.47.11"
9
- }
10
- ]
11
- }