@embroider/addon-dev 4.1.3 → 4.1.4-unstable.241f631

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embroider/addon-dev",
3
- "version": "4.1.3",
3
+ "version": "4.1.4-unstable.241f631",
4
4
  "description": "Utilities for addon authors",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,7 +22,11 @@
22
22
  "src/**/*.d.ts",
23
23
  "src/**/*.js.map"
24
24
  ],
25
+ "scripts": {
26
+ "test": "jest"
27
+ },
25
28
  "dependencies": {
29
+ "@embroider/core": "3.4.4-unstable.241f631",
26
30
  "@rollup/pluginutils": "^4.1.1",
27
31
  "content-tag": "^1.1.2",
28
32
  "fs-extra": "^10.0.0",
@@ -30,23 +34,19 @@
30
34
  "rollup-plugin-copy-assets": "^2.0.3",
31
35
  "rollup-plugin-delete": "^2.0.0",
32
36
  "walk-sync": "^3.0.0",
33
- "yargs": "^17.0.1",
34
- "@embroider/core": "^3.4.3"
37
+ "yargs": "^17.0.1"
35
38
  },
36
39
  "devDependencies": {
40
+ "@embroider/test-support": "workspace:*",
37
41
  "@glimmer/syntax": "^0.84.2",
38
42
  "@types/fs-extra": "^9.0.12",
39
43
  "@types/minimatch": "^3.0.4",
40
44
  "@types/yargs": "^17.0.3",
41
45
  "rollup": "^3.23.0",
42
46
  "tmp": "^0.1.0",
43
- "typescript": "^5.1.6",
44
- "@embroider/test-support": "0.36.0"
47
+ "typescript": "^5.1.6"
45
48
  },
46
49
  "engines": {
47
50
  "node": "12.* || 14.* || >= 16"
48
- },
49
- "scripts": {
50
- "test": "jest"
51
51
  }
52
- }
52
+ }
@@ -4,4 +4,5 @@ export default function appReexports(opts: {
4
4
  to: string;
5
5
  include: string[];
6
6
  mapFilename?: (filename: string) => string;
7
+ exports?: (filename: string) => string[] | string | undefined;
7
8
  }): Plugin;
