tungsten 0.4.7 → 0.4.9
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/dist/.build-complete +1 -1
- package/dist/bin/commands/compile.d.ts.map +1 -1
- package/dist/bin/commands/compile.js +11 -2
- package/dist/build/compileJavascript.d.ts +1 -0
- package/dist/build/compileJavascript.d.ts.map +1 -1
- package/dist/build/compileJavascript.js +4 -2
- package/dist/build/makeBabelUserDevConfig.d.ts +1 -1
- package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserDevConfig.js +7 -3
- package/dist/componentCss/tungsten.css +2 -2
- package/package.json +2 -3
package/dist/.build-complete
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1788322879820
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/bin/commands/compile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/bin/commands/compile.ts"],"names":[],"mappings":"AAkSA,OAAO,EAAE,CAAA"}
|
|
@@ -19,18 +19,21 @@ const targetOptions = {
|
|
|
19
19
|
'--public': 'public'
|
|
20
20
|
};
|
|
21
21
|
const args = process.argv.slice(3);
|
|
22
|
-
const usage = 'Usage: tungsten compile [targets] [--all] [--watch] [--no-clean] [--
|
|
22
|
+
const usage = 'Usage: tungsten compile [targets] [--all] [--watch] [--no-clean] [--packages]' + ' [--output <dir>] [--ready-file <file>] [--quiet]' + ' [--ignore-dirs <dir>] [--ignore-patterns <pattern>]';
|
|
23
23
|
if (args.includes('--help') || args.includes('-h')) {
|
|
24
24
|
cliOut(usage);
|
|
25
25
|
cliOut('Targets: --js, --css, --client, --assets, --public');
|
|
26
26
|
cliOut('With no target options, all targets are compiled.');
|
|
27
27
|
cliOut('Options: --output <dir>, --ready-file <file>, --quiet');
|
|
28
|
+
cliOut(' --packages compiles imported packages into the build\'s .packages tree');
|
|
29
|
+
cliOut(' for the dev server to serve. Off by default: compiled code left to');
|
|
30
|
+
cliOut(' node\'s own resolution, as tests use, needs none of it.');
|
|
28
31
|
cliOut(' --ignore-dirs <dir>, --ignore-patterns <pattern>');
|
|
29
32
|
cliOut(' override the config entries of the same name. Repeat the option to');
|
|
30
33
|
cliOut(' give several values, or pass an empty value to ignore nothing.');
|
|
31
34
|
process.exit(0);
|
|
32
35
|
}
|
|
33
|
-
const commandOptions = new Set(['--all', '--watch', '--no-clean', '--quiet']);
|
|
36
|
+
const commandOptions = new Set(['--all', '--watch', '--no-clean', '--quiet', '--packages']);
|
|
34
37
|
const valueOptions = new Set(['--output', '--ready-file', '--ignore-dirs', '--ignore-patterns']);
|
|
35
38
|
// values are collected per option so that the list options can be repeated
|
|
36
39
|
const givenOptionValues = new Map();
|
|
@@ -80,6 +83,11 @@ const targets = requestedTargets.size === 0 || args.includes('--all') ? new Set(
|
|
|
80
83
|
const watch = args.includes('--watch');
|
|
81
84
|
const clean = !args.includes('--no-clean');
|
|
82
85
|
const quiet = args.includes('--quiet');
|
|
86
|
+
const compilePackages = args.includes('--packages');
|
|
87
|
+
if (compilePackages && !targets.has('js')) {
|
|
88
|
+
cliError('--packages applies to the js target, which is not being compiled');
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
83
91
|
const projectDir = process.cwd();
|
|
84
92
|
const config = await getUserConfig({
|
|
85
93
|
...(ignoreDirsOption !== undefined ? {
|
|
@@ -143,6 +151,7 @@ let javascriptInitialSuccess = true;
|
|
|
143
151
|
if (targets.has('js')) {
|
|
144
152
|
const javascriptTask = compileJavascript(projectDir, config, codeLocation, sourceLocation, styleImportBase, buildLocation, buildCodeLocation, 'dev', watch, {
|
|
145
153
|
quiet,
|
|
154
|
+
packages: compilePackages,
|
|
146
155
|
packagesCacheLocation,
|
|
147
156
|
onCycleComplete: watch ? async cycle => {
|
|
148
157
|
if (cycle.success) {
|
|
@@ -15,6 +15,7 @@ export type JavascriptCompilationCycle = {
|
|
|
15
15
|
export type CompileJavascriptOptions = {
|
|
16
16
|
quiet?: boolean;
|
|
17
17
|
packagesCacheLocation?: string;
|
|
18
|
+
packages?: boolean;
|
|
18
19
|
hmr?: boolean;
|
|
19
20
|
onCycleComplete?: ((cycle: JavascriptCompilationCycle) => void | Promise<void>) | undefined;
|
|
20
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileJavascript.d.ts","sourceRoot":"","sources":["../../src/build/compileJavascript.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,UAAU,CAAA;AAO/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAetC,KAAK,uBAAuB,GAAG;IAC3B,OAAO,EAAE,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAA;IAClC,WAAW,EAAE,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAA;IACtC,aAAa,EAAE,aAAa,CAAA;IAC5B,cAAc,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACrC,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACnC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,qBAAqB,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"compileJavascript.d.ts","sourceRoot":"","sources":["../../src/build/compileJavascript.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,UAAU,CAAA;AAO/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAetC,KAAK,uBAAuB,GAAG;IAC3B,OAAO,EAAE,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAA;IAClC,WAAW,EAAE,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAA;IACtC,aAAa,EAAE,aAAa,CAAA;IAC5B,cAAc,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACrC,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACnC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAE9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,eAAe,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAA;CAC9F,CAAA;AAKD,wBAAsB,iBAAiB,CACnC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,uBAAuB,EACtD,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EACrE,aAAa,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,UAAO,EAC1E,OAAO,GAAE,wBAA6B,GACvC,OAAO,CAAC,uBAAuB,CAAC,CAkZlC"}
|
|
@@ -15,6 +15,7 @@ import { getFrameworkDir } from "../getFrameworkDir.js";
|
|
|
15
15
|
///// see babel config
|
|
16
16
|
export async function compileJavascript(projectDir, appConfig, codeLocation, sourceLocation, styleImportBase, buildLocation, buildCodeLocation, mode, watch = true, options = {}) {
|
|
17
17
|
if (options.quiet !== true) cliOut(`Compiling app code`);
|
|
18
|
+
const compilePackages = options.packages !== false;
|
|
18
19
|
let dependencyGraphDir = '';
|
|
19
20
|
let dependencyGraphLocation = '';
|
|
20
21
|
let oldDependencyGraph = {};
|
|
@@ -40,7 +41,7 @@ export async function compileJavascript(projectDir, appConfig, codeLocation, sou
|
|
|
40
41
|
dependencyGraph = {};
|
|
41
42
|
importAliases = {};
|
|
42
43
|
promises = [];
|
|
43
|
-
config = makeBabelUserDevConfig(projectDir, codeLocation, sourceLocation, styleImportBase, buildLocation, buildCodeLocation, dependencyGraphDir, skipPackageCompilationFiles, oldDependencyGraph, dependencyGraph, importAliases, promises, watch, options.hmr === true);
|
|
44
|
+
config = makeBabelUserDevConfig(projectDir, codeLocation, sourceLocation, styleImportBase, buildLocation, buildCodeLocation, dependencyGraphDir, skipPackageCompilationFiles, oldDependencyGraph, dependencyGraph, importAliases, promises, watch, options.hmr === true, compilePackages);
|
|
44
45
|
} else {
|
|
45
46
|
config = makeBabelUserProdConfig(projectDir, codeLocation, sourceLocation, styleImportBase, watch);
|
|
46
47
|
}
|
|
@@ -214,7 +215,8 @@ export async function compileJavascript(projectDir, appConfig, codeLocation, sou
|
|
|
214
215
|
const initialFailures = [...transformFailures, ...(await settleDeferredWork())];
|
|
215
216
|
const initialSuccess = initialFailures.length === 0 && failedFiles.size === 0;
|
|
216
217
|
function writeDependencyGraph() {
|
|
217
|
-
|
|
218
|
+
// without the package walk the graph is empty - don't create the cache dir to hold it
|
|
219
|
+
if (mode !== 'dev' || !compilePackages) return;
|
|
218
220
|
if (!fs.existsSync(dependencyGraphDir)) {
|
|
219
221
|
fs.mkdirSync(dependencyGraphDir, {
|
|
220
222
|
recursive: true
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TransformOptions } from '@babel/core';
|
|
2
2
|
import type { ImportAliases } from './ImportAliases.js';
|
|
3
3
|
import { DependencyGraph } from '../babelPlugins/BabelTransformPackageImports.js';
|
|
4
|
-
export declare function makeBabelUserDevConfig(projectDir: string, absCodeDir: string, absSourceDir: string, absStyleImportBase: string, buildLocation: string, buildCodeLocation: string, packagesCacheLocation: string, skipPackageCompilationFiles: ReadonlySet<string>, oldDependencyGraph: DependencyGraph, dependencyGraph: DependencyGraph, importAliases: ImportAliases, promises: Promise<any>[], watchStyles?: boolean, hmr?: boolean): TransformOptions;
|
|
4
|
+
export declare function makeBabelUserDevConfig(projectDir: string, absCodeDir: string, absSourceDir: string, absStyleImportBase: string, buildLocation: string, buildCodeLocation: string, packagesCacheLocation: string, skipPackageCompilationFiles: ReadonlySet<string>, oldDependencyGraph: DependencyGraph, dependencyGraph: DependencyGraph, importAliases: ImportAliases, promises: Promise<any>[], watchStyles?: boolean, hmr?: boolean, packages?: boolean): TransformOptions;
|
|
5
5
|
//# sourceMappingURL=makeBabelUserDevConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeBabelUserDevConfig.d.ts","sourceRoot":"","sources":["../../src/build/makeBabelUserDevConfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAKnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,EAAoC,eAAe,EAAE,MAAM,iDAAiD,CAAA;AAOnH,wBAAgB,sBAAsB,CAClC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,kBAAkB,EAAE,MAAM,EAC1B,aAAa,EAAE,MAAM,EACrB,iBAAiB,EAAE,MAAM,EACzB,qBAAqB,EAAE,MAAM,EAC7B,2BAA2B,EAAE,WAAW,CAAC,MAAM,CAAC,EAChD,kBAAkB,EAAE,eAAe,EACnC,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,EACxB,WAAW,UAAO,EAClB,GAAG,UAAQ,
|
|
1
|
+
{"version":3,"file":"makeBabelUserDevConfig.d.ts","sourceRoot":"","sources":["../../src/build/makeBabelUserDevConfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAKnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,EAAoC,eAAe,EAAE,MAAM,iDAAiD,CAAA;AAOnH,wBAAgB,sBAAsB,CAClC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,kBAAkB,EAAE,MAAM,EAC1B,aAAa,EAAE,MAAM,EACrB,iBAAiB,EAAE,MAAM,EACzB,qBAAqB,EAAE,MAAM,EAC7B,2BAA2B,EAAE,WAAW,CAAC,MAAM,CAAC,EAChD,kBAAkB,EAAE,eAAe,EACnC,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,EACxB,WAAW,UAAO,EAClB,GAAG,UAAQ,EACX,QAAQ,UAAO,GAChB,gBAAgB,CAyClB"}
|
|
@@ -7,9 +7,12 @@ import { componentCssFolder, componentCssFile } from "../settings.js";
|
|
|
7
7
|
import userCommonConfig from "./babel.user.common.config.js";
|
|
8
8
|
import { MakeBabelTransformCssImports } from "../babelPlugins/BabelTransformCssImports.js";
|
|
9
9
|
import { MakeBabelAddDevCacheBust } from "../babelPlugins/BabelAddDevCacheBust.js";
|
|
10
|
-
export function makeBabelUserDevConfig(projectDir, absCodeDir, absSourceDir, absStyleImportBase, buildLocation, buildCodeLocation, packagesCacheLocation, skipPackageCompilationFiles, oldDependencyGraph, dependencyGraph, importAliases, promises, watchStyles = true, hmr = false) {
|
|
10
|
+
export function makeBabelUserDevConfig(projectDir, absCodeDir, absSourceDir, absStyleImportBase, buildLocation, buildCodeLocation, packagesCacheLocation, skipPackageCompilationFiles, oldDependencyGraph, dependencyGraph, importAliases, promises, watchStyles = true, hmr = false, packages = true) {
|
|
11
11
|
const userDevConfig = objectCopy(userCommonConfig);
|
|
12
|
-
|
|
12
|
+
// pushed first so the plugin order is the same either way
|
|
13
|
+
// its only products - the /.packages tree and the importmap aliases - are consumed by the
|
|
14
|
+
// dev server, so a build that will not be served can skip the walk entirely
|
|
15
|
+
if (packages) userDevConfig.plugins.push(MakeBabelTransformPackageImports({
|
|
13
16
|
projectDir: projectDir,
|
|
14
17
|
codeDir: absCodeDir,
|
|
15
18
|
buildLocation,
|
|
@@ -20,7 +23,8 @@ export function makeBabelUserDevConfig(projectDir, absCodeDir, absSourceDir, abs
|
|
|
20
23
|
dependencyGraph,
|
|
21
24
|
importAliases,
|
|
22
25
|
promises
|
|
23
|
-
})
|
|
26
|
+
}));
|
|
27
|
+
userDevConfig.plugins.push(MakeBabelTransformCssImports({
|
|
24
28
|
projectDir,
|
|
25
29
|
absSourceDir,
|
|
26
30
|
absCodeDir
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@import "i/T-components-library-
|
|
2
|
-
@import "i/T-components-library-
|
|
1
|
+
@import "i/T-components-library-RichTextEditor-RichTextEditor.css";
|
|
2
|
+
@import "i/T-components-library-__StatefulMessage-StatefulMessage.css";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tungsten",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": "./dist/index.js",
|
|
12
|
-
"./ssr": "./dist/ssr.js",
|
|
13
12
|
"./compat": "./dist/compat/index.js",
|
|
14
13
|
"./library": "./dist/components/library/index.js",
|
|
15
14
|
"./react-zone": "./dist/zones/react.js",
|
|
@@ -81,7 +80,7 @@
|
|
|
81
80
|
"slash": "^4.0.0",
|
|
82
81
|
"sxy-dependency-tree": "^8.1.11",
|
|
83
82
|
"sxy-filing-cabinet": "^3.4.2",
|
|
84
|
-
"sxy-lib": "^3.0.
|
|
83
|
+
"sxy-lib": "^3.0.7",
|
|
85
84
|
"sxy-lib-object-copy": "^2.0.5",
|
|
86
85
|
"sxy-loader": "^3.1.0",
|
|
87
86
|
"sxy-package-investigator": "^1.0.0",
|