tungsten 0.3.1 → 0.3.3
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 -0
- package/dist/Components.d.ts +2 -1
- package/dist/Components.d.ts.map +1 -1
- package/dist/Components.js +10 -1
- package/dist/DomRegion.js +1 -1
- package/dist/Framework.d.ts +2 -0
- package/dist/Framework.d.ts.map +1 -1
- package/dist/Framework.js +68 -57
- package/dist/FrameworkConfig.d.ts +6 -0
- package/dist/FrameworkConfig.d.ts.map +1 -1
- package/dist/FunctionComponentStandIn.d.ts +2 -0
- package/dist/FunctionComponentStandIn.d.ts.map +1 -1
- package/dist/FunctionComponentStandIn.js +10 -1
- package/dist/Instance/Instance.d.ts.map +1 -1
- package/dist/Instance/Instance.js +18 -1
- package/dist/Instance/InstanceConfig.d.ts +1 -0
- package/dist/Instance/InstanceConfig.d.ts.map +1 -1
- package/dist/PopMessage.type.d.ts +6 -0
- package/dist/PopMessage.type.d.ts.map +1 -0
- package/dist/PopMessage.type.js +1 -0
- package/dist/Servers/DevServer.d.ts +4 -0
- package/dist/Servers/DevServer.d.ts.map +1 -1
- package/dist/Servers/DevServer.js +116 -13
- package/dist/Servers/MatchedRouteInfo.d.ts +1 -1
- package/dist/Servers/MatchedRouteInfo.d.ts.map +1 -1
- package/dist/Servers/ProdServer.d.ts +1 -0
- package/dist/Servers/ProdServer.d.ts.map +1 -1
- package/dist/Servers/ProdServer.js +79 -5
- package/dist/Servers/devErrorPageAutoRetry.d.ts +4 -0
- package/dist/Servers/devErrorPageAutoRetry.d.ts.map +1 -0
- package/dist/Servers/devErrorPageAutoRetry.js +26 -0
- package/dist/Servers/hono/DevServerHono.js +25 -29
- package/dist/Servers/hono/ProdServerHono.js +49 -142
- package/dist/Servers/hono/TungstenServerHono.d.ts +1 -1
- package/dist/Servers/hono/TungstenServerHono.d.ts.map +1 -1
- package/dist/Servers/hono/TungstenServerHono.js +12 -29
- package/dist/Servers/routing.d.ts.map +1 -1
- package/dist/Servers/routing.js +10 -6
- package/dist/Servers/tungstenCorePrivateEnvSchema.d.ts +0 -3
- package/dist/Servers/tungstenCorePrivateEnvSchema.d.ts.map +1 -1
- package/dist/Servers/tungstenCorePrivateEnvSchema.js +3 -3
- package/dist/Servers/tungstenCorePublicEnvSchema.d.ts +8 -0
- package/dist/Servers/tungstenCorePublicEnvSchema.d.ts.map +1 -0
- package/dist/Servers/tungstenCorePublicEnvSchema.js +14 -0
- package/dist/Store/InternalStoreSchema.d.ts +2 -0
- package/dist/Store/InternalStoreSchema.d.ts.map +1 -1
- package/dist/Store/InternalStoreSchema.js +1 -0
- package/dist/api/Request.d.ts +1 -1
- package/dist/api/Request.d.ts.map +1 -1
- package/dist/api/Response.d.ts +1 -1
- package/dist/api/Response.d.ts.map +1 -1
- package/dist/api/getExport.d.ts.map +1 -1
- package/dist/api/getExport.js +2 -1
- package/dist/babelPlugins/BabelAddDevCacheBust.d.ts +11 -0
- package/dist/babelPlugins/BabelAddDevCacheBust.d.ts.map +1 -0
- package/dist/babelPlugins/BabelAddDevCacheBust.js +68 -0
- package/dist/babelPlugins/BabelTypes.d.ts +2 -2
- package/dist/babelPlugins/BabelTypes.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTypes.js +0 -1
- package/dist/bin/commands/build.d.ts.map +1 -1
- package/dist/bin/commands/build.js +3 -0
- package/dist/bin/commands/dev.d.ts.map +1 -1
- package/dist/bin/commands/dev.js +16 -3
- package/dist/bin/commands/devmon.d.ts +2 -0
- package/dist/bin/commands/devmon.d.ts.map +1 -0
- package/dist/bin/commands/devmon.js +66 -0
- package/dist/bin/index.d.ts.map +1 -1
- package/dist/bin/index.js +6 -0
- package/dist/booleanAttributeValue.d.ts +21 -0
- package/dist/booleanAttributeValue.d.ts.map +1 -0
- package/dist/booleanAttributeValue.js +23 -0
- package/dist/build/compileJavascript.js +1 -1
- package/dist/build/compileUserApp.d.ts +2 -1
- package/dist/build/compileUserApp.d.ts.map +1 -1
- package/dist/build/compileUserApp.js +10 -9
- package/dist/build/createInstanceConfigFile.js +1 -1
- package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserDevConfig.js +6 -1
- package/dist/compat/types.d.ts +1 -1
- package/dist/compat/types.d.ts.map +1 -1
- package/dist/components/PopMessages.d.ts +12 -0
- package/dist/components/PopMessages.d.ts.map +1 -0
- package/dist/components/PopMessages.js +45 -0
- package/dist/defaultConfig.d.ts +3 -0
- package/dist/defaultConfig.d.ts.map +1 -1
- package/dist/defaultConfig.js +4 -1
- package/dist/env/Interfaces.d.ts +2 -1
- package/dist/env/Interfaces.d.ts.map +1 -1
- package/dist/env/getEnvSchemas.d.ts +1 -1
- package/dist/env/getEnvSchemas.d.ts.map +1 -1
- package/dist/env/getEnvSchemas.js +2 -1
- package/dist/env/publicEnv.d.ts.map +1 -1
- package/dist/env/publicEnv.js +4 -1
- package/dist/frameworkConfigSchema.d.ts +4 -0
- package/dist/frameworkConfigSchema.d.ts.map +1 -1
- package/dist/frameworkConfigSchema.js +2 -1
- package/dist/getComponent.d.ts.map +1 -1
- package/dist/getComponent.js +2 -1
- package/dist/getRoutes.d.ts.map +1 -1
- package/dist/getRoutes.js +2 -1
- package/dist/hmr/applyHmrModule.d.ts +11 -0
- package/dist/hmr/applyHmrModule.d.ts.map +1 -0
- package/dist/hmr/applyHmrModule.js +78 -0
- package/dist/hmr/componentIdentity.d.ts +9 -0
- package/dist/hmr/componentIdentity.d.ts.map +1 -0
- package/dist/hmr/componentIdentity.js +17 -0
- package/dist/hmr/instanceRegistry.d.ts +4 -0
- package/dist/hmr/instanceRegistry.d.ts.map +1 -0
- package/dist/hmr/instanceRegistry.js +6 -0
- package/dist/hmr/liveReloadHub.d.ts +10 -0
- package/dist/hmr/liveReloadHub.d.ts.map +1 -0
- package/dist/{dev → hmr}/liveReloadHub.js +8 -2
- package/dist/hmr/refreshStylesheets.d.ts +2 -0
- package/dist/hmr/refreshStylesheets.d.ts.map +1 -0
- package/dist/hmr/refreshStylesheets.js +26 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useInstance.d.ts +3 -0
- package/dist/hooks/useInstance.d.ts.map +1 -0
- package/dist/hooks/useInstance.js +4 -0
- package/dist/hydrate/hydrate.d.ts +10 -0
- package/dist/hydrate/hydrate.d.ts.map +1 -1
- package/dist/hydrate/hydrate.js +81 -19
- package/dist/hydrate/reconcileHydratedAttributes.d.ts.map +1 -1
- package/dist/hydrate/reconcileHydratedAttributes.js +14 -5
- package/dist/hydrate/renderHydrationMismatchBanner.d.ts +7 -0
- package/dist/hydrate/renderHydrationMismatchBanner.d.ts.map +1 -0
- package/dist/hydrate/renderHydrationMismatchBanner.js +69 -0
- package/dist/importDevModuleWithRetry.d.ts +3 -0
- package/dist/importDevModuleWithRetry.d.ts.map +1 -0
- package/dist/importDevModuleWithRetry.js +46 -0
- package/dist/indexInner.d.ts +8 -0
- package/dist/indexInner.d.ts.map +1 -1
- package/dist/indexInner.js +7 -1
- package/dist/makeInstanceConfigFromFrameworkConfig.d.ts.map +1 -1
- package/dist/makeInstanceConfigFromFrameworkConfig.js +2 -1
- package/dist/pop.d.ts +10 -0
- package/dist/pop.d.ts.map +1 -0
- package/dist/pop.js +49 -0
- package/dist/rawHtml/filterContentNode.d.ts +20 -0
- package/dist/rawHtml/filterContentNode.d.ts.map +1 -0
- package/dist/rawHtml/filterContentNode.js +96 -0
- package/dist/rawHtml/parseHtml.d.ts +14 -0
- package/dist/rawHtml/parseHtml.d.ts.map +1 -1
- package/dist/rawHtml/parseHtml.js +4 -4
- package/dist/rawHtml/sanitizeHtml.d.ts +17 -0
- package/dist/rawHtml/sanitizeHtml.d.ts.map +1 -0
- package/dist/rawHtml/sanitizeHtml.js +19 -0
- package/dist/render/HeadData.d.ts +2 -0
- package/dist/render/HeadData.d.ts.map +1 -1
- package/dist/render/contentNodeToHtml.d.ts +18 -0
- package/dist/render/contentNodeToHtml.d.ts.map +1 -0
- package/dist/render/contentNodeToHtml.js +66 -0
- package/dist/render/contentToHtml.d.ts.map +1 -1
- package/dist/render/contentToHtml.js +3 -1
- package/dist/render/processHead.d.ts.map +1 -1
- package/dist/render/processHead.js +53 -6
- package/dist/render/renderingTreeToHtml.d.ts.map +1 -1
- package/dist/render/renderingTreeToHtml.js +8 -1
- package/dist/routing/ErrorRouteType.d.ts +6 -0
- package/dist/routing/ErrorRouteType.d.ts.map +1 -0
- package/dist/routing/ErrorRouteType.js +1 -0
- package/dist/routing/RouteTypes.d.ts +2 -1
- package/dist/routing/RouteTypes.d.ts.map +1 -1
- package/dist/routing/Routes.d.ts +5 -0
- package/dist/routing/Routes.d.ts.map +1 -1
- package/dist/routing/TungstenErrorInfo.d.ts +6 -0
- package/dist/routing/TungstenErrorInfo.d.ts.map +1 -0
- package/dist/routing/TungstenErrorInfo.js +6 -0
- package/dist/style/styleContentSxy.js +21 -0
- package/dist/testing/hydrateTestApp.d.ts +38 -0
- package/dist/testing/hydrateTestApp.d.ts.map +1 -0
- package/dist/testing/hydrateTestApp.js +242 -0
- package/dist/testing/index.d.ts +4 -3
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +16 -2
- package/dist/timeProfiler.d.ts +6 -0
- package/dist/timeProfiler.d.ts.map +1 -0
- package/dist/timeProfiler.js +31 -0
- package/dist/update/integrateUpdateVdom.d.ts +16 -1
- package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
- package/dist/update/integrateUpdateVdom.js +116 -7
- package/dist/warnOnFrameworkChange.d.ts +2 -0
- package/dist/warnOnFrameworkChange.d.ts.map +1 -0
- package/dist/warnOnFrameworkChange.js +27 -0
- package/package.json +18 -16
- package/dist/Instance/gotoRedirect.sxyt.d.ts +0 -2
- package/dist/Instance/gotoRedirect.sxyt.d.ts.map +0 -1
- package/dist/Instance/gotoRedirect.sxyt.js +0 -148
- package/dist/Instance/runTrackedWork.sxyt.d.ts +0 -2
- package/dist/Instance/runTrackedWork.sxyt.d.ts.map +0 -1
- package/dist/Instance/runTrackedWork.sxyt.js +0 -35
- package/dist/_client/cjsHelpers.sxyt.d.ts +0 -2
- package/dist/_client/cjsHelpers.sxyt.d.ts.map +0 -1
- package/dist/_client/cjsHelpers.sxyt.js +0 -45
- package/dist/auth/passwordHashing.sxyt.d.ts +0 -2
- package/dist/auth/passwordHashing.sxyt.d.ts.map +0 -1
- package/dist/auth/passwordHashing.sxyt.js +0 -46
- package/dist/auth/ref/checkPasswordResetToken.sxyt.d.ts +0 -2
- package/dist/auth/ref/checkPasswordResetToken.sxyt.d.ts.map +0 -1
- package/dist/auth/ref/checkPasswordResetToken.sxyt.js +0 -40
- package/dist/auth/ref/createPasswordResetToken.sxyt.d.ts +0 -2
- package/dist/auth/ref/createPasswordResetToken.sxyt.d.ts.map +0 -1
- package/dist/auth/ref/createPasswordResetToken.sxyt.js +0 -10
- package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.d.ts +0 -2
- package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.d.ts.map +0 -1
- package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.js +0 -108
- package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.d.ts +0 -2
- package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.d.ts.map +0 -1
- package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.js +0 -104
- package/dist/bin/commands/compile.sxyt.d.ts +0 -2
- package/dist/bin/commands/compile.sxyt.d.ts.map +0 -1
- package/dist/bin/commands/compile.sxyt.js +0 -255
- package/dist/build/modifySassImports.sxyt.d.ts +0 -2
- package/dist/build/modifySassImports.sxyt.d.ts.map +0 -1
- package/dist/build/modifySassImports.sxyt.js +0 -55
- package/dist/build/sassImportParser.sxyt.d.ts +0 -2
- package/dist/build/sassImportParser.sxyt.d.ts.map +0 -1
- package/dist/build/sassImportParser.sxyt.js +0 -110
- package/dist/build/scssImportParserChatgpt.sxyt.d.ts +0 -2
- package/dist/build/scssImportParserChatgpt.sxyt.d.ts.map +0 -1
- package/dist/build/scssImportParserChatgpt.sxyt.js +0 -120
- package/dist/clone.sxyt.d.ts +0 -2
- package/dist/clone.sxyt.d.ts.map +0 -1
- package/dist/clone.sxyt.js +0 -24
- package/dist/componentProxyHandlers.sxyt.d.ts +0 -2
- package/dist/componentProxyHandlers.sxyt.d.ts.map +0 -1
- package/dist/componentProxyHandlers.sxyt.js +0 -130
- package/dist/components/RawHtml.sxyt.d.ts +0 -2
- package/dist/components/RawHtml.sxyt.d.ts.map +0 -1
- package/dist/components/RawHtml.sxyt.js +0 -104
- package/dist/components/bindable/BindableSelect.sxyt.d.ts +0 -2
- package/dist/components/bindable/BindableSelect.sxyt.d.ts.map +0 -1
- package/dist/components/bindable/BindableSelect.sxyt.js +0 -186
- package/dist/dev/liveReloadHub.d.ts +0 -6
- package/dist/dev/liveReloadHub.d.ts.map +0 -1
- package/dist/env/injectEnv.sxyt.d.ts +0 -2
- package/dist/env/injectEnv.sxyt.d.ts.map +0 -1
- package/dist/env/injectEnv.sxyt.js +0 -20
- package/dist/env/parseEnv.sxyt.d.ts +0 -2
- package/dist/env/parseEnv.sxyt.d.ts.map +0 -1
- package/dist/env/parseEnv.sxyt.js +0 -11
- package/dist/findProjectDir.sxyt.d.ts +0 -2
- package/dist/findProjectDir.sxyt.d.ts.map +0 -1
- package/dist/findProjectDir.sxyt.js +0 -82
- package/dist/hydrate/reconcileHydratedAttributes.sxyt.d.ts +0 -2
- package/dist/hydrate/reconcileHydratedAttributes.sxyt.d.ts.map +0 -1
- package/dist/hydrate/reconcileHydratedAttributes.sxyt.js +0 -173
- package/dist/innerHtmlFromProps.sxyt.d.ts +0 -2
- package/dist/innerHtmlFromProps.sxyt.d.ts.map +0 -1
- package/dist/innerHtmlFromProps.sxyt.js +0 -99
- package/dist/postcssPlugins/parseSelectors.sxyt.d.ts +0 -2
- package/dist/postcssPlugins/parseSelectors.sxyt.d.ts.map +0 -1
- package/dist/postcssPlugins/parseSelectors.sxyt.js +0 -62
- package/dist/postcssPlugins/parseSelectorsRich.sxyt.d.ts +0 -2
- package/dist/postcssPlugins/parseSelectorsRich.sxyt.d.ts.map +0 -1
- package/dist/postcssPlugins/parseSelectorsRich.sxyt.js +0 -155
- package/dist/rawHtml/parseHtml.sxyt.d.ts +0 -2
- package/dist/rawHtml/parseHtml.sxyt.d.ts.map +0 -1
- package/dist/rawHtml/parseHtml.sxyt.js +0 -239
- package/dist/render/getFunctionBodyAsString.sxyt.d.ts +0 -2
- package/dist/render/getFunctionBodyAsString.sxyt.d.ts.map +0 -1
- package/dist/render/getFunctionBodyAsString.sxyt.js +0 -37
- package/dist/render/processProps.sxyt.d.ts +0 -2
- package/dist/render/processProps.sxyt.d.ts.map +0 -1
- package/dist/render/processProps.sxyt.js +0 -90
- package/dist/routing/compareRequestToRegex.sxyt.d.ts +0 -2
- package/dist/routing/compareRequestToRegex.sxyt.d.ts.map +0 -1
- package/dist/routing/compareRequestToRegex.sxyt.js +0 -65
- package/dist/routing/getPathPriority.sxyt.d.ts +0 -2
- package/dist/routing/getPathPriority.sxyt.d.ts.map +0 -1
- package/dist/routing/getPathPriority.sxyt.js +0 -24
- package/dist/routing/matchPath.sxyt.d.ts +0 -2
- package/dist/routing/matchPath.sxyt.d.ts.map +0 -1
- package/dist/routing/matchPath.sxyt.js +0 -41
- package/dist/routing/patternToRegex.sxyt.d.ts +0 -2
- package/dist/routing/patternToRegex.sxyt.d.ts.map +0 -1
- package/dist/routing/patternToRegex.sxyt.js +0 -69
- package/dist/routing/splitRequest.sxyt.d.ts +0 -2
- package/dist/routing/splitRequest.sxyt.d.ts.map +0 -1
- package/dist/routing/splitRequest.sxyt.js +0 -47
- package/dist/style/jssToCss.sxyt.d.ts +0 -2
- package/dist/style/jssToCss.sxyt.d.ts.map +0 -1
- package/dist/style/jssToCss.sxyt.js +0 -17
- package/dist/testing/createTestApp.sxyt.d.ts +0 -2
- package/dist/testing/createTestApp.sxyt.d.ts.map +0 -1
- package/dist/testing/createTestApp.sxyt.js +0 -470
- package/dist/testing/ensureTestEnvLoaded.sxyt.d.ts +0 -2
- package/dist/testing/ensureTestEnvLoaded.sxyt.d.ts.map +0 -1
- package/dist/testing/ensureTestEnvLoaded.sxyt.js +0 -20
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { describe } from 'sxy-test-runner';
|
|
2
|
-
import { expect } from 'chai';
|
|
3
|
-
import { objects } from 'sxy-lib';
|
|
4
|
-
import { compareRequestToRegex } from "./compareRequestToRegex.js";
|
|
5
|
-
import { patternToRegex } from "./patternToRegex.js";
|
|
6
|
-
describe('routing/compareRequestToRegex()', ({
|
|
7
|
-
it
|
|
8
|
-
}) => {
|
|
9
|
-
it(`/foo matches /foo no params`, () => {
|
|
10
|
-
const pattern = '/foo';
|
|
11
|
-
const request = '/foo';
|
|
12
|
-
const {
|
|
13
|
-
regex,
|
|
14
|
-
keys
|
|
15
|
-
} = patternToRegex(pattern);
|
|
16
|
-
const {
|
|
17
|
-
success,
|
|
18
|
-
params
|
|
19
|
-
} = compareRequestToRegex(request, regex, keys);
|
|
20
|
-
success.should.equal(true);
|
|
21
|
-
objects.count(params).should.equal(0);
|
|
22
|
-
});
|
|
23
|
-
it(`/foo does not match /foo/bar`, () => {
|
|
24
|
-
const pattern = '/foo';
|
|
25
|
-
const request = '/foo/bar';
|
|
26
|
-
const {
|
|
27
|
-
regex,
|
|
28
|
-
keys
|
|
29
|
-
} = patternToRegex(pattern);
|
|
30
|
-
const {
|
|
31
|
-
success,
|
|
32
|
-
params
|
|
33
|
-
} = compareRequestToRegex(request, regex, keys); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
34
|
-
success.should.equal(false);
|
|
35
|
-
});
|
|
36
|
-
it(`/foo/:bar matches /foo/bing with the params { bar: 'bing' }"`, () => {
|
|
37
|
-
const pattern = '/foo/:bar';
|
|
38
|
-
const request = '/foo/bing';
|
|
39
|
-
const {
|
|
40
|
-
regex,
|
|
41
|
-
keys
|
|
42
|
-
} = patternToRegex(pattern);
|
|
43
|
-
const c = compareRequestToRegex(request, regex, keys);
|
|
44
|
-
const {
|
|
45
|
-
success,
|
|
46
|
-
params
|
|
47
|
-
} = c;
|
|
48
|
-
success.should.equal(true);
|
|
49
|
-
objects.count(params).should.equal(1);
|
|
50
|
-
expect(params.bar).to.equal('bing');
|
|
51
|
-
});
|
|
52
|
-
it(`/foo/:bar does not match /foo/"`, () => {
|
|
53
|
-
const pattern = '/foo/:bar';
|
|
54
|
-
const request = '/foo/';
|
|
55
|
-
const {
|
|
56
|
-
regex,
|
|
57
|
-
keys
|
|
58
|
-
} = patternToRegex(pattern);
|
|
59
|
-
const {
|
|
60
|
-
success,
|
|
61
|
-
params
|
|
62
|
-
} = compareRequestToRegex(request, regex, keys); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
63
|
-
success.should.equal(false);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getPathPriority.sxyt.d.ts","sourceRoot":"","sources":["../../src/routing/getPathPriority.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { describe } from 'sxy-test-runner';
|
|
2
|
-
import { getPathPriority } from "./getPathPriority.js";
|
|
3
|
-
describe('routing/compareRequestToRegex()', ({
|
|
4
|
-
it
|
|
5
|
-
}) => {
|
|
6
|
-
it(`/foo returns priority 2`, () => {
|
|
7
|
-
const pattern = '/foo';
|
|
8
|
-
const priority = getPathPriority(pattern);
|
|
9
|
-
//console.log('priority', priority)
|
|
10
|
-
priority.should.equal(2);
|
|
11
|
-
});
|
|
12
|
-
it(`/foo/:bar/foo returns priority 212`, () => {
|
|
13
|
-
const pattern = '/foo/:bar/foo';
|
|
14
|
-
const priority = getPathPriority(pattern);
|
|
15
|
-
//console.log('priority', priority)
|
|
16
|
-
priority.should.equal(212);
|
|
17
|
-
});
|
|
18
|
-
it(`/foo/:bar([^\\/])/foo returns priority 212`, () => {
|
|
19
|
-
const pattern = '/foo/:bar([^\\/])/foo';
|
|
20
|
-
const priority = getPathPriority(pattern);
|
|
21
|
-
//console.log('priority', priority)
|
|
22
|
-
priority.should.equal(212);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"matchPath.sxyt.d.ts","sourceRoot":"","sources":["../../src/routing/matchPath.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { describe } from 'sxy-test-runner';
|
|
2
|
-
import { expect } from 'chai';
|
|
3
|
-
import { matchPath } from "./matchPath.js";
|
|
4
|
-
describe('routing/matchPath()', ({
|
|
5
|
-
it
|
|
6
|
-
}) => {
|
|
7
|
-
it(`returns null for /foo against /bar`, () => {
|
|
8
|
-
expect(matchPath('/foo', '/bar')).to.equal(null);
|
|
9
|
-
});
|
|
10
|
-
it(`returns match object for /foo against /foo`, () => {
|
|
11
|
-
const match = matchPath('/foo', '/foo');
|
|
12
|
-
expect(match).not.to.equal(null);
|
|
13
|
-
});
|
|
14
|
-
it(`returns match object for /foo/ against /foo`, () => {
|
|
15
|
-
const match = matchPath('/foo/', '/foo');
|
|
16
|
-
expect(match).not.to.equal(null);
|
|
17
|
-
});
|
|
18
|
-
it(`matches /foo when the request has a query string`, () => {
|
|
19
|
-
const match = matchPath('/foo', '/foo?bar=1');
|
|
20
|
-
expect(match).not.to.equal(null);
|
|
21
|
-
expect(match.query).to.deep.equal({
|
|
22
|
-
bar: '1'
|
|
23
|
-
});
|
|
24
|
-
expect(match.pathname).to.equal('/foo');
|
|
25
|
-
});
|
|
26
|
-
it(`matches /foo when the request has a hash fragment`, () => {
|
|
27
|
-
const match = matchPath('/foo', '/foo#section');
|
|
28
|
-
expect(match).not.to.equal(null);
|
|
29
|
-
expect(match.hash).to.equal('section');
|
|
30
|
-
});
|
|
31
|
-
it(`matches a dynamic route with a query string and captures the param`, () => {
|
|
32
|
-
const match = matchPath('/leads/:id/details', '/leads/5/details?queue=1');
|
|
33
|
-
expect(match).not.to.equal(null);
|
|
34
|
-
expect(match.params).to.deep.equal({
|
|
35
|
-
id: '5'
|
|
36
|
-
});
|
|
37
|
-
expect(match.query).to.deep.equal({
|
|
38
|
-
queue: '1'
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"patternToRegex.sxyt.d.ts","sourceRoot":"","sources":["../../src/routing/patternToRegex.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { describe } from 'sxy-test-runner';
|
|
2
|
-
import { patternToRegex } from "./patternToRegex.js";
|
|
3
|
-
import { regexEquals } from "../_testing/regexEquals.js";
|
|
4
|
-
describe('routing/patternToRegex()', ({
|
|
5
|
-
it
|
|
6
|
-
}) => {
|
|
7
|
-
it(`Converts /foo to /^\\/foo\\/?$/ with no keys`, () => {
|
|
8
|
-
const {
|
|
9
|
-
regex,
|
|
10
|
-
keys
|
|
11
|
-
} = patternToRegex('/foo');
|
|
12
|
-
regexEquals(regex, /^\/foo\/?$/).should.equal(true);
|
|
13
|
-
keys.length.should.equal(0);
|
|
14
|
-
});
|
|
15
|
-
it(`Converts /foo/:bar to /^\\/foo\\/([^/]+)\\/?$/ and saves the key "bar"`, () => {
|
|
16
|
-
const {
|
|
17
|
-
regex,
|
|
18
|
-
keys
|
|
19
|
-
} = patternToRegex('/foo/:bar');
|
|
20
|
-
regexEquals(regex, /^\/foo\/([^/]+)\/?$/).should.equal(true);
|
|
21
|
-
keys.length.should.equal(1);
|
|
22
|
-
keys[0].should.equal('bar');
|
|
23
|
-
});
|
|
24
|
-
it(`Converts /foo/:bar(\\d+) to /^\\/foo\\/(\\d+)\\/?$/, preserving the regex matcher, and saves the key "bar"`, () => {
|
|
25
|
-
const {
|
|
26
|
-
regex,
|
|
27
|
-
keys
|
|
28
|
-
} = patternToRegex('/foo/:bar(\\d+)');
|
|
29
|
-
regexEquals(regex, /^\/foo\/(\d+)\/?$/).should.equal(true);
|
|
30
|
-
keys.length.should.equal(1);
|
|
31
|
-
keys[0].should.equal('bar');
|
|
32
|
-
});
|
|
33
|
-
it(`Converts /foo/:bar/baz to /^\\/foo\\/([^/]+)\\/baz/?$/ and saves the key "bar"`, () => {
|
|
34
|
-
const {
|
|
35
|
-
regex,
|
|
36
|
-
keys
|
|
37
|
-
} = patternToRegex('/foo/:bar/baz');
|
|
38
|
-
regexEquals(regex, /^\/foo\/([^/]+)\/baz\/?$/).should.equal(true);
|
|
39
|
-
keys.length.should.equal(1);
|
|
40
|
-
keys[0].should.equal('bar');
|
|
41
|
-
});
|
|
42
|
-
it(`Converts /foo/:bar<digits> to /^\\/foo\\/(\\d+)\\/?$/ and saves the key "bar"`, () => {
|
|
43
|
-
const {
|
|
44
|
-
regex,
|
|
45
|
-
keys
|
|
46
|
-
} = patternToRegex('/foo/:bar<digits>');
|
|
47
|
-
regexEquals(regex, /^\/foo\/(\d+)\/?$/).should.equal(true);
|
|
48
|
-
keys.length.should.equal(1);
|
|
49
|
-
keys[0].should.equal('bar');
|
|
50
|
-
});
|
|
51
|
-
it(`Converts /foo/:bar<int-ge1> to /^\\/foo\\/([1-9]\\d*)\\/?$/ and saves the key "bar"`, () => {
|
|
52
|
-
const {
|
|
53
|
-
regex,
|
|
54
|
-
keys
|
|
55
|
-
} = patternToRegex('/foo/:bar<int-ge1>');
|
|
56
|
-
regexEquals(regex, /^\/foo\/([1-9]\d*)\/?$/).should.equal(true);
|
|
57
|
-
keys.length.should.equal(1);
|
|
58
|
-
keys[0].should.equal('bar');
|
|
59
|
-
});
|
|
60
|
-
it(`Converts /foo/:bar<1+> to /^\\/foo\\/([1-9]\\d*)\\/?$/ and saves the key "bar"`, () => {
|
|
61
|
-
const {
|
|
62
|
-
regex,
|
|
63
|
-
keys
|
|
64
|
-
} = patternToRegex('/foo/:bar<1+>');
|
|
65
|
-
regexEquals(regex, /^\/foo\/([1-9]\d*)\/?$/).should.equal(true);
|
|
66
|
-
keys.length.should.equal(1);
|
|
67
|
-
keys[0].should.equal('bar');
|
|
68
|
-
});
|
|
69
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"splitRequest.sxyt.d.ts","sourceRoot":"","sources":["../../src/routing/splitRequest.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { describe } from 'sxy-test-runner';
|
|
2
|
-
import { expect } from 'chai';
|
|
3
|
-
import { splitRequest } from "./splitRequest.js";
|
|
4
|
-
describe('routing/splitRequest()', ({
|
|
5
|
-
it
|
|
6
|
-
}) => {
|
|
7
|
-
it(`returns the path unchanged when there is no query or hash`, () => {
|
|
8
|
-
expect(splitRequest('/foo/bar')).to.deep.equal({
|
|
9
|
-
pathname: '/foo/bar',
|
|
10
|
-
query: {},
|
|
11
|
-
hash: ''
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
it(`splits off a query string and parses it`, () => {
|
|
15
|
-
expect(splitRequest('/foo?a=1&b=2')).to.deep.equal({
|
|
16
|
-
pathname: '/foo',
|
|
17
|
-
query: {
|
|
18
|
-
a: '1',
|
|
19
|
-
b: '2'
|
|
20
|
-
},
|
|
21
|
-
hash: ''
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
it(`splits off a hash fragment`, () => {
|
|
25
|
-
expect(splitRequest('/foo#section')).to.deep.equal({
|
|
26
|
-
pathname: '/foo',
|
|
27
|
-
query: {},
|
|
28
|
-
hash: 'section'
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
it(`splits off both query and hash`, () => {
|
|
32
|
-
expect(splitRequest('/foo?a=1#section')).to.deep.equal({
|
|
33
|
-
pathname: '/foo',
|
|
34
|
-
query: {
|
|
35
|
-
a: '1'
|
|
36
|
-
},
|
|
37
|
-
hash: 'section'
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
it(`does not treat a '?' inside the hash as a query delimiter`, () => {
|
|
41
|
-
expect(splitRequest('/foo#a?b')).to.deep.equal({
|
|
42
|
-
pathname: '/foo',
|
|
43
|
-
query: {},
|
|
44
|
-
hash: 'a?b'
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jssToCss.sxyt.d.ts","sourceRoot":"","sources":["../../src/style/jssToCss.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
/*
|
|
3
|
-
describe('jssToCss()', ({it}: DescribeArg) => {
|
|
4
|
-
it(`Converts color: red`, () => {
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
jssToCss({ color: 'red'}).should.equal('color: red;')
|
|
7
|
-
})
|
|
8
|
-
it(`Converts border-color: red`, () => {
|
|
9
|
-
// @ts-ignore
|
|
10
|
-
jssToCss({ borderColor: 'red'}).should.equal('border-color: red;')
|
|
11
|
-
})
|
|
12
|
-
it(`Converts font-size: 14px`, () => {
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
jssToCss({ fontSize: 14}).should.equal('font-size: 14px;')
|
|
15
|
-
})
|
|
16
|
-
})
|
|
17
|
-
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createTestApp.sxyt.d.ts","sourceRoot":"","sources":["../../src/testing/createTestApp.sxyt.tsx"],"names":[],"mappings":""}
|