tungsten 0.4.10 → 0.4.12
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/AnyComponent.js +1 -1
- package/dist/Components.d.ts.map +1 -1
- package/dist/Components.js +15 -16
- package/dist/ContentNode.js +2 -2
- package/dist/DomRegion.js +1 -1
- package/dist/Framework.d.ts +2 -1
- package/dist/Framework.d.ts.map +1 -1
- package/dist/Framework.js +43 -34
- package/dist/FrameworkConfig.d.ts +16 -0
- package/dist/FrameworkConfig.d.ts.map +1 -1
- package/dist/FunctionComponentStandIn.js +8 -8
- package/dist/Instance/Instance.js +11 -11
- package/dist/RenderedContentNode.js +2 -2
- package/dist/RenderingNode.js +2 -2
- package/dist/Script.js +1 -1
- package/dist/Servers/DevServer.d.ts.map +1 -1
- package/dist/Servers/DevServer.js +29 -29
- package/dist/Servers/ProdServer.js +14 -14
- package/dist/Servers/StaticSiteServer.js +3 -3
- package/dist/Servers/TungstenServer.js +5 -5
- package/dist/Servers/devErrorPageAutoRetry.js +1 -1
- package/dist/Servers/hono/TungstenServerHono.js +5 -5
- package/dist/Servers/initStores.js +3 -3
- package/dist/Servers/loadEnvsDev.js +6 -6
- package/dist/Servers/routing.js +3 -3
- package/dist/Store/createStores.js +2 -2
- package/dist/Store/makeStore.js +2 -2
- package/dist/Store/registerStore.js +2 -2
- package/dist/TungstenApp.js +3 -3
- package/dist/TungstenStyleObject.js +1 -1
- package/dist/__deproxy.js +2 -2
- package/dist/_client/client.js +3 -3
- package/dist/alive.js +1 -1
- package/dist/api/getApiRoutes.js +3 -3
- package/dist/api/getApiRoutesHono.js +3 -3
- package/dist/api/getExport.js +4 -4
- package/dist/api/getExportDev.js +1 -1
- package/dist/appOutput.js +1 -1
- package/dist/auth/index.js +2 -2
- package/dist/babelPlugins/BabelAddDevCacheBust.d.ts.map +1 -1
- package/dist/babelPlugins/BabelAddDevCacheBust.js +4 -2
- package/dist/babelPlugins/BabelTransformBindDirect.js +2 -2
- package/dist/babelPlugins/BabelTransformBindVar.js +3 -3
- package/dist/babelPlugins/BabelTransformCjsToEsm.js +1 -1
- package/dist/babelPlugins/BabelTransformComponentState.js +2 -2
- package/dist/babelPlugins/BabelTransformComponentStyles.d.ts +2 -0
- package/dist/babelPlugins/BabelTransformComponentStyles.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformComponentStyles.js +27 -11
- package/dist/babelPlugins/BabelTransformCssImports.js +1 -1
- package/dist/babelPlugins/BabelTransformDeproxyState.js +1 -1
- package/dist/babelPlugins/BabelTransformJsxExtensionsToJs.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformJsxExtensionsToJs.js +6 -2
- package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformPackageImports.js +71 -49
- package/dist/babelPlugins/BabelTransformReactive.js +1 -1
- package/dist/babelPlugins/BabelTransformReactiveSvelteStyle.js +1 -1
- package/dist/babelPlugins/BabelTransformSxyFrameworkImports.js +1 -1
- package/dist/babelPlugins/BabelTransformUniqueComponents.js +1 -1
- package/dist/babelPlugins/fixImportsInSassErrorMessage.js +1 -1
- package/dist/babelPlugins/test.js +1 -1
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.js +3 -3
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.js +1 -1
- package/dist/babelPlugins/transformPackageImports/getWebLocationOfPackageFile.js +2 -2
- package/dist/bin/args.js +1 -1
- package/dist/bin/commands/build.js +5 -5
- package/dist/bin/commands/buildHelp.js +1 -1
- package/dist/bin/commands/clean.js +4 -4
- package/dist/bin/commands/compile.d.ts.map +1 -1
- package/dist/bin/commands/compile.js +24 -17
- package/dist/bin/commands/compileSimplePackage.js +2 -2
- package/dist/bin/commands/dev.d.ts.map +1 -1
- package/dist/bin/commands/dev.js +16 -9
- package/dist/bin/commands/devmon.js +4 -4
- package/dist/bin/commands/help.js +2 -2
- package/dist/bin/commands/start.js +2 -2
- package/dist/bin/commands/static.js +3 -3
- package/dist/bin/index.js +13 -13
- package/dist/bin/moduleLoadAnalysis.js +2 -2
- package/dist/browserStorage.js +2 -2
- package/dist/build/babel.user.common.config.d.ts +7 -2
- package/dist/build/babel.user.common.config.d.ts.map +1 -1
- package/dist/build/babel.user.common.config.js +14 -15
- package/dist/build/bundle.d.ts +1 -1
- package/dist/build/bundle.d.ts.map +1 -1
- package/dist/build/bundle.js +15 -7
- package/dist/build/bundleBabelOptions.d.ts +6 -0
- package/dist/build/bundleBabelOptions.d.ts.map +1 -0
- package/dist/build/bundleBabelOptions.js +23 -0
- package/dist/build/combineComponentCss.js +2 -2
- package/dist/build/compileJavascript.d.ts +4 -0
- package/dist/build/compileJavascript.d.ts.map +1 -1
- package/dist/build/compileJavascript.js +148 -90
- package/dist/build/compileStyles.js +4 -4
- package/dist/build/compileUserApp.d.ts +1 -1
- package/dist/build/compileUserApp.d.ts.map +1 -1
- package/dist/build/compileUserApp.js +15 -12
- package/dist/build/componentStylesCache.d.ts +10 -0
- package/dist/build/componentStylesCache.d.ts.map +1 -0
- package/dist/build/componentStylesCache.js +54 -0
- package/dist/build/copyAssets.js +1 -1
- package/dist/build/copyPackageModulesToPackagesFolder.js +4 -4
- package/dist/build/copyPublicFiles.js +1 -1
- package/dist/build/createClientFiles.js +3 -3
- package/dist/build/createInstanceConfigFile.js +2 -2
- package/dist/build/createPackageVirtualFileSystems.js +1 -1
- package/dist/build/devBundle.js +5 -5
- package/dist/build/devBundle.rollup.config.d.ts.map +1 -1
- package/dist/build/devBundle.rollup.config.js +0 -1
- package/dist/build/frameworkDestLocation.d.ts +1 -0
- package/dist/build/frameworkDestLocation.d.ts.map +1 -1
- package/dist/build/frameworkDestLocation.js +8 -4
- package/dist/build/frameworkStylesheets.js +1 -1
- package/dist/build/getAllSxyClientModules.js +2 -2
- package/dist/build/getPackageDirForFile.js +1 -1
- package/dist/build/getSxyClientPackageAliases.d.ts.map +1 -1
- package/dist/build/getSxyClientPackageAliases.js +4 -2
- package/dist/build/getTempDirForAppCompilation.js +1 -1
- package/dist/build/makeBabelRawConfig.d.ts +3 -0
- package/dist/build/makeBabelRawConfig.d.ts.map +1 -0
- package/dist/build/makeBabelRawConfig.js +12 -0
- package/dist/build/makeBabelUserDevConfig.d.ts +1 -1
- package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserDevConfig.js +11 -8
- package/dist/build/makeBabelUserProdConfig.d.ts +1 -1
- package/dist/build/makeBabelUserProdConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserProdConfig.js +10 -5
- package/dist/build/processPackage.js +3 -3
- package/dist/build/rollup.user.prod.config.d.ts.map +1 -1
- package/dist/build/rollup.user.prod.config.js +13 -11
- package/dist/build/rollupExtractComponentStylesheets.js +2 -2
- package/dist/build/sassImportParser.js +2 -2
- package/dist/build/tallyBabelPlugins.d.ts.map +1 -1
- package/dist/build/tallyBabelPlugins.js +2 -7
- package/dist/calculateImportedStaticFileLocations.js +2 -2
- package/dist/calledFrom.js +2 -2
- package/dist/compat/forwardRef.js +1 -1
- package/dist/compat/index.js +1 -1
- package/dist/componentCss/tungsten.css +2 -2
- package/dist/componentProxyHandlers.js +3 -3
- package/dist/components/Link.js +2 -2
- package/dist/components/PopMessages.js +3 -3
- package/dist/components/RawHtml.js +2 -2
- package/dist/components/Stylesheet.js +3 -3
- package/dist/components/bindable/BindableCheckbox.js +1 -1
- package/dist/components/bindable/BindableInput.js +1 -1
- package/dist/components/bindable/BindableInputNonString.js +1 -1
- package/dist/components/bindable/BindableInputString.js +1 -1
- package/dist/components/bindable/BindableInputTyped.js +1 -1
- package/dist/components/bindable/BindableInputTypedLegacy.js +1 -1
- package/dist/components/bindable/BindableRadio.js +1 -1
- package/dist/components/bindable/BindableSelect.js +1 -1
- package/dist/components/bindable/BindableTextarea.js +1 -1
- package/dist/components/library/RichTextEditor/RichTextEditor.js +8 -8
- package/dist/components/library/RichTextEditor/contentTree.js +4 -4
- package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.js +2 -2
- package/dist/components/library/__StatefulMessage/StatefulMessage.js +2 -2
- package/dist/components/library/index.js +2 -2
- package/dist/createElement.js +1 -1
- package/dist/defaultConfig.d.ts +0 -1
- package/dist/defaultConfig.d.ts.map +1 -1
- package/dist/defaultConfig.js +2 -2
- package/dist/deleteDirs.js +1 -1
- package/dist/env/addToEnv.js +1 -1
- package/dist/env/funcs.js +4 -4
- package/dist/env/getEnvSchemas.d.ts.map +1 -1
- package/dist/env/getEnvSchemas.js +10 -6
- package/dist/env/privateEnv.js +2 -2
- package/dist/env/privateEnvOrThrow.js +1 -1
- package/dist/env/publicEnv.js +1 -1
- package/dist/env/publicEnvOrThrow.js +1 -1
- package/dist/filePathFromUrl.js +1 -1
- package/dist/findProjectDir.js +1 -1
- package/dist/findUserConfig.js +5 -5
- package/dist/fixExtension.d.ts.map +1 -1
- package/dist/fixExtension.js +5 -3
- package/dist/frameworkConfigSchema.d.ts +16 -0
- package/dist/frameworkConfigSchema.d.ts.map +1 -1
- package/dist/frameworkConfigSchema.js +12 -0
- package/dist/getComponent.js +5 -5
- package/dist/getComponentDev.js +1 -1
- package/dist/getFrameworkDir.js +1 -1
- package/dist/getRoutes.js +5 -5
- package/dist/getRoutesDevs.js +1 -1
- package/dist/getUserConfig.js +7 -7
- package/dist/hasValidKey.js +1 -1
- package/dist/helpers/index.js +2 -2
- package/dist/hmr/applyHmrModule.js +5 -5
- package/dist/hmr/componentIdentity.js +2 -2
- package/dist/hooks/clearCurrentComponent.js +1 -1
- package/dist/hooks/getCurrentComponent.js +3 -3
- package/dist/hooks/index.js +5 -5
- package/dist/hooks/setCurrentComponent.js +1 -1
- package/dist/hooks/useCallback.js +2 -2
- package/dist/hooks/useEffect.js +2 -2
- package/dist/hooks/useInstance.js +1 -1
- package/dist/hooks/useMemo.js +2 -2
- package/dist/hooks/useState.js +3 -3
- package/dist/hydrate/hydrate.js +31 -31
- package/dist/hydrate/reconcileHydratedAttributes.js +3 -3
- package/dist/index.js +2 -2
- package/dist/indexInner.d.ts +1 -1
- package/dist/indexInner.d.ts.map +1 -1
- package/dist/indexInner.js +45 -45
- package/dist/innerHtmlFromProps.js +1 -1
- package/dist/isBrowser.js +1 -1
- package/dist/isDev.js +1 -1
- package/dist/isProd.js +1 -1
- package/dist/isServer.js +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/jsxRuntime.d.ts.map +1 -1
- package/dist/jsxRuntime.js +12 -7
- package/dist/jsxRuntimeSignals.d.ts.map +1 -1
- package/dist/jsxRuntimeSignals.js +15 -8
- package/dist/makeFinalConfig.js +1 -1
- package/dist/makeInstanceConfigFromFrameworkConfig.js +1 -1
- package/dist/makeServerRpc.js +3 -3
- package/dist/markOptionSelected.js +1 -1
- package/dist/nbsp.js +1 -1
- package/dist/output.js +1 -1
- package/dist/pop.js +2 -2
- package/dist/postcssPlugins/TransformCssNames.js +6 -6
- package/dist/postcssPlugins/parseSelectors.js +1 -1
- package/dist/postcssPlugins/parseSelectorsRich.js +1 -1
- package/dist/postcssPlugins/scopeAnimationValue.js +2 -2
- package/dist/propsAreEqual.js +3 -3
- package/dist/rawHtml/filterContentNode.js +4 -4
- package/dist/rawHtml/parseHtml.js +4 -4
- package/dist/rawHtml/sanitizeHtml.js +3 -3
- package/dist/rawHtml/tokenizeHtml.js +2 -2
- package/dist/render/addImportMap.js +2 -2
- package/dist/render/classComponentNodeToRenderingTree.js +4 -4
- package/dist/render/componentNodeToRenderingTree.js +7 -7
- package/dist/render/contentNodeToHtml.js +11 -11
- package/dist/render/contentToHtml.js +4 -4
- package/dist/render/contentToHtmlDev.js +1 -1
- package/dist/render/contentTreeToRenderingTree.js +7 -7
- package/dist/render/functionComponentNodeToRenderingTree.js +4 -4
- package/dist/render/getFunctionBodyAsString.js +1 -1
- package/dist/render/instantiateClassComponent.js +2 -2
- package/dist/render/instantiateComponent.js +3 -3
- package/dist/render/instantiateFunctionComponent.js +2 -2
- package/dist/render/printComponentNameInSource.js +1 -1
- package/dist/render/processHead.js +5 -5
- package/dist/render/processHtmlNode.js +1 -1
- package/dist/render/processProps.js +2 -2
- package/dist/render/processRenderingNodeHtml.js +6 -6
- package/dist/render/renderingTreeToHtml.js +16 -16
- package/dist/render/rootToHtml.js +2 -2
- package/dist/render/rootToHtmlDev.js +1 -1
- package/dist/requests/fetch/delete.js +2 -2
- package/dist/requests/fetch/get.js +3 -3
- package/dist/requests/fetch/patch.js +2 -2
- package/dist/requests/fetch/post.js +2 -2
- package/dist/requests/fetch/put.js +2 -2
- package/dist/requests/index.js +5 -5
- package/dist/routing/MatchedRoute.js +2 -2
- package/dist/routing/getPathPriority.js +1 -1
- package/dist/routing/matchPath.js +3 -3
- package/dist/routing/patternToRegex.js +1 -1
- package/dist/server.js +3 -3
- package/dist/serverModuleLocation.d.ts +3 -0
- package/dist/serverModuleLocation.d.ts.map +1 -0
- package/dist/serverModuleLocation.js +12 -0
- package/dist/settings.d.ts +4 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +9 -0
- package/dist/standardSchema.js +1 -1
- package/dist/staticGen/getAppRoutes.js +3 -3
- package/dist/staticGen/staticGen.js +7 -7
- package/dist/style/jssToCss.js +3 -3
- package/dist/style/styleContent.js +1 -1
- package/dist/style/styleContentSxy.js +8 -8
- package/dist/style/unusedStyles.js +1 -1
- package/dist/sync/index.js +1 -1
- package/dist/syncServer/preload.js +1 -1
- package/dist/testing/host.js +1 -1
- package/dist/testing/hydrateTestApp.js +9 -9
- package/dist/testing/index.js +11 -11
- package/dist/testing/installTestStyleProcessors.js +1 -1
- package/dist/testing/loadEnv.js +3 -3
- package/dist/testing/loadEnvSetup.js +1 -1
- package/dist/testing/temp/componentPackageMock.js +2 -2
- package/dist/testing/temp/contentHtmlElements.js +2 -2
- package/dist/throwError.js +2 -2
- package/dist/timeProfiler.d.ts +1 -1
- package/dist/timeProfiler.d.ts.map +1 -1
- package/dist/timeProfiler.js +62 -26
- package/dist/update/integrateUpdateVdom.js +28 -28
- package/dist/validChildren.js +2 -2
- package/dist/warnOnFrameworkChange.js +2 -2
- package/dist/zones/react.js +3 -3
- package/package.json +18 -11
- package/types/modules.d.ts +2 -0
package/dist/bin/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { enableCompileCache, flushCompileCache } from 'node:module';
|
|
2
|
-
import { cliOut, cliWarn } from
|
|
3
|
-
import { beginStartupProfiling } from
|
|
2
|
+
import { cliOut, cliWarn } from '../cliOutput.js';
|
|
3
|
+
import { beginStartupProfiling } from '../timeProfiler.js';
|
|
4
4
|
// get command line args
|
|
5
5
|
const args = process.argv.slice(2);
|
|
6
6
|
const command = args[0];
|
|
@@ -21,7 +21,7 @@ const profileModulesArg = args.find(arg => arg === '--profile-modules' || arg.st
|
|
|
21
21
|
if (profileModulesArg !== undefined) {
|
|
22
22
|
const {
|
|
23
23
|
registerModuleLoadAnalysis
|
|
24
|
-
} = await import(
|
|
24
|
+
} = await import('./moduleLoadAnalysis.js');
|
|
25
25
|
registerModuleLoadAnalysis(profileModulesArg.split('=')[1]);
|
|
26
26
|
}
|
|
27
27
|
switch (command) {
|
|
@@ -31,7 +31,7 @@ switch (command) {
|
|
|
31
31
|
case '--help':
|
|
32
32
|
case '-h':
|
|
33
33
|
{
|
|
34
|
-
await import(
|
|
34
|
+
await import('./commands/help.js');
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
37
|
case 'dev':
|
|
@@ -40,20 +40,20 @@ switch (command) {
|
|
|
40
40
|
beginStartupProfiling(profile);
|
|
41
41
|
// set env before loading the next file, to set the env before file imports
|
|
42
42
|
process.env.__TUNGSTEN_ENV = 'development';
|
|
43
|
-
await import(
|
|
43
|
+
await import('./commands/dev.js');
|
|
44
44
|
break;
|
|
45
45
|
}
|
|
46
46
|
case 'devmon':
|
|
47
47
|
{
|
|
48
48
|
cliOut(`Starting Tungsten auto-restart dev mode`);
|
|
49
49
|
process.env.__TUNGSTEN_ENV = 'development';
|
|
50
|
-
await import(
|
|
50
|
+
await import('./commands/devmon.js');
|
|
51
51
|
break;
|
|
52
52
|
}
|
|
53
53
|
case 'build':
|
|
54
54
|
{
|
|
55
55
|
if (args.includes('--help') || args.includes('-h')) {
|
|
56
|
-
await import(
|
|
56
|
+
await import('./commands/buildHelp.js');
|
|
57
57
|
break;
|
|
58
58
|
}
|
|
59
59
|
// announce before the import: resolving the build's dependencies is a long silent wait
|
|
@@ -61,38 +61,38 @@ switch (command) {
|
|
|
61
61
|
beginStartupProfiling(profile);
|
|
62
62
|
process.env.__TUNGSTEN_ENV = 'production';
|
|
63
63
|
process.env.__TUNGSTEN_DEBUG = 'true';
|
|
64
|
-
await import(
|
|
64
|
+
await import('./commands/build.js');
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
67
|
case 'start':
|
|
68
68
|
{
|
|
69
69
|
cliOut(`Starting Tungsten server`);
|
|
70
70
|
process.env.__TUNGSTEN_ENV = 'production';
|
|
71
|
-
await import(
|
|
71
|
+
await import('./commands/start.js');
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
74
|
case 'static':
|
|
75
75
|
{
|
|
76
76
|
cliOut(`Starting Tungsten static site preview`);
|
|
77
77
|
//process.env.__TUNGSTEN_ENV = 'production'
|
|
78
|
-
await import(
|
|
78
|
+
await import('./commands/static.js');
|
|
79
79
|
break;
|
|
80
80
|
}
|
|
81
81
|
case 'clean':
|
|
82
82
|
{
|
|
83
|
-
await import(
|
|
83
|
+
await import('./commands/clean.js');
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
86
|
case 'compile':
|
|
87
87
|
{
|
|
88
88
|
beginStartupProfiling(profile);
|
|
89
89
|
process.env.__TUNGSTEN_ENV = 'development';
|
|
90
|
-
await import(
|
|
90
|
+
await import('./commands/compile.js');
|
|
91
91
|
break;
|
|
92
92
|
}
|
|
93
93
|
case 'compile-simple-package':
|
|
94
94
|
{
|
|
95
|
-
await import(
|
|
95
|
+
await import('./commands/compileSimplePackage.js');
|
|
96
96
|
break;
|
|
97
97
|
}
|
|
98
98
|
default:
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { registerHooks } from 'node:module';
|
|
6
6
|
import { performance } from 'node:perf_hooks';
|
|
7
7
|
import chalk from 'chalk-extensions';
|
|
8
|
-
import { cliOut } from
|
|
9
|
-
import { addEndOfRunReport } from
|
|
8
|
+
import { cliOut } from '../cliOutput.js';
|
|
9
|
+
import { addEndOfRunReport } from '../timeProfiler.js';
|
|
10
10
|
const records = new Map();
|
|
11
11
|
// The user's app enters the graph through an iterationQueryString() import, so its first module
|
|
12
12
|
// arrives as an explicitly tagged specifier - and recording stops there. Past that point the cost
|
package/dist/browserStorage.js
CHANGED
|
@@ -5,8 +5,8 @@ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.h
|
|
|
5
5
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
import { isBrowser } from
|
|
9
|
-
import { throwError } from
|
|
8
|
+
import { isBrowser } from './isBrowser.js';
|
|
9
|
+
import { throwError } from './throwError.js';
|
|
10
10
|
class ServerStorage {
|
|
11
11
|
constructor() {
|
|
12
12
|
_defineProperty(this, "get", () => throwError('Browser Storage', 'Browser storage was accessed on the server'));
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare
|
|
1
|
+
import type { PluginItem } from "@babel/core";
|
|
2
|
+
export declare function typescriptPreset(): PluginItem;
|
|
3
|
+
declare const userCommonConfig: {
|
|
4
|
+
ignore: RegExp[];
|
|
5
|
+
presets: PluginItem[];
|
|
6
|
+
plugins: PluginItem[];
|
|
7
|
+
};
|
|
3
8
|
export default userCommonConfig;
|
|
4
9
|
//# sourceMappingURL=babel.user.common.config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babel.user.common.config.d.ts","sourceRoot":"","sources":["../../src/build/babel.user.common.config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"babel.user.common.config.d.ts","sourceRoot":"","sources":["../../src/build/babel.user.common.config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,aAAa,CAAA;AAS/D,wBAAgB,gBAAgB,IAAI,UAAU,CAE7C;AAQD,QAAA,MAAM,gBAAgB;;aAWb,UAAU,EAAE;aAMZ,UAAU,EAAE;CACO,CAAA;AAE5B,eAAe,gBAAgB,CAAA"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { MakeBabelTransformJsxExtensionsToJs } from "../babelPlugins/BabelTransformJsxExtensionsToJs.js";
|
|
2
2
|
import { buildFolder } from "../settings.js";
|
|
3
3
|
import babelPresetReactModule from "@babel/preset-react";
|
|
4
|
+
import babelPresetTypescriptModule from "@babel/preset-typescript";
|
|
4
5
|
const babelPresetReact = babelPresetReactModule.default;
|
|
5
|
-
|
|
6
|
+
const babelPresetTypescript = babelPresetTypescriptModule.default;
|
|
7
|
+
// config `typescript: true`: appended after preset-react so babel runs it first (presets run last
|
|
8
|
+
// to first). allowDeclareFields matches tsc's useDefineForClassFields: `x: T` stays a field,
|
|
9
|
+
// `declare x: T` is erased - without it babel erases both.
|
|
10
|
+
export function typescriptPreset() {
|
|
11
|
+
return [babelPresetTypescript, {
|
|
12
|
+
allowDeclareFields: true
|
|
13
|
+
}];
|
|
14
|
+
}
|
|
6
15
|
import babelPluginCssToJs from "babel-plugin-css-to-js";
|
|
7
|
-
import babelPluginProposalClassPropertiesModule from "@babel/plugin-transform-class-properties";
|
|
8
|
-
const babelPluginProposalClassProperties = babelPluginProposalClassPropertiesModule.default;
|
|
9
16
|
const regexEscape = r => r.replaceAll(".", "\\.");
|
|
10
17
|
const ignoreRegex = new RegExp(`(node_modules|${regexEscape(buildFolder)})`);
|
|
11
18
|
const userCommonConfig = {
|
|
@@ -19,17 +26,9 @@ const userCommonConfig = {
|
|
|
19
26
|
// "importSource": "tungsten",
|
|
20
27
|
// }],
|
|
21
28
|
],
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"tungsten/jsx-runtime": "tungsten/jsxRuntime.js" // fix the import location created by @babel/preset-react
|
|
27
|
-
}
|
|
28
|
-
}], MakeBabelTransformJsxExtensionsToJs(), [babelPluginCssToJs], [babelPluginProposalClassProperties]],
|
|
29
|
-
"env": {
|
|
30
|
-
"production": {
|
|
31
|
-
"plugins": ["transform-react-remove-prop-types"]
|
|
32
|
-
}
|
|
33
|
-
}
|
|
29
|
+
// widen to allow pushing
|
|
30
|
+
// no alias plugin: preset-react's `tungsten/jsx-runtime` import resolves through the package's
|
|
31
|
+
// exports map (node, rollup, the packages plugin) and the dev import map has the same key
|
|
32
|
+
plugins: [MakeBabelTransformJsxExtensionsToJs(), [babelPluginCssToJs]] // widen to allow pushing
|
|
34
33
|
};
|
|
35
34
|
export default userCommonConfig;
|
package/dist/build/bundle.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function bundle(projectDir: string, quiet?: boolean): Promise<unknown>;
|
|
1
|
+
export declare function bundle(projectDir: string, quiet?: boolean, targets?: string | string[]): Promise<unknown>;
|
|
2
2
|
//# sourceMappingURL=bundle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/build/bundle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/build/bundle.ts"],"names":[],"mappings":"AAWA,wBAAsB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,UAAQ,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,oBA8C1F"}
|
package/dist/build/bundle.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { join } from 'path';
|
|
2
2
|
//import type { FrameworkConfigComplete } from '../FrameworkConfig.js'
|
|
3
|
-
import { findProjectDir } from
|
|
4
|
-
import { spawnShellCommand } from
|
|
5
|
-
import { prodBuildFolder, bundleFolder, frameworkDistFolder, clientFolder } from
|
|
6
|
-
import { errorOut } from
|
|
7
|
-
import { cliLog, cliOut } from
|
|
8
|
-
|
|
3
|
+
import { findProjectDir } from '../findProjectDir.js';
|
|
4
|
+
import { spawnShellCommand } from '../spawnShellCommand.js';
|
|
5
|
+
import { prodBuildFolder, bundleFolder, frameworkDistFolder, clientFolder } from '../settings.js';
|
|
6
|
+
import { errorOut } from '../output.js';
|
|
7
|
+
import { cliLog, cliOut } from '../cliOutput.js';
|
|
8
|
+
// targets: the config's browser floor for rollup's babel step, undefined for the framework default
|
|
9
|
+
export async function bundle(projectDir, quiet = false, targets) {
|
|
9
10
|
return new Promise((resolve, reject) => {
|
|
10
11
|
if (!quiet) cliOut('Bundling application');
|
|
11
12
|
const frameworkDir = findProjectDir(import.meta.url);
|
|
@@ -18,8 +19,15 @@ export async function bundle(projectDir, quiet = false /*, appConfig: FrameworkC
|
|
|
18
19
|
];
|
|
19
20
|
const command = `cd ${frameworkDir} && npx rollup` + ` --input "${join(projectDir, prodBuildFolder, clientFolder, 'client.js')}"` + ` --file "${join(projectDir, bundleFolder, 'client.js')}"` + ` --config "${join(frameworkDir, frameworkDistFolder, 'build/rollup.user.prod.config.js')}"` + (externalModules.length > 0 ? ` --external ${externalModules.join(',')}` : ``) + ` --inlineDynamicImports --format iife`;
|
|
20
21
|
if (!quiet) cliLog('bundle command:', command);
|
|
22
|
+
// the rollup config reads this back; a browserslist query can hold commas, which rollup's own
|
|
23
|
+
// --environment flag would split on
|
|
24
|
+
const env = targets === undefined ? process.env : {
|
|
25
|
+
...process.env,
|
|
26
|
+
TUNGSTEN_TARGETS: JSON.stringify(targets)
|
|
27
|
+
};
|
|
21
28
|
const subProcess = spawnShellCommand(command, {
|
|
22
|
-
cwd: frameworkDir
|
|
29
|
+
cwd: frameworkDir,
|
|
30
|
+
env
|
|
23
31
|
});
|
|
24
32
|
subProcess.on('data', data => {
|
|
25
33
|
if (!quiet) cliLog(data);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundleBabelOptions.d.ts","sourceRoot":"","sources":["../../src/build/bundleBabelOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAa7C,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,MAAM,GAAG,MAAM,EAA0B;;;EAMpF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import presetEnvModule from '@babel/preset-env';
|
|
2
|
+
import { MakeBabelTransformRemoveServerBlocks } from '../babelPlugins/BabelTransformRemoveServerBlocks.js';
|
|
3
|
+
import { MakeBabelTransformRemoveDevBlocks } from '../babelPlugins/BabelTransformRemoveDevBlocks.js';
|
|
4
|
+
import { defaultBrowserTargets } from '../settings.js';
|
|
5
|
+
// babel 7 presets are cjs and arrive as { default }, babel 8's are esm and arrive as the function
|
|
6
|
+
const presetEnv = typeof presetEnvModule === 'function' ? presetEnvModule : presetEnvModule.default;
|
|
7
|
+
// The production bundle's babel pass: strips server and dev blocks and lowers syntax to the browser
|
|
8
|
+
// floor. Back-compat lives here and nowhere else - dev serves what tsc emits. Only the rollup
|
|
9
|
+
// config (a build-time subprocess) imports this, so preset-env never loads under dev.
|
|
10
|
+
export function bundleBabelOptions(targets = defaultBrowserTargets) {
|
|
11
|
+
// bugfixes: where a target has a feature with a known bug, apply the small fix instead of the
|
|
12
|
+
// full lowering (opt-in on babel 7, always on in 8)
|
|
13
|
+
const presets = [[presetEnv, {
|
|
14
|
+
targets,
|
|
15
|
+
bugfixes: true,
|
|
16
|
+
modules: false
|
|
17
|
+
}]];
|
|
18
|
+
const plugins = [MakeBabelTransformRemoveServerBlocks(), MakeBabelTransformRemoveDevBlocks()];
|
|
19
|
+
return {
|
|
20
|
+
presets,
|
|
21
|
+
plugins
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { promises as fsPromises } from 'fs';
|
|
2
2
|
import { isAbsolute, join, relative, resolve } from 'path';
|
|
3
|
-
import { componentCssFile, componentCssFolder } from
|
|
4
|
-
import { TungstenError } from
|
|
3
|
+
import { componentCssFile, componentCssFolder } from '../settings.js';
|
|
4
|
+
import { TungstenError } from '../TungstenError.js';
|
|
5
5
|
const componentImportPattern = /@import\s+["'](i\/[^"']+\.css)["']\s*;/g;
|
|
6
6
|
const charsetPattern = /@charset\s+["']([^"']+)["']\s*;?/gi;
|
|
7
7
|
function validateCharset(css, file) {
|
|
@@ -11,14 +11,18 @@ type CompileJavascriptResult = {
|
|
|
11
11
|
export type JavascriptCompilationCycle = {
|
|
12
12
|
success: boolean;
|
|
13
13
|
file?: string;
|
|
14
|
+
client?: boolean;
|
|
14
15
|
};
|
|
15
16
|
export type CompileJavascriptOptions = {
|
|
16
17
|
quiet?: boolean;
|
|
17
18
|
packagesCacheLocation?: string;
|
|
19
|
+
stylesCacheLocation?: string;
|
|
20
|
+
rawBuildLocation?: string;
|
|
18
21
|
packages?: boolean;
|
|
19
22
|
hmr?: boolean;
|
|
20
23
|
onCycleComplete?: ((cycle: JavascriptCompilationCycle) => void | Promise<void>) | undefined;
|
|
21
24
|
tests?: boolean;
|
|
25
|
+
fresh?: boolean;
|
|
22
26
|
};
|
|
23
27
|
export declare function compileJavascript(projectDir: string, appConfig: FrameworkConfigComplete, codeLocation: string, sourceLocation: string, styleImportBase: string, buildLocation: string, buildCodeLocation: string, mode: Mode, watch?: boolean, options?: CompileJavascriptOptions): Promise<CompileJavascriptResult>;
|
|
24
28
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileJavascript.d.ts","sourceRoot":"","sources":["../../src/build/compileJavascript.ts"],"names":[],"mappings":"AAGA,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;
|
|
1
|
+
{"version":3,"file":"compileJavascript.d.ts","sourceRoot":"","sources":["../../src/build/compileJavascript.ts"],"names":[],"mappings":"AAGA,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;AAmBtC,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;IAEb,MAAM,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACnC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB,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;IAE3F,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,KAAK,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAuBD,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,CAwflC"}
|