@travetto/manifest 5.0.3 → 5.0.5

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/README.md CHANGED
@@ -91,7 +91,8 @@ By default, all paths within the framework are assumed to be in a POSIX style, a
91
91
  "compilerUrl": "http://127.0.0.1:26803",
92
92
  "compilerModuleFolder": "module/compiler",
93
93
  "outputFolder": ".trv/output",
94
- "toolFolder": ".trv/tool"
94
+ "toolFolder": ".trv/tool",
95
+ "typesFolder": ".trv/types"
95
96
  },
96
97
  "main": {
97
98
  "name": "@travetto/manifest",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/manifest",
3
- "version": "5.0.3",
3
+ "version": "5.0.5",
4
4
  "description": "Support for project indexing, manifesting, along with file watching",
5
5
  "keywords": [
6
6
  "path",
package/src/context.ts CHANGED
@@ -17,6 +17,7 @@ type Workspace = Pkg<{
17
17
  const TOOL_FOLDER = '.trv/tool';
18
18
  const COMPILER_FOLDER = '.trv/compiler';
19
19
  const OUTPUT_FOLDER = '.trv/output';
20
+ const TYPES_FOLDER = '.trv/types';
20
21
 
21
22
  const WS_ROOT: Record<string, Workspace> = {};
22
23
 
@@ -52,14 +53,15 @@ function findPackage(dir: string): Pkg {
52
53
  * Get workspace root
53
54
  */
54
55
  function resolveWorkspace(base: string = process.cwd()): Workspace {
55
- if (base in WS_ROOT) { return WS_ROOT[base]; }
56
+ if (base in WS_ROOT) {
57
+ return WS_ROOT[base];
58
+ }
56
59
  let folder = base;
57
- let prev;
58
- /** @type {Pkg|undefined} */
59
- let prevPkg, pkg;
60
+ let prev: string | undefined;
61
+ let pkg: Pkg | undefined;
60
62
 
61
63
  while (prev !== folder) {
62
- [prev, prevPkg] = [folder, pkg];
64
+ prev = folder;
63
65
  pkg = readPackage(folder) ?? pkg;
64
66
  if (
65
67
  (pkg && (!!pkg.workspaces || !!pkg.travetto?.build?.isolated)) || // if we have a monorepo root, or we are isolated
@@ -81,7 +83,7 @@ function resolveWorkspace(base: string = process.cwd()): Workspace {
81
83
  manager: existsSync(path.resolve(pkg.path, 'yarn.lock')) ? 'yarn' : 'npm',
82
84
  resolve: createRequire(`${pkg.path}/node_modules`).resolve.bind(null),
83
85
  stripRoot: (full) => full === pkg.path ? '' : full.replace(`${pkg.path}/`, ''),
84
- mono: !!pkg.workspaces || (!pkg.travetto?.build?.isolated && !!prevPkg) // Workspaces or nested projects
86
+ mono: !!pkg.workspaces
85
87
  };
86
88
  }
87
89
 
@@ -133,7 +135,6 @@ export function getManifestContext(folder?: string): ManifestContext {
133
135
  const workspace = resolveWorkspace();
134
136
  const mod = resolveModule(workspace, folder);
135
137
  const build = workspace.travetto?.build ?? {};
136
- const toolFolder = build.toolFolder ?? TOOL_FOLDER;
137
138
 
138
139
  return {
139
140
  workspace: {
@@ -149,7 +150,8 @@ export function getManifestContext(folder?: string): ManifestContext {
149
150
  compilerUrl: build.compilerUrl ?? getCompilerUrl(workspace),
150
151
  compilerModuleFolder: workspace.stripRoot(path.dirname(workspace.resolve('@travetto/compiler/package.json'))),
151
152
  outputFolder: build.outputFolder ?? OUTPUT_FOLDER,
152
- toolFolder
153
+ toolFolder: build.toolFolder ?? TOOL_FOLDER,
154
+ typesFolder: build.typesFolder ?? TYPES_FOLDER
153
155
  },
154
156
  main: {
155
157
  name: mod.name ?? 'untitled',
@@ -26,6 +26,8 @@ export type ManifestContext = {
26
26
  outputFolder: string;
27
27
  /** Location of development-time tool output */
28
28
  toolFolder: string;
29
+ /** Location for type outputs */
30
+ typesFolder: string;
29
31
  };
30
32
  main: {
31
33
  /** Main module for manifest */
@@ -46,6 +46,7 @@ export type Package = {
46
46
  isolated?: boolean;
47
47
  includes?: Record<string, 'main' | true>;
48
48
  watchIgnores?: string[];
49
+ typesFolder?: string;
49
50
  };
50
51
  };
51
52
  workspaces?: string[];