Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Issue #843: explicit file path in import and export statements in ES modules for better web-browser support #844

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* @packageDocumentation
* @preferred
*/
import { isFunction, isString, isArray, isRegExp, isDate } from './predicates';
import { all, any, prop, curry, not } from './hof';
import { services } from './coreservices';
import { StateObject } from '../state/stateObject';
import { isFunction, isString, isArray, isRegExp, isDate } from './predicates.js';
import { all, any, prop, curry, not } from './hof.js';
import { services } from './coreservices.js';
import { StateObject } from '../state/stateObject.js';

declare const global;
export const root: any =
Expand Down
6 changes: 3 additions & 3 deletions src/common/coreservices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
*
* @packageDocumentation
*/
import { IInjectable, Obj } from './common';
import { Disposable } from '../interface';
import { UrlConfig, UrlService } from '../url';
import { IInjectable, Obj } from './common.js';
import { Disposable } from '../interface.js';
import { UrlConfig, UrlService } from '../url/index.js';

const noImpl = (fnname: string) => () => {
throw new Error(`No implementation for ${fnname}. The framework specific code did not implement this method.`);
Expand Down
2 changes: 1 addition & 1 deletion src/common/hof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @packageDocumentation
*/

import { Predicate } from './common';
import { Predicate } from './common.js';
/**
* Returns a new function for [Partial Application](https://en.wikipedia.org/wiki/Partial_application) of the original function.
*
Expand Down
16 changes: 8 additions & 8 deletions src/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export * from './common';
export * from './coreservices';
export * from './glob';
export * from './hof';
export * from './predicates';
export * from './queue';
export * from './strings';
export * from './trace';
export * from './common.js';
export * from './coreservices.js';
export * from './glob.js';
export * from './hof.js';
export * from './predicates.js';
export * from './queue.js';
export * from './strings.js';
export * from './trace.js';
6 changes: 3 additions & 3 deletions src/common/predicates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*
* @packageDocumentation
*/
import { and, not, pipe, prop, or } from './hof';
import { Predicate } from './common'; // has or is using
import { StateObject } from '../state/stateObject';
import { and, not, pipe, prop, or } from './hof.js';
import { Predicate } from './common.js'; // has or is using
import { StateObject } from '../state/stateObject.js';

const toStr = Object.prototype.toString;
const tis = (t: string) => (x: any) => typeof x === t;
Expand Down
2 changes: 1 addition & 1 deletion src/common/queue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { pushTo } from './common';
import { pushTo } from './common.js';

export class Queue<T> {
private _evictListeners: ((item: T) => void)[] = [];
Expand Down
2 changes: 1 addition & 1 deletion src/common/safeConsole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @packageDocumentation
*/
/* tslint:disable:no-console */
import { noop } from './common';
import { noop } from './common.js';

const noopConsoleStub = { log: noop, error: noop, table: noop };

Expand Down
8 changes: 4 additions & 4 deletions src/common/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* @packageDocumentation
*/

import { isArray, isFunction, isInjectable, isNull, isObject, isPromise, isString, isUndefined } from './predicates';
import { Rejection } from '../transition/rejectFactory';
import { identity, IInjectable, pushR, tail } from './common';
import { pattern, val } from './hof';
import { isArray, isFunction, isInjectable, isNull, isObject, isPromise, isString, isUndefined } from './predicates.js';
import { Rejection } from '../transition/rejectFactory.js';
import { identity, IInjectable, pushR, tail } from './common.js';
import { pattern, val } from './hof.js';

/**
* Returns a string shortened to a maximum length
Expand Down
26 changes: 13 additions & 13 deletions src/common/trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@
*
* @packageDocumentation
*/
import { parse } from '../common/hof';
import { isNumber } from '../common/predicates';
import { Transition } from '../transition/transition';
import { ViewTuple } from '../view';
import { ActiveUIView, ViewConfig, ViewContext } from '../view/interface';
import { stringify, functionToString, maxLength, padString } from './strings';
import { safeConsole } from './safeConsole';
import { Resolvable } from '../resolve/resolvable';
import { PathNode } from '../path/pathNode';
import { PolicyWhen } from '../resolve/interface';
import { TransitionHook } from '../transition/transitionHook';
import { HookResult } from '../transition/interface';
import { StateObject } from '../state/stateObject';
import { parse } from '../common/hof.js';
import { isNumber } from '../common/predicates.js';
import { Transition } from '../transition/transition.js';
import { ViewTuple } from '../view/index.js';
import { ActiveUIView, ViewConfig, ViewContext } from '../view/interface.js';
import { stringify, functionToString, maxLength, padString } from './strings.js';
import { safeConsole } from './safeConsole.js';
import { Resolvable } from '../resolve/resolvable.js';
import { PathNode } from '../path/pathNode.js';
import { PolicyWhen } from '../resolve/interface.js';
import { TransitionHook } from '../transition/transitionHook.js';
import { HookResult } from '../transition/interface.js';
import { StateObject } from '../state/stateObject.js';

function uiViewString(uiview: ActiveUIView) {
if (!uiview) return 'ui-view (defunct)';
Expand Down
12 changes: 6 additions & 6 deletions src/globals.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { StateParams } from './params/stateParams';
import { StateDeclaration } from './state/interface';
import { StateObject } from './state/stateObject';
import { Transition } from './transition/transition';
import { Queue } from './common/queue';
import { Disposable } from './interface';
import { StateParams } from './params/stateParams.js';
import { StateDeclaration } from './state/interface.js';
import { StateObject } from './state/stateObject.js';
import { Transition } from './transition/transition.js';
import { Queue } from './common/queue.js';
import { Disposable } from './interface.js';

/**
* Global router state
Expand Down
12 changes: 6 additions & 6 deletions src/hooks/coreResolvables.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Transition } from '../transition/transition';
import { UIRouter } from '../router';
import { TransitionService } from '../transition/transitionService';
import { Resolvable } from '../resolve';
import { inArray, uniqR, unnestR, values } from '../common';
import { PathNode } from '../path';
import { Transition } from '../transition/transition.js';
import { UIRouter } from '../router.js';
import { TransitionService } from '../transition/transitionService.js';
import { Resolvable } from '../resolve/index.js';
import { inArray, uniqR, unnestR, values } from '../common/index.js';
import { PathNode } from '../path/index.js';

function addCoreResolvables(trans: Transition) {
trans.addResolvable(Resolvable.fromData(UIRouter, trans.router), '');
Expand Down
8 changes: 4 additions & 4 deletions src/hooks/ignoredTransition.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { trace } from '../common/trace';
import { Rejection } from '../transition/rejectFactory';
import { TransitionService } from '../transition/transitionService';
import { Transition } from '../transition/transition';
import { trace } from '../common/trace.js';
import { Rejection } from '../transition/rejectFactory.js';
import { TransitionService } from '../transition/transitionService.js';
import { Transition } from '../transition/transition.js';

/**
* A [[TransitionHookFn]] that skips a transition if it should be ignored
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/invalidTransition.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TransitionService } from '../transition/transitionService';
import { Transition } from '../transition/transition';
import { TransitionService } from '../transition/transitionService.js';
import { Transition } from '../transition/transition.js';

/**
* A [[TransitionHookFn]] that rejects the Transition if it is invalid
Expand Down
12 changes: 6 additions & 6 deletions src/hooks/lazyLoad.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Transition } from '../transition/transition';
import { TransitionService } from '../transition/transitionService';
import { TransitionHookFn } from '../transition/interface';
import { StateDeclaration, LazyLoadResult } from '../state/interface';
import { services } from '../common/coreservices';
import { StateRule } from '../url/interface';
import { Transition } from '../transition/transition.js';
import { TransitionService } from '../transition/transitionService.js';
import { TransitionHookFn } from '../transition/interface.js';
import { StateDeclaration, LazyLoadResult } from '../state/interface.js';
import { services } from '../common/coreservices.js';
import { StateRule } from '../url/interface.js';

/**
* A [[TransitionHookFn]] that performs lazy loading
Expand Down
10 changes: 5 additions & 5 deletions src/hooks/onEnterExitRetain.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { TransitionStateHookFn } from '../transition/interface';
import { Transition } from '../transition/transition';
import { TransitionService } from '../transition/transitionService';
import { StateDeclaration } from '../state/interface';
import { StateObject } from '../state/stateObject';
import { TransitionStateHookFn } from '../transition/interface.js';
import { Transition } from '../transition/transition.js';
import { TransitionService } from '../transition/transitionService.js';
import { StateDeclaration } from '../state/interface.js';
import { StateObject } from '../state/stateObject.js';

/**
* A factory which creates an onEnter, onExit or onRetain transition hook function
Expand Down
12 changes: 6 additions & 6 deletions src/hooks/redirectTo.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { isString, isFunction } from '../common/predicates';
import { Transition } from '../transition/transition';
import { services } from '../common/coreservices';
import { TargetState } from '../state/targetState';
import { TransitionService } from '../transition/transitionService';
import { TransitionHookFn } from '../transition/interface';
import { isString, isFunction } from '../common/predicates.js';
import { Transition } from '../transition/transition.js';
import { services } from '../common/coreservices.js';
import { TargetState } from '../state/targetState.js';
import { TransitionService } from '../transition/transitionService.js';
import { TransitionHookFn } from '../transition/interface.js';

/**
* A [[TransitionHookFn]] that redirects to a different state or params
Expand Down
14 changes: 7 additions & 7 deletions src/hooks/resolve.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { noop } from '../common/common';
import { Transition } from '../transition/transition';
import { ResolveContext } from '../resolve/resolveContext';
import { TransitionStateHookFn, TransitionHookFn } from '../transition/interface';
import { TransitionService } from '../transition/transitionService';
import { val } from '../common/hof';
import { StateDeclaration } from '../state/interface';
import { noop } from '../common/common.js';
import { Transition } from '../transition/transition.js';
import { ResolveContext } from '../resolve/resolveContext.js';
import { TransitionStateHookFn, TransitionHookFn } from '../transition/interface.js';
import { TransitionService } from '../transition/transitionService.js';
import { val } from '../common/hof.js';
import { StateDeclaration } from '../state/interface.js';

export const RESOLVE_HOOK_PRIORITY = 1000;

Expand Down
6 changes: 3 additions & 3 deletions src/hooks/updateGlobals.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Transition } from '../transition/transition';
import { copy } from '../common/common';
import { TransitionService } from '../transition/transitionService';
import { Transition } from '../transition/transition.js';
import { copy } from '../common/common.js';
import { TransitionService } from '../transition/transitionService.js';

/**
* A [[TransitionHookFn]] which updates global UI-Router state
Expand Down
10 changes: 5 additions & 5 deletions src/hooks/url.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { UrlRouter } from '../url/urlRouter';
import { StateService } from '../state/stateService';
import { Transition } from '../transition/transition';
import { TransitionHookFn } from '../transition/interface';
import { TransitionService } from '../transition/transitionService';
import { UrlRouter } from '../url/urlRouter.js';
import { StateService } from '../state/stateService.js';
import { Transition } from '../transition/transition.js';
import { TransitionHookFn } from '../transition/interface.js';
import { TransitionService } from '../transition/transitionService.js';

/**
* A [[TransitionHookFn]] which updates the URL after a successful transition
Expand Down
14 changes: 7 additions & 7 deletions src/hooks/views.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { noop } from '../common/common';
import { services } from '../common/coreservices';
import { Transition } from '../transition/transition';
import { ViewService } from '../view/view';
import { ViewConfig } from '../view/interface';
import { TransitionHookFn } from '../transition/interface';
import { TransitionService } from '../transition/transitionService';
import { noop } from '../common/common.js';
import { services } from '../common/coreservices.js';
import { Transition } from '../transition/transition.js';
import { ViewService } from '../view/view.js';
import { ViewConfig } from '../view/interface.js';
import { TransitionHookFn } from '../transition/interface.js';
import { TransitionService } from '../transition/transitionService.js';

/**
* A [[TransitionHookFn]] which waits for the views to load
Expand Down
24 changes: 12 additions & 12 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export * from './common/index';
export * from './params/index';
export * from './path/index';
export * from './resolve/index';
export * from './state/index';
export * from './transition/index';
export * from './url/index';
export * from './view/index';
export * from './globals';
export * from './common/index.js';
export * from './params/index.js';
export * from './path/index.js';
export * from './resolve/index.js';
export * from './state/index.js';
export * from './transition/index.js';
export * from './url/index.js';
export * from './view/index.js';
export * from './globals.js';

export * from './router';
export * from './vanilla';
export * from './interface';
export * from './router.js';
export * from './vanilla.js';
export * from './interface.js';
4 changes: 2 additions & 2 deletions src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* @packageDocumentation
*/
// Need to import or export at least one concrete something
import { noop } from './common/common';
import { UIRouter } from './router';
import { noop } from './common/common.js';
import { UIRouter } from './router.js';

/**
* An interface for getting values from dependency injection.
Expand Down
10 changes: 5 additions & 5 deletions src/params/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*
* @packageDocumentation @preferred
*/
export * from './interface';
export * from './param';
export * from './paramTypes';
export * from './stateParams';
export * from './paramType';
export * from './interface.js';
export * from './param.js';
export * from './paramTypes.js';
export * from './stateParams.js';
export * from './paramType.js';
2 changes: 1 addition & 1 deletion src/params/interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ParamType } from './paramType';
import { ParamType } from './paramType.js';

/**
* Parameter values
Expand Down
18 changes: 9 additions & 9 deletions src/params/param.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { extend, filter, map, allTrueR, find } from '../common/common';
import { prop } from '../common/hof';
import { isInjectable, isDefined, isString, isArray, isUndefined } from '../common/predicates';
import { RawParams, ParamDeclaration } from '../params/interface';
import { services } from '../common/coreservices';
import { ParamType } from './paramType';
import { ParamTypes } from './paramTypes';
import { StateDeclaration } from '../state';
import { UrlConfig } from '../url';
import { extend, filter, map, allTrueR, find } from '../common/common.js';
import { prop } from '../common/hof.js';
import { isInjectable, isDefined, isString, isArray, isUndefined } from '../common/predicates.js';
import { RawParams, ParamDeclaration } from '../params/interface.js';
import { services } from '../common/coreservices.js';
import { ParamType } from './paramType.js';
import { ParamTypes } from './paramTypes.js';
import { StateDeclaration } from '../state/index.js';
import { UrlConfig } from '../url/index.js';

const hasOwn = Object.prototype.hasOwnProperty;

Expand Down
6 changes: 3 additions & 3 deletions src/params/paramType.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { extend, filter, map } from '../common/common';
import { isArray, isDefined } from '../common/predicates';
import { ParamTypeDefinition } from './interface';
import { extend, filter, map } from '../common/common.js';
import { isArray, isDefined } from '../common/predicates.js';
import { ParamTypeDefinition } from './interface.js';

/**
* An internal class which implements [[ParamTypeDefinition]].
Expand Down
12 changes: 6 additions & 6 deletions src/params/paramTypes.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { fromJson, toJson, identity, equals, inherit, map, extend, pick } from '../common/common';
import { isDefined, isNullOrUndefined } from '../common/predicates';
import { is } from '../common/hof';
import { services } from '../common/coreservices';
import { ParamType } from './paramType';
import { ParamTypeDefinition } from './interface';
import { fromJson, toJson, identity, equals, inherit, map, extend, pick } from '../common/common.js';
import { isDefined, isNullOrUndefined } from '../common/predicates.js';
import { is } from '../common/hof.js';
import { services } from '../common/coreservices.js';
import { ParamType } from './paramType.js';
import { ParamTypeDefinition } from './interface.js';

/**
* A registry for parameter types.
Expand Down
Loading