tungsten 0.4.4 → 0.4.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.
@@ -1 +1 @@
1
- 1788304961722
1
+ 1788306927004
package/dist/Framework.js CHANGED
@@ -105,7 +105,7 @@ export class Framework {
105
105
  await this.profiler.timeProfileAsync('static gen', () => staticGen(this));
106
106
  }
107
107
  async getUserConfig() {
108
- return this.config = await getUserConfig();
108
+ return this.config = await getUserConfig(null, this.quiet ? 'silent' : 'noisy');
109
109
  // const userConfigOrNull = await findUserConfig(process.cwd())
110
110
  // if (userConfigOrNull !== null) {
111
111
  // const userConfig = userConfigOrNull
@@ -120,7 +120,7 @@ export class Framework {
120
120
  throw new TungstenError(`SxyFramework.compileUserApp() error: config is undefined`);
121
121
  }
122
122
  const projectDir = process.cwd();
123
- const compilationInfo = await compileUserApp(projectDir, this.config, mode, this.profiler);
123
+ const compilationInfo = await compileUserApp(projectDir, this.config, mode, this.profiler, this.quiet);
124
124
  this.compilationInfo = compilationInfo;
125
125
  return compilationInfo;
126
126
  }
@@ -14,7 +14,7 @@ import { getFrameworkDir } from "../getFrameworkDir.js";
14
14
  ///// needs work to work in prod mode
15
15
  ///// see babel config