@@ -10,22 +10,26 @@ function appReexports(opts) {
10
10
  return {
11
11
  name: 'app-reexports',
12
12
  generateBundle(_, bundle) {
13
- var _a, _b, _c;
13
+ var _a, _b, _c, _d;
14
14
  let pkg = (0, fs_extra_1.readJsonSync)('package.json');
15
15
  let appJS = {};
16
16
  for (let addonFilename of Object.keys(bundle)) {
17
17
  let appFilename = (_b = (_a = opts.mapFilename) === null || _a === void 0 ? void 0 : _a.call(opts, addonFilename)) !== null && _b !== void 0 ? _b : addonFilename;
18
+ let appExports = ((_c = opts.exports) === null || _c === void 0 ? void 0 : _c.call(opts, addonFilename)) || ['default'];
19
+ let computedExports = typeof appExports === 'string'
20
+ ? appExports
21
+ : `{ ${appExports.join(', ')} }`;
18
22
  if (opts.include.some((glob) => (0, minimatch_1.default)(addonFilename, glob)) &&
19
23
  !(0, minimatch_1.default)(addonFilename, '**/*.d.ts')) {
20
24
  appJS[`./${appFilename}`] = `./dist/_app_/${appFilename}`;
21
25
  this.emitFile({
22
26
  type: 'asset',
23
27
  fileName: `_app_/${appFilename}`,
24
- source: `export { default } from "${pkg.name}/${addonFilename.slice(0, -(0, path_1.extname)(addonFilename).length)}";\n`,
28
+ source: `export ${computedExports} from "${pkg.name}/${addonFilename.slice(0, -(0, path_1.extname)(addonFilename).length)}";\n`,
25
29
  });
26
30
  }
27
31
  }
28
- let originalAppJS = (_c = pkg['ember-addon']) === null || _c === void 0 ? void 0 : _c['app-js'];
32
+ let originalAppJS = (_d = pkg['ember-addon']) === null || _d === void 0 ? void 0 : _d['app-js'];
29
33
  let hasChanges = JSON.stringify(originalAppJS) !== JSON.stringify(appJS);
30
34
  // Don't cause a file i/o event unless something actually changed
31
35
  if (hasChanges) {
@@ -1 +1 @@
1
- {"version":3,"file":"rollup-app-reexports.js","sourceRoot":"","sources":["rollup-app-reexports.ts"],"names":[],"mappings":";;;;;AAAA,uCAAuD;AACvD,+BAA+B;AAC/B,0DAAkC;AAGlC,SAAwB,YAAY,CAAC,IAKpC;IACC,OAAO;QACL,IAAI,EAA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H,IAAA,wBAAa,EAAC,cAAc,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;aACnD;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AA1CD,+BA0CC","sourcesContent":["import { readJsonSync, writeJsonSync } from 'fs-extra';\nimport { extname } from 'path';\nimport minimatch from 'minimatch';\nimport type { Plugin } from 'rollup';\n\nexport default function appReexports(opts: {\n from: string;\n to: string;\n include: string[];\n mapFilename?: (filename: string) => string;\n}): Plugin {\n return {\n name: 'app-reexports',\n generateBundle(_, bundle) {\n let pkg = readJsonSync('package.json');\n let appJS: Record<string, string> = {};\n for (let addonFilename of Object.keys(bundle)) {\n let appFilename = opts.mapFilename?.(addonFilename) ?? addonFilename;\n\n if (\n opts.include.some((glob) => minimatch(addonFilename, glob)) &&\n !minimatch(addonFilename, '**/*.d.ts')\n ) {\n appJS[`./${appFilename}`] = `./dist/_app_/${appFilename}`;\n this.emitFile({\n type: 'asset',\n fileName: `_app_/${appFilename}`,\n source: `export { default } from \"${pkg.name}/${addonFilename.slice(\n 0,\n -extname(addonFilename).length\n )}\";\\n`,\n });\n }\n }\n let originalAppJS = pkg['ember-addon']?.['app-js'];\n\n let hasChanges = JSON.stringify(originalAppJS) !== JSON.stringify(appJS);\n\n // Don't cause a file i/o event unless something actually changed\n if (hasChanges) {\n pkg['ember-addon'] = Object.assign({}, pkg['ember-addon'], {\n 'app-js': appJS,\n });\n writeJsonSync('package.json', pkg, { spaces: 2 });\n }\n },\n };\n}\n"]}
1
+ {"version":3,"file":"rollup-app-reexports.js","sourceRoot":"","sources":["rollup-app-reexports.ts"],"names":[],"mappings":";;;;;AAAA,uCAAuD;AACvD,+BAA+B;AAC/B,0DAAkC;AAGlC,SAAwB,YAAY,CAAC,IAMpC;IACC,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,cAAc,CAAC,CAAC,EAAE,MAAM;;YACtB,IAAI,GAAG,GAAG,IAAA,uBAAY,EAAC,cAAc,CAAC,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I,UAAU,EAAE;gBACd,GAAG,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,aAAa,CAAC,EAAE;oBACzD,QAAQ,EAAE,KAAK;iBAChB,CAAC,CAAC;gBACH,IAAA,wBAAa,EAAC,cAAc,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;aACnD;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAhDD,+BAgDC","sourcesContent":["import { readJsonSync, writeJsonSync } from 'fs-extra';\nimport { extname } from 'path';\nimport minimatch from 'minimatch';\nimport type { Plugin } from 'rollup';\n\nexport default function appReexports(opts: {\n from: string;\n to: string;\n include: string[];\n mapFilename?: (filename: string) => string;\n exports?: (filename: string) => string[] | string | undefined;\n}): Plugin {\n return {\n name: 'app-reexports',\n generateBundle(_, bundle) {\n let pkg = readJsonSync('package.json');\n let appJS: Record<string, string> = {};\n for (let addonFilename of Object.keys(bundle)) {\n let appFilename = opts.mapFilename?.(addonFilename) ?? addonFilename;\n let appExports = opts.exports?.(addonFilename) || ['default'];\n\n let computedExports =\n typeof appExports === 'string'\n ? appExports\n : `{ ${appExports.join(', ')} }`;\n\n if (\n opts.include.some((glob) => minimatch(addonFilename, glob)) &&\n !minimatch(addonFilename, '**/*.d.ts')\n ) {\n appJS[`./${appFilename}`] = `./dist/_app_/${appFilename}`;\n this.emitFile({\n type: 'asset',\n fileName: `_app_/${appFilename}`,\n source: `export ${computedExports} from \"${\n pkg.name\n }/${addonFilename.slice(0, -extname(addonFilename).length)}\";\\n`,\n });\n }\n }\n let originalAppJS = pkg['ember-addon']?.['app-js'];\n\n let hasChanges = JSON.stringify(originalAppJS) !== JSON.stringify(appJS);\n\n // Don't cause a file i/o event unless something actually changed\n if (hasChanges) {\n pkg['ember-addon'] = Object.assign({}, pkg['ember-addon'], {\n 'app-js': appJS,\n });\n writeJsonSync('package.json', pkg, { spaces: 2 });\n }\n },\n };\n}\n"]}
@@ -24,7 +24,7 @@ function publicAssets(path, opts) {
24
24
  ignore: excludedGlobPatterns,
25
25
  });
26
26
  const publicAssets = filenames.reduce((acc, v) => {
27
- acc[`./${path}/${v}`] = ['/', pkg.name, '/', path, '/', v].join('');
27
+ acc[`./${path}/${v}`] = ['/', pkg.name, '/', v].join('');
28
28
  return acc;
29
29
  }, {});
30
30
  let originalPublicAssets = (_a = pkg['ember-addon']) === null || _a === void 0 ? void 0 : _a['public-assets'];
@@ -1 +1 @@
1
- {"version":3,"file":"rollup-public-assets.js","sourceRoot":"","sources":["rollup-public-assets.ts"],"names":[],"mappings":";;;;;AAAA,uCAAuD;AACvD,0DAAiC;AAGjC,SAAwB,YAAY,CAClC,IAAY,EACZ,IAA8C;IAE9C,MAAM,mBAAmB,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,CAAC;IAC1C,MAAM,oBAAoB,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,KAAI,EAAE,CAAC;IAEjD,OAAO;QACL,IAAI,EAAE,uBAAuB;QAE7B,2EAA2E;QAC3E,+BAA+B;QAC/B,UAAU;YACR,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QAED,cAAc;;YACZ,IAAI,GAAG,GAAG,IAAA,uBAAY,EAAC,cAAc,CAAC,CAAC;YACvC,MAAM,SAAS,GAAG,IAAA,mBAAQ,EAAC,IAAI,EAAE;gBAC/B,WAAW,EAAE,KAAK;gBAClB,KAAK,EAAE,mBAAmB;gBAC1B,MAAM,EAAE,oBAAoB;aAC7B,CAAC,CAAC;YACH,MAAM,YAAY,GAA2B,SAAS,CAAC,MAAM,CAC3D,CAAC,GAA2B,EAAE,CAAC,EAA0B,EAAE;gBACzD,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACpE,OAAO,GAAG,CAAC;YACb,CAAC,EACD,EAAE,CACH,CAAC;YAEF,IAAI,oBAAoB,GAAG,MAAA,GAAG,CAAC,aAAa,CAAC,0CAAG,eAAe,CAAC,CAAC;YAEjE,IAAI,UAAU,GACZ,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;YAExE,IAAI,UAAU,EAAE;gBACd,GAAG,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,aAAa,CAAC,EAAE;oBACzD,eAAe,EAAE,YAAY;iBAC9B,CAAC,CAAC;gBAEH,IAAA,wBAAa,EAAC,cAAc,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;aACnD;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AA7CD,+BA6CC","sourcesContent":["import { readJsonSync, writeJsonSync } from 'fs-extra';\nimport walkSync from 'walk-sync';\nimport type { Plugin } from 'rollup';\n\nexport default function publicAssets(\n path: string,\n opts: { include: string[]; exclude: string[] }\n): Plugin {\n const includeGlobPatterns = opts?.include;\n const excludedGlobPatterns = opts?.exclude || [];\n\n return {\n name: 'public-assets-bundler',\n\n // Prior to https://github.com/rollup/rollup/pull/5270, we cannot call this\n // from within `generateBundle`\n buildStart() {\n this.addWatchFile(path);\n },\n\n generateBundle() {\n let pkg = readJsonSync('package.json');\n const filenames = walkSync(path, {\n directories: false,\n globs: includeGlobPatterns,\n ignore: excludedGlobPatterns,\n });\n const publicAssets: Record<string, string> = filenames.reduce(\n (acc: Record<string, string>, v): Record<string, string> => {\n acc[`./${path}/${v}`] = ['/', pkg.name, '/', path, '/', v].join('');\n return acc;\n },\n {}\n );\n\n let originalPublicAssets = pkg['ember-addon']?.['public-assets'];\n\n let hasChanges =\n JSON.stringify(originalPublicAssets) !== JSON.stringify(publicAssets);\n\n if (hasChanges) {\n pkg['ember-addon'] = Object.assign({}, pkg['ember-addon'], {\n 'public-assets': publicAssets,\n });\n\n writeJsonSync('package.json', pkg, { spaces: 2 });\n }\n },\n };\n}\n"]}
1
+ {"version":3,"file":"rollup-public-assets.js","sourceRoot":"","sources":["rollup-public-assets.ts"],"names":[],"mappings":";;;;;AAAA,uCAAuD;AACvD,0DAAiC;AAGjC,SAAwB,YAAY,CAClC,IAAY,EACZ,IAA8C;IAE9C,MAAM,mBAAmB,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,CAAC;IAC1C,MAAM,oBAAoB,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,KAAI,EAAE,CAAC;IAEjD,OAAO;QACL,IAAI,EAAE,uBAAuB;QAE7B,2EAA2E;QAC3E,+BAA+B;QAC/B,UAAU;YACR,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QAED,cAAc;;YACZ,IAAI,GAAG,GAAG,IAAA,uBAAY,EAAC,cAAc,CAAC,CAAC;YACvC,MAAM,SAAS,GAAG,IAAA,mBAAQ,EAAC,IAAI,EAAE;gBAC/B,WAAW,EAAE,KAAK;gBAClB,KAAK,EAAE,mBAAmB;gBAC1B,MAAM,EAAE,oBAAoB;aAC7B,CAAC,CAAC;YACH,MAAM,YAAY,GAA2B,SAAS,CAAC,MAAM,CAC3D,CAAC,GAA2B,EAAE,CAAC,EAA0B,EAAE;gBACzD,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACzD,OAAO,GAAG,CAAC;YACb,CAAC,EACD,EAAE,CACH,CAAC;YAEF,IAAI,oBAAoB,GAAG,MAAA,GAAG,CAAC,aAAa,CAAC,0CAAG,eAAe,CAAC,CAAC;YAEjE,IAAI,UAAU,GACZ,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;YAExE,IAAI,UAAU,EAAE;gBACd,GAAG,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,aAAa,CAAC,EAAE;oBACzD,eAAe,EAAE,YAAY;iBAC9B,CAAC,CAAC;gBAEH,IAAA,wBAAa,EAAC,cAAc,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;aACnD;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AA7CD,+BA6CC","sourcesContent":["import { readJsonSync, writeJsonSync } from 'fs-extra';\nimport walkSync from 'walk-sync';\nimport type { Plugin } from 'rollup';\n\nexport default function publicAssets(\n path: string,\n opts: { include: string[]; exclude: string[] }\n): Plugin {\n const includeGlobPatterns = opts?.include;\n const excludedGlobPatterns = opts?.exclude || [];\n\n return {\n name: 'public-assets-bundler',\n\n // Prior to https://github.com/rollup/rollup/pull/5270, we cannot call this\n // from within `generateBundle`\n buildStart() {\n this.addWatchFile(path);\n },\n\n generateBundle() {\n let pkg = readJsonSync('package.json');\n const filenames = walkSync(path, {\n directories: false,\n globs: includeGlobPatterns,\n ignore: excludedGlobPatterns,\n });\n const publicAssets: Record<string, string> = filenames.reduce(\n (acc: Record<string, string>, v): Record<string, string> => {\n acc[`./${path}/${v}`] = ['/', pkg.name, '/', v].join('');\n return acc;\n },\n {}\n );\n\n let originalPublicAssets = pkg['ember-addon']?.['public-assets'];\n\n let hasChanges =\n JSON.stringify(originalPublicAssets) !== JSON.stringify(publicAssets);\n\n if (hasChanges) {\n pkg['ember-addon'] = Object.assign({}, pkg['ember-addon'], {\n 'public-assets': publicAssets,\n });\n\n writeJsonSync('package.json', pkg, { spaces: 2 });\n }\n },\n };\n}\n"]}
package/src/rollup.d.ts CHANGED
@@ -8,6 +8,7 @@ export declare class Addon {
8
8
  });
9
9
  appReexports(patterns: string[], opts?: {
10
10
  mapFilename?: (fileName: string) => string;
11
+ exports?: (filename: string) => string[] | string | undefined;
11
12
  }): Plugin;
12
13
  publicEntrypoints(patterns: string[]): Plugin<any>;
13
14
  hbs(): Plugin<any>;
package/src/rollup.js CHANGED
@@ -41,6 +41,7 @@ class Addon {
41
41
  to: __classPrivateFieldGet(this, _Addon_destDir, "f"),
42
42
  include: patterns,
43
43
  mapFilename: opts.mapFilename,
44
+ exports: opts.exports,
44
45
  });
45
46
  }
