@ts-ioc-container/bundler 1.4.0 → 1.5.0

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/cjm/config.js CHANGED
@@ -84,11 +84,13 @@ function toSelector(value, field) {
84
84
  function toBundle(value, field, dir) {
85
85
  if (!isObject(value))
86
86
  return fail(field, 'an object');
87
- const { output, name, namespaces, select, exclude, additionalExclude, include, filterExports } = value;
87
+ const { output, name, tags, namespaces, select, exclude, additionalExclude, include, filterExports } = value;
88
88
  if (!isNonEmptyString(output))
89
89
  return fail(`${field}.output`, 'a non-empty string');
90
90
  if (name !== undefined && !isIdentifier(name))
91
91
  return fail(`${field}.name`, 'a valid identifier');
92
+ if (tags !== undefined && !isStringArray(tags))
93
+ return fail(`${field}.tags`, 'an array of strings');
92
94
  if (!Array.isArray(namespaces) || namespaces.length === 0)
93
95
  return fail(`${field}.namespaces`, 'a non-empty array');
94
96
  if (exclude !== undefined && !isStringArray(exclude))
@@ -104,6 +106,7 @@ function toBundle(value, field, dir) {
104
106
  return {
105
107
  output: node_path_1.default.resolve(dir, output),
106
108
  name: name ?? exports.DEFAULT_BUNDLE_NAME,
109
+ tags: tags ?? [],
107
110
  namespaces: namespaces.map((ns, i) => toNamespace(ns, `${field}.namespaces[${i}]`)),
108
111
  select: toSelector(select, `${field}.select`),
109
112
  exclude: [...(exclude ?? exports.DEFAULT_EXCLUDE), ...(additionalExclude ?? [])],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-ioc-container/bundler",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Bundles your dependencies into a single container module for ts-ioc-container: the `tic` CLI scans folders (by path or tsconfig alias) and generates one typed bundle that registers every class — `container.useModule(new AppBundle())`.",
5
5
  "publishConfig": {
6
6
  "access": "public",
package/tic.schema.json CHANGED
@@ -42,6 +42,14 @@
42
42
  "default": "Bundle",
43
43
  "description": "Name of the generated class, an IContainerModule."
44
44
  },
45
+ "tags": {
46
+ "type": "array",
47
+ "items": {
48
+ "type": "string",
49
+ "minLength": 1
50
+ },
51
+ "description": "Tags associated with the bundle."
52
+ },
45
53
  "namespaces": {
46
54
  "type": "array",
47
55
  "minItems": 1,
@@ -46,6 +46,8 @@ export interface BundleConfig {
46
46
  output: string;
47
47
  /** Name of the generated class, an `IContainerModule`. Default `Bundle`. */
48
48
  name?: string;
49
+ /** Tags associated with the bundle. */
50
+ tags?: string[];
49
51
  namespaces: (string | NamespaceConfig)[];
50
52
  /** Which classes of a scanned file are registered. Default: every exported class. */
51
53
  select?: ClassSelector;
@@ -96,6 +98,7 @@ export interface ResolvedConfig {
96
98
  export interface ResolvedBundle {
97
99
  output: string;
98
100
  name: string;
101
+ tags: string[];
99
102
  namespaces: Required<NamespaceConfig>[];
100
103
  select: ResolvedSelector;
101
104
  /** The effective list: the configured `exclude` (or the defaults) followed by `additionalExclude`. */