16
16
  export async function compileJavascript(projectDir, appConfig, codeLocation, sourceLocation, styleImportBase, buildLocation, buildCodeLocation, mode, watch = true, options = {}) {
17
- cliOut(`Compiling app code`);
17
+ if (options.quiet !== true) cliOut(`Compiling app code`);
18
18
  let dependencyGraphDir = '';
19
19
  let dependencyGraphLocation = '';
20
20
  let oldDependencyGraph = {};
@@ -1,3 +1,3 @@
1
1
  import type { FrameworkConfigComplete } from '../FrameworkConfig.js';
2
- export declare function compileStyles(projectDir: string, config: FrameworkConfigComplete, styleImportBase: string, buildLocation: string, watch?: boolean, onChange?: () => void): Promise<unknown>;
2
+ export declare function compileStyles(projectDir: string, config: FrameworkConfigComplete, styleImportBase: string, buildLocation: string, watch?: boolean, onChange?: () => void, quiet?: boolean): Promise<unknown>;
3
3
  //# sourceMappingURL=compileStyles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compileStyles.d.ts","sourceRoot":"","sources":["../../src/build/compileStyles.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAgOpE,wBAAsB,aAAa,CAC/B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,uBAAuB,EAC/B,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,MAAM,EACrB,KAAK,UAAO,EACZ,QAAQ,CAAC,EAAE,MAAM,IAAI,oBAiGxB"}
1
+ {"version":3,"file":"compileStyles.d.ts","sourceRoot":"","sources":["../../src/build/compileStyles.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAgOpE,wBAAsB,aAAa,CAC/B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,uBAAuB,EAC/B,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,MAAM,EACrB,KAAK,UAAO,EACZ,QAAQ,CAAC,EAAE,MAAM,IAAI,EACrB,KAAK,UAAQ,oBAiGhB"}
@@ -183,8 +183,8 @@ async function processAndCopyFile(sourceLocation, targetLocation, filePathFull,
183
183
  }
184
184
  cssFiles[targetRelFile] = relFile;
185
185
  }
186
- export async function compileStyles(projectDir, config, styleImportBase, buildLocation, watch = true, onChange) {
187
- cliOut(`Compiling app stylesheets`);
186
+ export async function compileStyles(projectDir, config, styleImportBase, buildLocation, watch = true, onChange, quiet = false) {
187
+ if (!quiet) cliOut(`Compiling app stylesheets`);
188
188
  // we need to create and maintain a dependency tree for correct updating
189
189
  // we are going to save the dependencies of each file
190
190
  const cssDependencies = {};
@@ -2,5 +2,5 @@ import type { CompilationInfo } from './CompilationInfo.js';
2
2
  import type { FrameworkConfigComplete } from '../FrameworkConfig.js';
3
3
  import type { Mode } from '../Mode.js';
4
4
  import { type TimeProfiler } from '../timeProfiler.js';
5
- export declare function compileUserApp(projectDir: string, appConfig: FrameworkConfigComplete, mode: Mode, profiler?: TimeProfiler): Promise<CompilationInfo>;
5
+ export declare function compileUserApp(projectDir: string, appConfig: FrameworkConfigComplete, mode: Mode, profiler?: TimeProfiler, quiet?: boolean): Promise<CompilationInfo>;
6
6
  //# sourceMappingURL=compileUserApp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compileUserApp.d.ts","sourceRoot":"","sources":["../../src/build/compileUserApp.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAWtC,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAI1E,wBAAsB,cAAc,CAChC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,uBAAuB,EAAE,IAAI,EAAE,IAAI,EAClE,QAAQ,GAAE,YAAwC,GACnD,OAAO,CAAC,eAAe,CAAC,CAyE1B"}
1
+ {"version":3,"file":"compileUserApp.d.ts","sourceRoot":"","sources":["../../src/build/compileUserApp.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAWtC,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAI1E,wBAAsB,cAAc,CAChC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,uBAAuB,EAAE,IAAI,EAAE,IAAI,EAClE,QAAQ,GAAE,YAAwC,EAAE,KAAK,UAAQ,GAClE,OAAO,CAAC,eAAe,CAAC,CA2E1B"}
@@ -9,7 +9,7 @@ import { writeFrameworkCss } from "./frameworkStylesheets.js";
9
9
  import { emitReloadEvent } from "../hmr/liveReloadHub.js";
10
10
  import { createTimeProfiler } from "../timeProfiler.js";
11
11
  //import { compileEnv } from './compileEnv.js'
12
- export async function compileUserApp(projectDir, appConfig, mode, profiler = createTimeProfiler(false)) {
12
+ export async function compileUserApp(projectDir, appConfig, mode, profiler = createTimeProfiler(false), quiet = false) {
13
13
  const codeLocation = join(projectDir, appConfig.codeDir);
14
14
  const relSourceDir = appConfig.sourceDir !== undefined && appConfig.sourceDir !== '' ? appConfig.sourceDir : appConfig.codeDir;
15
15
  const sourceLocation = join(projectDir, relSourceDir);
@@ -21,15 +21,18 @@ export async function compileUserApp(projectDir, appConfig, mode, profiler = cre
21
21
  // open, so the command could only ever end by hard-exiting
22
22
  const watch = mode === 'dev';
23
23
  const compileJavascriptPromise = profiler.timeProfileAsync('compile javascript', () => compileJavascript(projectDir, appConfig, codeLocation, sourceLocation, styleImportBase, buildLocation, buildCodeLocation, mode, watch, mode === 'dev' ? {
24
+ quiet,
24
25
  hmr: appConfig.hmr === true,
25
26
  onCycleComplete: cycle => {
26
27
  if (cycle.success) emitReloadEvent('js', cycle.file);
27
28
  }
28
- } : {}));
29
+ } : {
30
+ quiet
31
+ }));
29
32
  //const compileEnvPromise = compileEnv(projectDir, appConfig, codeLocation, buildLocation, mode)
30
- const compileStylesPromise = profiler.timeProfileAsync('compile styles', () => compileStyles(projectDir, appConfig, styleImportBase, buildLocation, watch, mode === 'dev' ? () => emitReloadEvent('css') : undefined));
31
- const copyAssetsPromise = profiler.timeProfileAsync('copy assets', () => copyAssets(projectDir, appConfig, buildLocation, watch));
32
- const copyPublicFilesPromise = profiler.timeProfileAsync('copy public files', () => copyPublicFiles(projectDir, appConfig, buildLocation, watch));
33
+ const compileStylesPromise = profiler.timeProfileAsync('compile styles', () => compileStyles(projectDir, appConfig, styleImportBase, buildLocation, watch, mode === 'dev' ? () => emitReloadEvent('css') : undefined, quiet));
34
+ const copyAssetsPromise = profiler.timeProfileAsync('copy assets', () => copyAssets(projectDir, appConfig, buildLocation, watch, quiet));
35
+ const copyPublicFilesPromise = profiler.timeProfileAsync('copy public files', () => copyPublicFiles(projectDir, appConfig, buildLocation, watch, quiet));
33
36
  const {
34
37
  importAliases
35
38
  } = await compileJavascriptPromise;
@@ -1,3 +1,3 @@
1
1
  import type { FrameworkConfigComplete } from '../FrameworkConfig.js';
2
- export declare function copyAssets(projectDir: string, config: FrameworkConfigComplete, buildLocation: string, watch?: boolean): Promise<unknown>;
2
+ export declare function copyAssets(projectDir: string, config: FrameworkConfigComplete, buildLocation: string, watch?: boolean, quiet?: boolean): Promise<unknown>;
3
3
  //# sourceMappingURL=copyAssets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"copyAssets.d.ts","sourceRoot":"","sources":["../../src/build/copyAssets.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAiBpE,wBAAsB,UAAU,CAC5B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,uBAAuB,EAC/B,aAAa,EAAE,MAAM,EACrB,KAAK,UAAO,oBA2Df"}
1
+ {"version":3,"file":"copyAssets.d.ts","sourceRoot":"","sources":["../../src/build/copyAssets.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAiBpE,wBAAsB,UAAU,CAC5B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,uBAAuB,EAC/B,aAAa,EAAE,MAAM,EACrB,KAAK,UAAO,EACZ,KAAK,UAAQ,oBA2DhB"}
@@ -14,9 +14,9 @@ async function copyFile(assetsLocation, targetLocation, filePathFull, event) {
14
14
  });
15
15
  return fsPromises.copyFile(filePathFull, target);
16
16
  }
17
- export async function copyAssets(projectDir, config, buildLocation, watch = true) {
17
+ export async function copyAssets(projectDir, config, buildLocation, watch = true, quiet = false) {
18
18
  if (config.assetsDir !== undefined) {
19
- cliOut(`Copying assets`);
19
+ if (!quiet) cliOut(`Copying assets`);
20
20
  const assetsLocation = join(projectDir, config.assetsDir);
21
21
  const targetLocation = join(buildLocation, '.assets' /*, config.assetsDir*/);
22
22
  //console.log('copy assets from', assetsLocation, 'to', targetLocation)
@@ -1,3 +1,3 @@
1
1
  import type { FrameworkConfigComplete } from '../FrameworkConfig.js';
2
- export declare function copyPublicFiles(projectDir: string, config: FrameworkConfigComplete, buildLocation: string, watch?: boolean): Promise<unknown>;
2
+ export declare function copyPublicFiles(projectDir: string, config: FrameworkConfigComplete, buildLocation: string, watch?: boolean, quiet?: boolean): Promise<unknown>;
3
3
  //# sourceMappingURL=copyPublicFiles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"copyPublicFiles.d.ts","sourceRoot":"","sources":["../../src/build/copyPublicFiles.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAiBpE,wBAAsB,eAAe,CACjC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,uBAAuB,EAC/B,aAAa,EAAE,MAAM,EACrB,KAAK,UAAO,oBA4Df"}
1
+ {"version":3,"file":"copyPublicFiles.d.ts","sourceRoot":"","sources":["../../src/build/copyPublicFiles.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAiBpE,wBAAsB,eAAe,CACjC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,uBAAuB,EAC/B,aAAa,EAAE,MAAM,EACrB,KAAK,UAAO,EACZ,KAAK,UAAQ,oBA4DhB"}
@@ -14,9 +14,9 @@ async function copyFile(assetsLocation, targetLocation, filePathFull, event) {
14
14
  });
15
15
  return fsPromises.copyFile(filePathFull, target);
16
16
  }
17
- export async function copyPublicFiles(projectDir, config, buildLocation, watch = true) {
17
+ export async function copyPublicFiles(projectDir, config, buildLocation, watch = true, quiet = false) {
18
18
  //if ( config.publicDir !== undefined ) {
19
- cliOut(`Copying public files`);
19
+ if (!quiet) cliOut(`Copying public files`);
20
20
  const publicLocation = config.publicDir !== undefined ? join(projectDir, config.publicDir) : join(projectDir, 'public');
21
21
  //const targetLocation = buildLocation // to segregate or not to segregate?
22
22
  const targetLocation = join(buildLocation, '.public');
@@ -1,2 +1,2 @@
1
- @import "i/T-components-library-__StatefulMessage-StatefulMessage.css";
2
- @import "i/T-components-library-RichTextEditor-RichTextEditor.css";
1
+ @import "i/T-components-library-RichTextEditor-RichTextEditor.css";
2
+ @import "i/T-components-library-__StatefulMessage-StatefulMessage.css";
@@ -1 +1 @@
1
- {"version":3,"file":"spawnShellCommand.d.ts","sourceRoot":"","sources":["../src/spawnShellCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,wBAAwB,EAAE,MAAM,eAAe,CAAA;AAG/D,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,wBAAwB,0DAUlF"}
1
+ {"version":3,"file":"spawnShellCommand.d.ts","sourceRoot":"","sources":["../src/spawnShellCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,wBAAwB,EAAE,MAAM,eAAe,CAAA;AAU/D,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,wBAAwB,0DAalF"}
@@ -1,12 +1,19 @@
1
1
  import { spawn } from 'child_process';
2
+ // Two routes to the same shell command line - flip this to fall back.
3
+ // 'whole-command' hands the string straight to the shell, which is what node wants: an args array
4
+ // alongside shell: true is deprecated (DEP0190) because the args are concatenated unescaped.
5
+ // 'split-args' is the original - splitting on spaces cuts quoted paths in half, and they only
6
+ // survive because the shell re-parses the string it rejoins.
7
+ const route = 'whole-command';
2
8
  export function spawnShellCommand(command, extras) {
3
- const parts = command.split(' '); // eslint-disable-line no-type-assertion/no-type-assertion -- split returns an array of length at least 1
4
- // if (process.platform === 'win32') {
5
- // parts[0] += '.cmd'
6
- // }
7
9
  const options = {
8
10
  shell: true,
9
11
  ...extras
10
12
  };
13
+ if (route === 'whole-command') return spawn(command, options);
14
+ const parts = command.split(' '); // eslint-disable-line no-type-assertion/no-type-assertion -- split returns an array of length at least 1
15
+ // if (process.platform === 'win32') {
16
+ // parts[0] += '.cmd'
17
+ // }
11
18
  return spawn(parts[0], parts.slice(1), options);
12
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tungsten",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "bin": {