46
47
  // This configures rollup to emit public entrypoints for each module in your
package/src/rollup.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"rollup.js","sourceRoot":"","sources":["rollup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,4EAAqD;AACrD,4EAAqD;AACrD,4FAA2E;AAC3E,kFAAiE;AAEjE,gFAAwD;AACxD,8EAA6D;AAC7D,4FAAsE;AACtE,kFAAiE;AAGjE,MAAa,KAAK;IAIhB,YAAY,SAAgD,EAAE;;QAH9D,gCAAgB;QAChB,iCAAiB;QAGf,uBAAA,IAAI,iBAAW,MAAA,MAAM,CAAC,MAAM,mCAAI,KAAK,MAAA,CAAC;QACtC,uBAAA,IAAI,kBAAY,MAAA,MAAM,CAAC,OAAO,mCAAI,MAAM,MAAA,CAAC;IAC3C,CAAC;IAED,0EAA0E;IAC1E,yEAAyE;IACzE,0CAA0C;IAC1C,YAAY,CACV,QAAkB,EAClB,OAAuD,EAAE;QAEzD,OAAO,IAAA,8BAAY,EAAC;YAClB,IAAI,EAAE,uBAAA,IAAI,qBAAQ;YAClB,EAAE,EAAE,uBAAA,IAAI,sBAAS;YACjB,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC,CAAC;IACL,CAAC;IAED,4EAA4E;IAC5E,0EAA0E;IAC1E,+EAA+E;IAC/E,iBAAiB,CAAC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} from './rollup-hbs-plugin';\nimport { default as gjs } from './rollup-gjs-plugin';\nimport { default as publicEntrypoints } from './rollup-public-entrypoints';\nimport { default as appReexports } from './rollup-app-reexports';\nimport type { Options as DelOptions } from 'rollup-plugin-delete';\nimport { default as clean } from 'rollup-plugin-delete';\nimport { default as keepAssets } from './rollup-keep-assets';\nimport { default as dependencies } from './rollup-addon-dependencies';\nimport { default as publicAssets } from './rollup-public-assets';\nimport type { Plugin } from 'rollup';\n\nexport class Addon {\n #srcDir: string;\n #destDir: string;\n\n constructor(params: { srcDir?: string; destDir?: string } = {}) {\n this.#srcDir = params.srcDir ?? 'src';\n this.#destDir = params.destDir ?? 'dist';\n }\n\n // Given a list of globs describing modules in your srcDir, this generates\n // corresponding appTree modules that contain reexports, and updates your\n // package.json metadata to list them all.\n appReexports(\n patterns: string[],\n opts: { mapFilename?: (fileName: string) => string } = {}\n ): Plugin {\n return appReexports({\n from: this.#srcDir,\n to: this.#destDir,\n include: patterns,\n mapFilename: opts.mapFilename,\n });\n }\n\n // This configures rollup to emit public entrypoints for each module in your\n // srcDir that matches one of the given globs. Typical addons will want to\n // match patterns like \"components/**/*.js\", \"index.js\", and \"test-support.js\".\n publicEntrypoints(patterns: string[]) {\n return publicEntrypoints({ srcDir: this.#srcDir, include: patterns });\n }\n\n // This wraps standalone .hbs files as Javascript files using inline\n // templates. This means special resolving rules for .hbs files aren't\n // required for javascript tooling to understand your package.\n hbs() {\n return hbs();\n }\n\n gjs() {\n return gjs();\n }\n\n // By default rollup does not clear the output directory between builds. This\n // does that.\n clean(options: DelOptions) {\n return clean({ targets: `${this.#destDir}/*`, ...options });\n }\n\n // V2 Addons are allowed to contain imports of .css files. This tells rollup\n // to leave those imports alone and to make sure the corresponding .css files\n // are kept in the same relative locations in the destDir as they were in the\n // srcDir.\n keepAssets(patterns: string[]) {\n return keepAssets({\n from: this.#srcDir,\n include: patterns,\n });\n }\n\n // This is the default `output` configuration you should pass to rollup. We're\n // emitting ES modules, in your `destDir`, and their filenames are equal to\n // their bundle names (the bundle names get generated by `publicEntrypoints`\n // above).\n //\n // hoistTransitiveImports is disabled because the purpose of hoisting transitive imports\n // is to improve performance of apps loading modules.\n // Since v2 addons do not know exactly how they'll be used, this performance decision\n // is left up to apps.\n output() {\n return {\n dir: this.#destDir,\n entryFileNames: '[name]',\n experimentalMinChunkSize: 0,\n format: 'es',\n hoistTransitiveImports: false,\n sourcemap: true,\n };\n }\n\n dependencies() {\n return dependencies();\n }\n\n publicAssets(path: string, opts: { include: string[]; exclude: string[] }) {\n return publicAssets(path, opts);\n }\n}\n"]}
1
+ {"version":3,"file":"rollup.js","sourceRoot":"","sources":["rollup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,4EAAqD;AACrD,4EAAqD;AACrD,4FAA2E;AAC3E,kFAAiE;AAEjE,gFAAwD;AACxD,8EAA6D;AAC7D,4FAAsE;AACtE,kFAAiE;AAGjE,MAAa,KAAK;IAIhB,YAAY,SAAgD,EAAE;;QAH9D,gCAAgB;QAChB,iCAAiB;QAGf,uBAAA,IAAI,iBAAW,MAAA,MAAM,CAAC,MAAM,mCAAI,KAAK,MAAA,CAAC;QACtC,uBAAA,IAAI,kBAAY,MAAA,MAAM,CAAC,OAAO,mCAAI,MAAM,MAAA,CAAC;IAC3C,CAAC;IAED,0EAA0E;IAC1E,yEAAyE;IACzE,0CAA0C;IAC1C,YAAY,CACV,QAAkB,EAClB,OAGI,EAAE;QAEN,OAAO,IAAA,8BAAY,EAAC;YAClB,IAAI,EAAE,uBAAA,IAAI,qBAAQ;YAClB,EAAE,EAAE,uBAAA,IAAI,sBAAS;YACjB,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,CAAC;IACL,CAAC;IAED,4EAA4E;IAC5E,0EAA0E;IAC1E,+EAA+E;IAC/E,iBAAiB,CAAC,QAAkB;QAClC,OAAO,IAAA,mCAAiB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rollup-gjs-plugin';\nimport { default as publicEntrypoints } from './rollup-public-entrypoints';\nimport { default as appReexports } from './rollup-app-reexports';\nimport type { Options as DelOptions } from 'rollup-plugin-delete';\nimport { default as clean } from 'rollup-plugin-delete';\nimport { default as keepAssets } from './rollup-keep-assets';\nimport { default as dependencies } from './rollup-addon-dependencies';\nimport { default as publicAssets } from './rollup-public-assets';\nimport type { Plugin } from 'rollup';\n\nexport class Addon {\n #srcDir: string;\n #destDir: string;\n\n constructor(params: { srcDir?: string; destDir?: string } = {}) {\n this.#srcDir = params.srcDir ?? 'src';\n this.#destDir = params.destDir ?? 'dist';\n }\n\n // Given a list of globs describing modules in your srcDir, this generates\n // corresponding appTree modules that contain reexports, and updates your\n // package.json metadata to list them all.\n appReexports(\n patterns: string[],\n opts: {\n mapFilename?: (fileName: string) => string;\n exports?: (filename: string) => string[] | string | undefined;\n } = {}\n ): Plugin {\n return appReexports({\n from: this.#srcDir,\n to: this.#destDir,\n include: patterns,\n mapFilename: opts.mapFilename,\n exports: opts.exports,\n });\n }\n\n // This configures rollup to emit public entrypoints for each module in your\n // srcDir that matches one of the given globs. Typical addons will want to\n // match patterns like \"components/**/*.js\", \"index.js\", and \"test-support.js\".\n publicEntrypoints(patterns: string[]) {\n return publicEntrypoints({ srcDir: this.#srcDir, include: patterns });\n }\n\n // This wraps standalone .hbs files as Javascript files using inline\n // templates. This means special resolving rules for .hbs files aren't\n // required for javascript tooling to understand your package.\n hbs() {\n return hbs();\n }\n\n gjs() {\n return gjs();\n }\n\n // By default rollup does not clear the output directory between builds. This\n // does that.\n clean(options: DelOptions) {\n return clean({ targets: `${this.#destDir}/*`, ...options });\n }\n\n // V2 Addons are allowed to contain imports of .css files. This tells rollup\n // to leave those imports alone and to make sure the corresponding .css files\n // are kept in the same relative locations in the destDir as they were in the\n // srcDir.\n keepAssets(patterns: string[]) {\n return keepAssets({\n from: this.#srcDir,\n include: patterns,\n });\n }\n\n // This is the default `output` configuration you should pass to rollup. We're\n // emitting ES modules, in your `destDir`, and their filenames are equal to\n // their bundle names (the bundle names get generated by `publicEntrypoints`\n // above).\n //\n // hoistTransitiveImports is disabled because the purpose of hoisting transitive imports\n // is to improve performance of apps loading modules.\n // Since v2 addons do not know exactly how they'll be used, this performance decision\n // is left up to apps.\n output() {\n return {\n dir: this.#destDir,\n entryFileNames: '[name]',\n experimentalMinChunkSize: 0,\n format: 'es',\n hoistTransitiveImports: false,\n sourcemap: true,\n };\n }\n\n dependencies() {\n return dependencies();\n }\n\n publicAssets(path: string, opts: { include: string[]; exclude: string[] }) {\n return publicAssets(path, opts);\n }\n}\n"]}
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2018 Edward Faulkner
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.