Add a minimum password length validator

Add a minimum password length validator

--- packages/shared/lib/helpers/formValidators.ts
+++ packages/shared/lib/helpers/formValidators.ts
@@ -4,6 +4,10 @@

 export const requiredValidator = (value: any) =>
     value === undefined || value === null || value?.trim?.() === '' ? c('Error').t`This field is required` : '';
+export const minLengthValidator = (value: string, minimumLength: number) =>
+    value.length < minimumLength ? c('Error').t`This field requires a minimum of ${minimumLength} characters.` : '';
 export const emailValidator = (value: string) => (!validateEmailAddress(value) ? c('Error').t`Email is not valid` : '');
 export const numberValidator = (value: string) => (!isNumber(value) ? c('Error').t`Not a valid number` : '');
 export const confirmPasswordValidator = (a: string, b: string) => (a !== b ? c('Error').t`Passwords do not match` : '');
+export const passwordLengthValidator = (a: string, length = 8) =>
+    a.length < length ? c('Error').t`Password should have at least ${length} characters` : '';

<|original_code|>
import { c } from 'ttag';
import { validateEmailAddress } from './email';
import { isNumber } from './validators';

export const requiredValidator = (value: any) =>
    value === undefined || value === null || value?.trim?.() === '' ? c('Error').t`This field is required` : '';
export const emailValidator = (value: string) => (!validateEmailAddress(value) ? c('Error').t`Email is not valid` : '');
export const numberValidator = (value: string) => (!isNumber(value) ? c('Error').t`Not a valid number` : '');
export const confirmPasswordValidator = (a: string, b: string) => (a !== b ? c('Error').t`Passwords do not match` : '');

<|edits_diff|>
--- packages/shared/lib/helpers/formValidators.ts
+++ packages/shared/lib/helpers/formValidators.ts
@@ -4,6 +4,8 @@

 export const requiredValidator = (value: any) =>
     value === undefined || value === null || value?.trim?.() === '' ? c('Error').t`This field is required` : '';
+export const minLengthValidator = (value: string, minimumLength: number) =>
+    value.length < minimumLength ? c('Error').t`This field requires a minimum of ${minimumLength} characters.` : '';
 export const emailValidator = (value: string) => (!validateEmailAddress(value) ? c('Error').t`Email is not valid` : '');
 export const numberValidator = (value: string) => (!isNumber(value) ? c('Error').t`Not a valid number` : '');
 export const confirmPasswordValidator = (a: string, b: string) => (a !== b ? c('Error').t`Passwords do not match` : '');
<|current_version|>
import { c } from 'ttag';
import { validateEmailAddress } from './email';
import { isNumber } from './validators';

export const requiredValidator = (value: any) =>
    value === undefined || value === null || value?.trim?.() === '' ? c('Error').t`This field is required` : '';
export const minLengthValidator = (value: string, minimumLength: number) =>
    value.length < minimumLength ? c('Error').t`This field requires a minimum of ${minimumLength} characters.` : '';
export const emailValidator = (value: string) => (!validateEmailAddress(value) ? c('Error').t`Email is not valid` : '');
export const numberValidator = (value: string) => (!isNumber(value) ? c('Error').t`Not a valid number` : '');
export const confirmPasswordValidator = (a: string, b: string) => (a !== b ? c('Error').t`Passwords do not match` : '');

<|next_version|>
import { c } from 'ttag';
import { validateEmailAddress } from './email';
import { isNumber } from './validators';

export const requiredValidator = (value: any) =>
    value === undefined || value === null || value?.trim?.() === '' ? c('Error').t`This field is required` : '';
export const minLengthValidator = (value: string, minimumLength: number) =>
    value.length < minimumLength ? c('Error').t`This field requires a minimum of ${minimumLength} characters.` : '';
export const emailValidator = (value: string) => (!validateEmailAddress(value) ? c('Error').t`Email is not valid` : '');
export const numberValidator = (value: string) => (!isNumber(value) ? c('Error').t`Not a valid number` : '');
export const confirmPasswordValidator = (a: string, b: string) => (a !== b ? c('Error').t`Passwords do not match` : '');
export const passwordLengthValidator = (a: string, length = 8) =>
    a.length < length ? c('Error').t`Password should have at least ${length} characters` : '';


Fix track event directive not imported into broadcast card

--- src/app/components/broadcast-card/broadcast-card.ts
+++ src/app/components/broadcast-card/broadcast-card.ts
@@ -1,4 +1,5 @@
 import View from '!view!./broadcast-card.html?style=./broadcast-card.styl';
+import { AppTrackEvent } from 'game-jolt-frontend-lib/components/analytics/track-event.directive.vue';
 import { AppCard } from 'game-jolt-frontend-lib/components/card/card';
 import { FiresidePost } from 'game-jolt-frontend-lib/components/fireside/post/post-model';
 import Vue from 'vue';
@@ -9,6 +10,9 @@
 	components: {
 		AppCard,
 	},
+	directives: {
+		AppTrackEvent,
+	},
 })
 export class AppBroadcastCard extends Vue {
 	@Prop(FiresidePost)

<|original_code|>
import View from '!view!./broadcast-card.html?style=./broadcast-card.styl';
import { AppCard } from 'game-jolt-frontend-lib/components/card/card';
import { FiresidePost } from 'game-jolt-frontend-lib/components/fireside/post/post-model';
import Vue from 'vue';
import { Component, Prop } from 'vue-property-decorator';

@View
@Component({
	components: {
		AppCard,
	},
})
export class AppBroadcastCard extends Vue {
	@Prop(FiresidePost)
	post!: FiresidePost;
}

<|edits_diff|>
--- src/app/components/broadcast-card/broadcast-card.ts
+++ src/app/components/broadcast-card/broadcast-card.ts
@@ -1,4 +1,5 @@
 import View from '!view!./broadcast-card.html?style=./broadcast-card.styl';
+import { AppTrackEvent } from 'game-jolt-frontend-lib/components/analytics/track-event.directive.vue';
 import { AppCard } from 'game-jolt-frontend-lib/components/card/card';
 import { FiresidePost } from 'game-jolt-frontend-lib/components/fireside/post/post-model';
 import Vue from 'vue';
<|current_version|>
import View from '!view!./broadcast-card.html?style=./broadcast-card.styl';
import { AppTrackEvent } from 'game-jolt-frontend-lib/components/analytics/track-event.directive.vue';
import { AppCard } from 'game-jolt-frontend-lib/components/card/card';
import { FiresidePost } from 'game-jolt-frontend-lib/components/fireside/post/post-model';
import Vue from 'vue';
import { Component, Prop } from 'vue-property-decorator';

@View
@Component({
	components: {
		AppCard,
	},
})
export class AppBroadcastCard extends Vue {
	@Prop(FiresidePost)
	post!: FiresidePost;
}

<|next_version|>
import View from '!view!./broadcast-card.html?style=./broadcast-card.styl';
import { AppTrackEvent } from 'game-jolt-frontend-lib/components/analytics/track-event.directive.vue';
import { AppCard } from 'game-jolt-frontend-lib/components/card/card';
import { FiresidePost } from 'game-jolt-frontend-lib/components/fireside/post/post-model';
import Vue from 'vue';
import { Component, Prop } from 'vue-property-decorator';

@View
@Component({
	components: {
		AppCard,
	},
	directives: {
		AppTrackEvent,
	},
})
export class AppBroadcastCard extends Vue {
	@Prop(FiresidePost)
	post!: FiresidePost;
}


Include the mysql Ace editor mode

[editor] Include the mysql Ace editor mode

--- desktop/core/src/desktop/js/ext/aceHelper.ts
+++ desktop/core/src/desktop/js/ext/aceHelper.ts
@@ -9,6 +9,7 @@
 import 'ext/ace/mode-hive';
 import 'ext/ace/mode-impala';
 import 'ext/ace/mode-ksql';
+import 'ext/ace/mode-mysql';
 import 'ext/ace/mode-phoenix';
 import 'ext/ace/mode-presto';
 import 'ext/ace/mode-pgsql'
@@ -21,6 +22,7 @@
 import 'ext/ace/snippets/hive';
 import 'ext/ace/snippets/impala';
 import 'ext/ace/snippets/ksql';
+import 'ext/ace/snippets/mysql';
 import 'ext/ace/snippets/phoenix';
 import 'ext/ace/snippets/presto';
 import 'ext/ace/snippets/pgsql';

<|original_code|>
import 'ext/ace/ace'
import 'ext/ace/ext-language_tools';
import 'ext/ace/ext-searchbox';
import 'ext/ace/ext-settings_menu';
import 'ext/ace/mode-bigquery';
import 'ext/ace/mode-druid';
import 'ext/ace/mode-elasticsearch';
import 'ext/ace/mode-flink';
import 'ext/ace/mode-hive';
import 'ext/ace/mode-impala';
import 'ext/ace/mode-ksql';
import 'ext/ace/mode-phoenix';
import 'ext/ace/mode-presto';
import 'ext/ace/mode-pgsql'
import 'ext/ace/mode-sql';
import 'ext/ace/mode-text';
import 'ext/ace/snippets/bigquery';
import 'ext/ace/snippets/druid';
import 'ext/ace/snippets/elasticsearch';
import 'ext/ace/snippets/flink';
import 'ext/ace/snippets/hive';
import 'ext/ace/snippets/impala';
import 'ext/ace/snippets/ksql';
import 'ext/ace/snippets/phoenix';
import 'ext/ace/snippets/presto';
import 'ext/ace/snippets/pgsql';
import 'ext/ace/snippets/sql';
import 'ext/ace/snippets/text';
import 'ext/ace/theme-hue';
import 'ext/ace/theme-hue_dark';
import './aceExtensions';

export default (window as any).ace;

<|edits_diff|>
--- desktop/core/src/desktop/js/ext/aceHelper.ts
+++ desktop/core/src/desktop/js/ext/aceHelper.ts
@@ -9,6 +9,7 @@
 import 'ext/ace/mode-hive';
 import 'ext/ace/mode-impala';
 import 'ext/ace/mode-ksql';
+import 'ext/ace/mode-mysql';
 import 'ext/ace/mode-phoenix';
 import 'ext/ace/mode-presto';
 import 'ext/ace/mode-pgsql'
<|current_version|>
import 'ext/ace/ace'
import 'ext/ace/ext-language_tools';
import 'ext/ace/ext-searchbox';
import 'ext/ace/ext-settings_menu';
import 'ext/ace/mode-bigquery';
import 'ext/ace/mode-druid';
import 'ext/ace/mode-elasticsearch';
import 'ext/ace/mode-flink';
import 'ext/ace/mode-hive';
import 'ext/ace/mode-impala';
import 'ext/ace/mode-ksql';
import 'ext/ace/mode-mysql';
import 'ext/ace/mode-phoenix';
import 'ext/ace/mode-presto';
import 'ext/ace/mode-pgsql'
import 'ext/ace/mode-sql';
import 'ext/ace/mode-text';
import 'ext/ace/snippets/bigquery';
import 'ext/ace/snippets/druid';
import 'ext/ace/snippets/elasticsearch';
import 'ext/ace/snippets/flink';
import 'ext/ace/snippets/hive';
import 'ext/ace/snippets/impala';
import 'ext/ace/snippets/ksql';
import 'ext/ace/snippets/phoenix';
import 'ext/ace/snippets/presto';
import 'ext/ace/snippets/pgsql';
import 'ext/ace/snippets/sql';
import 'ext/ace/snippets/text';
import 'ext/ace/theme-hue';
import 'ext/ace/theme-hue_dark';
import './aceExtensions';

export default (window as any).ace;

<|next_version|>
import 'ext/ace/ace'
import 'ext/ace/ext-language_tools';
import 'ext/ace/ext-searchbox';
import 'ext/ace/ext-settings_menu';
import 'ext/ace/mode-bigquery';
import 'ext/ace/mode-druid';
import 'ext/ace/mode-elasticsearch';
import 'ext/ace/mode-flink';
import 'ext/ace/mode-hive';
import 'ext/ace/mode-impala';
import 'ext/ace/mode-ksql';
import 'ext/ace/mode-mysql';
import 'ext/ace/mode-phoenix';
import 'ext/ace/mode-presto';
import 'ext/ace/mode-pgsql'
import 'ext/ace/mode-sql';
import 'ext/ace/mode-text';
import 'ext/ace/snippets/bigquery';
import 'ext/ace/snippets/druid';
import 'ext/ace/snippets/elasticsearch';
import 'ext/ace/snippets/flink';
import 'ext/ace/snippets/hive';
import 'ext/ace/snippets/impala';
import 'ext/ace/snippets/ksql';
import 'ext/ace/snippets/mysql';
import 'ext/ace/snippets/phoenix';
import 'ext/ace/snippets/presto';
import 'ext/ace/snippets/pgsql';
import 'ext/ace/snippets/sql';
import 'ext/ace/snippets/text';
import 'ext/ace/theme-hue';
import 'ext/ace/theme-hue_dark';
import './aceExtensions';

export default (window as any).ace;


Add props to support repo removal confirmation

--- app/src/ui/preferences/advanced.tsx
+++ app/src/ui/preferences/advanced.tsx
@@ -5,7 +5,9 @@

 interface IAdvancedPreferencesProps {
   readonly isOptedOut: boolean,
+  readonly confirmRepoRemoval: boolean,
   readonly onOptOutSet: (checked: boolean) => void
+  readonly onConfirmRepoRemovalSet: (checked: boolean) => void
 }

 interface IAdvancedPreferencesState {

<|original_code|>
import * as React from 'react'
import { DialogContent } from '../dialog'
import { Checkbox, CheckboxValue } from '../lib/checkbox'
import { LinkButton } from '../lib/link-button'

interface IAdvancedPreferencesProps {
  readonly isOptedOut: boolean,
  readonly onOptOutSet: (checked: boolean) => void
}

interface IAdvancedPreferencesState {
  readonly reportingOptOut: boolean
}

const SamplesURL = 'https://desktop.github.com/samples/'

export class Advanced extends React.Component<IAdvancedPreferencesProps, IAdvancedPreferencesState> {
  public constructor(props: IAdvancedPreferencesProps) {
    super(props)

    this.state = {
      reportingOptOut: this.props.isOptedOut,
    }
  }

  private onChange = (event: React.FormEvent<HTMLInputElement>) => {
    const value = !event.currentTarget.checked

    this.setState({ reportingOptOut: value })
    this.props.onOptOutSet(value)
  }

  public render() {
    return (
      <DialogContent>

          Would you like to help us improve GitHub Desktop by periodically submitting <LinkButton uri={SamplesURL}>anonymous usage data</LinkButton>?

        <Checkbox
          label='Yes, submit anonymized usage data'
          value={this.state.reportingOptOut ? CheckboxValue.Off : CheckboxValue.On}
          onChange={this.onChange} />
      </DialogContent>
    )
  }
}

<|edits_diff|>
--- app/src/ui/preferences/advanced.tsx
+++ app/src/ui/preferences/advanced.tsx
@@ -5,6 +5,7 @@

 interface IAdvancedPreferencesProps {
   readonly isOptedOut: boolean,
+  readonly confirmRepoRemoval: boolean,
   readonly onOptOutSet: (checked: boolean) => void
 }

<|current_version|>
import * as React from 'react'
import { DialogContent } from '../dialog'
import { Checkbox, CheckboxValue } from '../lib/checkbox'
import { LinkButton } from '../lib/link-button'

interface IAdvancedPreferencesProps {
  readonly isOptedOut: boolean,
  readonly confirmRepoRemoval: boolean,
  readonly onOptOutSet: (checked: boolean) => void
}

interface IAdvancedPreferencesState {
  readonly reportingOptOut: boolean
}

const SamplesURL = 'https://desktop.github.com/samples/'

export class Advanced extends React.Component<IAdvancedPreferencesProps, IAdvancedPreferencesState> {
  public constructor(props: IAdvancedPreferencesProps) {
    super(props)

    this.state = {
      reportingOptOut: this.props.isOptedOut,
    }
  }

  private onChange = (event: React.FormEvent<HTMLInputElement>) => {
    const value = !event.currentTarget.checked

    this.setState({ reportingOptOut: value })
    this.props.onOptOutSet(value)
  }

  public render() {
    return (
      <DialogContent>

          Would you like to help us improve GitHub Desktop by periodically submitting <LinkButton uri={SamplesURL}>anonymous usage data</LinkButton>?

        <Checkbox
          label='Yes, submit anonymized usage data'
          value={this.state.reportingOptOut ? CheckboxValue.Off : CheckboxValue.On}
          onChange={this.onChange} />
      </DialogContent>
    )
  }
}

<|next_version|>
import * as React from 'react'
import { DialogContent } from '../dialog'
import { Checkbox, CheckboxValue } from '../lib/checkbox'
import { LinkButton } from '../lib/link-button'

interface IAdvancedPreferencesProps {
  readonly isOptedOut: boolean,
  readonly confirmRepoRemoval: boolean,
  readonly onOptOutSet: (checked: boolean) => void
  readonly onConfirmRepoRemovalSet: (checked: boolean) => void
}

interface IAdvancedPreferencesState {
  readonly reportingOptOut: boolean
}

const SamplesURL = 'https://desktop.github.com/samples/'

export class Advanced extends React.Component<IAdvancedPreferencesProps, IAdvancedPreferencesState> {
  public constructor(props: IAdvancedPreferencesProps) {
    super(props)

    this.state = {
      reportingOptOut: this.props.isOptedOut,
    }
  }

  private onChange = (event: React.FormEvent<HTMLInputElement>) => {
    const value = !event.currentTarget.checked

    this.setState({ reportingOptOut: value })
    this.props.onOptOutSet(value)
  }

  public render() {
    return (
      <DialogContent>

          Would you like to help us improve GitHub Desktop by periodically submitting <LinkButton uri={SamplesURL}>anonymous usage data</LinkButton>?

        <Checkbox
          label='Yes, submit anonymized usage data'
          value={this.state.reportingOptOut ? CheckboxValue.Off : CheckboxValue.On}
          onChange={this.onChange} />
      </DialogContent>
    )
  }
}


Add route to access swagger doc

Add route to access swagger doc

--- src/app.ts
+++ src/app.ts
@@ -1,5 +1,6 @@
 import express from 'express';
 import bodyParser from 'body-parser';
+import swaggerUi from 'swagger-ui-express';
 import mailRouter from './routes/mail';
 import pushRouter from './routes/push';

@@ -16,6 +17,8 @@
   res.send('hello world!');
 });

+app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(require('../swagger.json')));
+
 app.listen(port, () => {
   console.log(`Listening at http://localhost:${port}/`);
 });

<|original_code|>
import express from 'express';
import bodyParser from 'body-parser';
import mailRouter from './routes/mail';
import pushRouter from './routes/push';

const app: express.Application = express();
const port: string = process.env.PORT || '3000';

app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());

app.use('/mails', mailRouter);
app.use('/push', pushRouter);

app.get('/', function (req, res) {
  res.send('hello world!');
});

app.listen(port, () => {
  console.log(`Listening at http://localhost:${port}/`);
});

<|edits_diff|>
--- src/app.ts
+++ src/app.ts
@@ -1,5 +1,6 @@
 import express from 'express';
 import bodyParser from 'body-parser';
+import swaggerUi from 'swagger-ui-express';
 import mailRouter from './routes/mail';
 import pushRouter from './routes/push';

<|current_version|>
import express from 'express';
import bodyParser from 'body-parser';
import swaggerUi from 'swagger-ui-express';
import mailRouter from './routes/mail';
import pushRouter from './routes/push';

const app: express.Application = express();
const port: string = process.env.PORT || '3000';

app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());

app.use('/mails', mailRouter);
app.use('/push', pushRouter);

app.get('/', function (req, res) {
  res.send('hello world!');
});

app.listen(port, () => {
  console.log(`Listening at http://localhost:${port}/`);
});

<|next_version|>
import express from 'express';
import bodyParser from 'body-parser';
import swaggerUi from 'swagger-ui-express';
import mailRouter from './routes/mail';
import pushRouter from './routes/push';

const app: express.Application = express();
const port: string = process.env.PORT || '3000';

app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());

app.use('/mails', mailRouter);
app.use('/push', pushRouter);

app.get('/', function (req, res) {
  res.send('hello world!');
});

app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(require('../swagger.json')));

app.listen(port, () => {
  console.log(`Listening at http://localhost:${port}/`);
});


Fix add LogService to providers

Fix add LogService to providers

--- src/index.ts
+++ src/index.ts
@@ -1,6 +1,7 @@
 import { ConfigService } from './config.service';
 import { NgModule, ModuleWithProviders } from '@angular/core';
 import { CommonModule } from '@angular/common';
+import { LogService } from './log.service';

 export * from './log.service';

@@ -19,6 +20,9 @@
   ],
   exports: [

+  ],
+  providers: [
+    LogService
   ]
 })
 export class LogModule {

<|original_code|>
import { ConfigService } from './config.service';
import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';

export * from './log.service';

export function fatoryConfig(isProduction: boolean): ConfigService {
  return {
    isProduction: isProduction
  };
}

@NgModule({
  imports: [
    CommonModule
  ],
  declarations: [

  ],
  exports: [

  ]
})
export class LogModule {
  static forRoot(isProduction: boolean): ModuleWithProviders {
    return {
      ngModule: LogModule,
      providers: [{ provide: ConfigService, useValue: fatoryConfig(isProduction) }]
    };
  }
}

<|edits_diff|>
--- src/index.ts
+++ src/index.ts
@@ -1,6 +1,7 @@
 import { ConfigService } from './config.service';
 import { NgModule, ModuleWithProviders } from '@angular/core';
 import { CommonModule } from '@angular/common';
+import { LogService } from './log.service';

 export * from './log.service';

<|current_version|>
import { ConfigService } from './config.service';
import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LogService } from './log.service';

export * from './log.service';

export function fatoryConfig(isProduction: boolean): ConfigService {
  return {
    isProduction: isProduction
  };
}

@NgModule({
  imports: [
    CommonModule
  ],
  declarations: [

  ],
  exports: [

  ]
})
export class LogModule {
  static forRoot(isProduction: boolean): ModuleWithProviders {
    return {
      ngModule: LogModule,
      providers: [{ provide: ConfigService, useValue: fatoryConfig(isProduction) }]
    };
  }
}

<|next_version|>
import { ConfigService } from './config.service';
import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LogService } from './log.service';

export * from './log.service';

export function fatoryConfig(isProduction: boolean): ConfigService {
  return {
    isProduction: isProduction
  };
}

@NgModule({
  imports: [
    CommonModule
  ],
  declarations: [

  ],
  exports: [

  ],
  providers: [
    LogService
  ]
})
export class LogModule {
  static forRoot(isProduction: boolean): ModuleWithProviders {
    return {
      ngModule: LogModule,
      providers: [{ provide: ConfigService, useValue: fatoryConfig(isProduction) }]
    };
  }
}


Add Documentation to Parser Types

docs(type): Add Documentation to Parser Types

Give the documentation of ParseInput, ParseFn, ParseError and parse some
love ❤

--- src/parsers/index.ts
+++ src/parsers/index.ts
@@ -1,6 +1,17 @@
+/**
+ * A `ParseInput` can be transformed using a `ParseFn`.
+ */
 export type ParserInput = any;
+
+/**
+ * A `ParseFn` transforms a `ParseInput` to type `T`. It must throw a `ParseError` if the transformation can not be
+ * done.
+ */
 export type ParseFn<T> = (x: ParserInput) => T;

+/**
+ * A `ParseFn` throws a `ParseError` when the `ParseInput` cannot be transformed to the parsers target type.
+ */
 export class ParserError extends Error {
   constructor(
     public readonly expected: string,
@@ -10,6 +21,9 @@
   }
 }

+/**
+ * A quick way to apply a `ParseFn` to a given `ParseInput`.
+ */
 export function parse<T>(input: ParserInput, parser: ParseFn<T>): T {
   return parser(input);
 }

<|original_code|>
export type ParserInput = any;
export type ParseFn<T> = (x: ParserInput) => T;

export class ParserError extends Error {
  constructor(
    public readonly expected: string,
    public readonly found: string
  ) {
    super(`Expected ${expected} but found ${found}`);
  }
}

export function parse<T>(input: ParserInput, parser: ParseFn<T>): T {
  return parser(input);
}

<|edits_diff|>
--- src/parsers/index.ts
+++ src/parsers/index.ts
@@ -1,6 +1,17 @@
+/**
+ * A `ParseInput` can be transformed using a `ParseFn`.
+ */
 export type ParserInput = any;
+
+/**
+ * A `ParseFn` transforms a `ParseInput` to type `T`. It must throw a `ParseError` if the transformation can not be
+ * done.
+ */
 export type ParseFn<T> = (x: ParserInput) => T;

+/**
+ * A `ParseFn` throws a `ParseError` when the `ParseInput` cannot be transformed to the parsers target type.
+ */
 export class ParserError extends Error {
   constructor(
     public readonly expected: string,
<|current_version|>
/**
 * A `ParseInput` can be transformed using a `ParseFn`.
 */
export type ParserInput = any;

/**
 * A `ParseFn` transforms a `ParseInput` to type `T`. It must throw a `ParseError` if the transformation can not be
 * done.
 */
export type ParseFn<T> = (x: ParserInput) => T;

/**
 * A `ParseFn` throws a `ParseError` when the `ParseInput` cannot be transformed to the parsers target type.
 */
export class ParserError extends Error {
  constructor(
    public readonly expected: string,
    public readonly found: string
  ) {
    super(`Expected ${expected} but found ${found}`);
  }
}

export function parse<T>(input: ParserInput, parser: ParseFn<T>): T {
  return parser(input);
}

<|next_version|>
/**
 * A `ParseInput` can be transformed using a `ParseFn`.
 */
export type ParserInput = any;

/**
 * A `ParseFn` transforms a `ParseInput` to type `T`. It must throw a `ParseError` if the transformation can not be
 * done.
 */
export type ParseFn<T> = (x: ParserInput) => T;

/**
 * A `ParseFn` throws a `ParseError` when the `ParseInput` cannot be transformed to the parsers target type.
 */
export class ParserError extends Error {
  constructor(
    public readonly expected: string,
    public readonly found: string
  ) {
    super(`Expected ${expected} but found ${found}`);
  }
}

/**
 * A quick way to apply a `ParseFn` to a given `ParseInput`.
 */
export function parse<T>(input: ParserInput, parser: ParseFn<T>): T {
  return parser(input);
}


Add racer and team detail components to router

--- src/app/app.routes.ts
+++ src/app/app.routes.ts
@@ -6,6 +6,8 @@
 import { RacersComponent } from './racers';
 import { TeamsComponent } from './teams';
 import { DashboardComponent } from './dashboard';
+import { RacerDetailComponent } from './racer-detail';
+import { TeamDetailComponent } from './team-detail';

 import { DataResolver } from './app.resolver';

@@ -16,6 +18,8 @@
   { path: 'about', component: About },
   { path: 'racers', component: RacersComponent },
   { path: 'teams', component: TeamsComponent },
+  { path: 'racer/:id', component: RacerDetailComponent },
+  { path: 'team/:id', component: TeamDetailComponent },
   {
     path: 'detail', loadChildren: () => System.import('./+detail')
   },

<|original_code|>
import { Routes, RouterModule } from '@angular/router';
import { Home } from './home';
import { About } from './about';
import { NoContent } from './no-content';

import { RacersComponent } from './racers';
import { TeamsComponent } from './teams';
import { DashboardComponent } from './dashboard';

import { DataResolver } from './app.resolver';

export const ROUTES: Routes = [
  { path: '',      component: DashboardComponent },
  { path: 'home',  component: Home },
  { path: 'about', component: About },
  { path: 'racers', component: RacersComponent },
  { path: 'teams', component: TeamsComponent },
  {
    path: 'detail', loadChildren: () => System.import('./+detail')
  },
  { path: 'dashboard', component: DashboardComponent },
  { path: '**',    component: NoContent },
];

<|edits_diff|>
--- src/app/app.routes.ts
+++ src/app/app.routes.ts
@@ -6,6 +6,8 @@
 import { RacersComponent } from './racers';
 import { TeamsComponent } from './teams';
 import { DashboardComponent } from './dashboard';
+import { RacerDetailComponent } from './racer-detail';
+import { TeamDetailComponent } from './team-detail';

 import { DataResolver } from './app.resolver';

<|current_version|>
import { Routes, RouterModule } from '@angular/router';
import { Home } from './home';
import { About } from './about';
import { NoContent } from './no-content';

import { RacersComponent } from './racers';
import { TeamsComponent } from './teams';
import { DashboardComponent } from './dashboard';
import { RacerDetailComponent } from './racer-detail';
import { TeamDetailComponent } from './team-detail';

import { DataResolver } from './app.resolver';

export const ROUTES: Routes = [
  { path: '',      component: DashboardComponent },
  { path: 'home',  component: Home },
  { path: 'about', component: About },
  { path: 'racers', component: RacersComponent },
  { path: 'teams', component: TeamsComponent },
  {
    path: 'detail', loadChildren: () => System.import('./+detail')
  },
  { path: 'dashboard', component: DashboardComponent },
  { path: '**',    component: NoContent },
];

<|next_version|>
import { Routes, RouterModule } from '@angular/router';
import { Home } from './home';
import { About } from './about';
import { NoContent } from './no-content';

import { RacersComponent } from './racers';
import { TeamsComponent } from './teams';
import { DashboardComponent } from './dashboard';
import { RacerDetailComponent } from './racer-detail';
import { TeamDetailComponent } from './team-detail';

import { DataResolver } from './app.resolver';

export const ROUTES: Routes = [
  { path: '',      component: DashboardComponent },
  { path: 'home',  component: Home },
  { path: 'about', component: About },
  { path: 'racers', component: RacersComponent },
  { path: 'teams', component: TeamsComponent },
  { path: 'racer/:id', component: RacerDetailComponent },
  { path: 'team/:id', component: TeamDetailComponent },
  {
    path: 'detail', loadChildren: () => System.import('./+detail')
  },
  { path: 'dashboard', component: DashboardComponent },
  { path: '**',    component: NoContent },
];


Enable selecting derivative function in query builder

--- ui/src/shared/constants/queryBuilder.ts
+++ ui/src/shared/constants/queryBuilder.ts
@@ -1,3 +1,5 @@
+import {WINDOW_PERIOD} from 'src/shared/constants'
+
 export interface QueryFn {
   name: string
   flux: string
@@ -10,6 +12,11 @@
   {name: 'max', flux: '|> max()', aggregate: true},
   {name: 'min', flux: '|> min()', aggregate: true},
   {name: 'sum', flux: '|> sum()', aggregate: true},
+  {
+    name: 'derivative',
+    flux: `|> derivative(unit: ${WINDOW_PERIOD}, nonNegative: false)`,
+    aggregate: false,
+  },
   {name: 'distinct', flux: '|> distinct()', aggregate: false},
   {name: 'count', flux: '|> count()', aggregate: false},
   {name: 'increase', flux: '|> increase()', aggregate: false},

<|original_code|>
export interface QueryFn {
  name: string
  flux: string
  aggregate: boolean
}

export const FUNCTIONS: QueryFn[] = [
  {name: 'mean', flux: `|> mean()`, aggregate: true},
  {name: 'median', flux: '|> toFloat()\n  |> median()', aggregate: true},
  {name: 'max', flux: '|> max()', aggregate: true},
  {name: 'min', flux: '|> min()', aggregate: true},
  {name: 'sum', flux: '|> sum()', aggregate: true},
  {name: 'distinct', flux: '|> distinct()', aggregate: false},
  {name: 'count', flux: '|> count()', aggregate: false},
  {name: 'increase', flux: '|> increase()', aggregate: false},
  {name: 'skew', flux: '|> skew()', aggregate: false},
  {name: 'spread', flux: '|> spread()', aggregate: false},
  {name: 'stddev', flux: '|> stddev()', aggregate: true},
  {name: 'first', flux: '|> first()', aggregate: true},
  {name: 'last', flux: '|> last()', aggregate: true},
  {name: 'unique', flux: '|> unique()', aggregate: false},
  {name: 'sort', flux: '|> sort()', aggregate: false},
]

<|edits_diff|>
--- ui/src/shared/constants/queryBuilder.ts
+++ ui/src/shared/constants/queryBuilder.ts
@@ -1,3 +1,5 @@
+import {WINDOW_PERIOD} from 'src/shared/constants'
+
 export interface QueryFn {
   name: string
   flux: string
<|current_version|>
import {WINDOW_PERIOD} from 'src/shared/constants'

export interface QueryFn {
  name: string
  flux: string
  aggregate: boolean
}

export const FUNCTIONS: QueryFn[] = [
  {name: 'mean', flux: `|> mean()`, aggregate: true},
  {name: 'median', flux: '|> toFloat()\n  |> median()', aggregate: true},
  {name: 'max', flux: '|> max()', aggregate: true},
  {name: 'min', flux: '|> min()', aggregate: true},
  {name: 'sum', flux: '|> sum()', aggregate: true},
  {name: 'distinct', flux: '|> distinct()', aggregate: false},
  {name: 'count', flux: '|> count()', aggregate: false},
  {name: 'increase', flux: '|> increase()', aggregate: false},
  {name: 'skew', flux: '|> skew()', aggregate: false},
  {name: 'spread', flux: '|> spread()', aggregate: false},
  {name: 'stddev', flux: '|> stddev()', aggregate: true},
  {name: 'first', flux: '|> first()', aggregate: true},
  {name: 'last', flux: '|> last()', aggregate: true},
  {name: 'unique', flux: '|> unique()', aggregate: false},
  {name: 'sort', flux: '|> sort()', aggregate: false},
]

<|next_version|>
import {WINDOW_PERIOD} from 'src/shared/constants'

export interface QueryFn {
  name: string
  flux: string
  aggregate: boolean
}

export const FUNCTIONS: QueryFn[] = [
  {name: 'mean', flux: `|> mean()`, aggregate: true},
  {name: 'median', flux: '|> toFloat()\n  |> median()', aggregate: true},
  {name: 'max', flux: '|> max()', aggregate: true},
  {name: 'min', flux: '|> min()', aggregate: true},
  {name: 'sum', flux: '|> sum()', aggregate: true},
  {
    name: 'derivative',
    flux: `|> derivative(unit: ${WINDOW_PERIOD}, nonNegative: false)`,
    aggregate: false,
  },
  {name: 'distinct', flux: '|> distinct()', aggregate: false},
  {name: 'count', flux: '|> count()', aggregate: false},
  {name: 'increase', flux: '|> increase()', aggregate: false},
  {name: 'skew', flux: '|> skew()', aggregate: false},
  {name: 'spread', flux: '|> spread()', aggregate: false},
  {name: 'stddev', flux: '|> stddev()', aggregate: true},
  {name: 'first', flux: '|> first()', aggregate: true},
  {name: 'last', flux: '|> last()', aggregate: true},
  {name: 'unique', flux: '|> unique()', aggregate: false},
  {name: 'sort', flux: '|> sort()', aggregate: false},
]


Add plugins to StoreState interface

fix: Add plugins to StoreState interface

--- public/app/types/store.ts
+++ public/app/types/store.ts
@@ -9,6 +9,7 @@
 import { UsersState, UserState } from './user';
 import { OrganizationState } from './organization';
 import { AppNotificationsState } from './appNotifications';
+import { PluginsState } from './plugins';

 export interface StoreState {
   navIndex: NavIndex;
@@ -24,4 +25,5 @@
   organization: OrganizationState;
   appNotifications: AppNotificationsState;
   user: UserState;
+  plugins: PluginsState;
 }

<|original_code|>
import { NavIndex } from './navModel';
import { LocationState } from './location';
import { AlertRulesState } from './alerting';
import { TeamsState, TeamState } from './teams';
import { FolderState } from './folders';
import { DashboardState } from './dashboard';
import { DataSourcesState } from './datasources';
import { ExploreState } from './explore';
import { UsersState, UserState } from './user';
import { OrganizationState } from './organization';
import { AppNotificationsState } from './appNotifications';

export interface StoreState {
  navIndex: NavIndex;
  location: LocationState;
  alertRules: AlertRulesState;
  teams: TeamsState;
  team: TeamState;
  folder: FolderState;
  dashboard: DashboardState;
  dataSources: DataSourcesState;
  explore: ExploreState;
  users: UsersState;
  organization: OrganizationState;
  appNotifications: AppNotificationsState;
  user: UserState;
}

<|edits_diff|>
--- public/app/types/store.ts
+++ public/app/types/store.ts
@@ -9,6 +9,7 @@
 import { UsersState, UserState } from './user';
 import { OrganizationState } from './organization';
 import { AppNotificationsState } from './appNotifications';
+import { PluginsState } from './plugins';

 export interface StoreState {
   navIndex: NavIndex;
<|current_version|>
import { NavIndex } from './navModel';
import { LocationState } from './location';
import { AlertRulesState } from './alerting';
import { TeamsState, TeamState } from './teams';
import { FolderState } from './folders';
import { DashboardState } from './dashboard';
import { DataSourcesState } from './datasources';
import { ExploreState } from './explore';
import { UsersState, UserState } from './user';
import { OrganizationState } from './organization';
import { AppNotificationsState } from './appNotifications';
import { PluginsState } from './plugins';

export interface StoreState {
  navIndex: NavIndex;
  location: LocationState;
  alertRules: AlertRulesState;
  teams: TeamsState;
  team: TeamState;
  folder: FolderState;
  dashboard: DashboardState;
  dataSources: DataSourcesState;
  explore: ExploreState;
  users: UsersState;
  organization: OrganizationState;
  appNotifications: AppNotificationsState;
  user: UserState;
}

<|next_version|>
import { NavIndex } from './navModel';
import { LocationState } from './location';
import { AlertRulesState } from './alerting';
import { TeamsState, TeamState } from './teams';
import { FolderState } from './folders';
import { DashboardState } from './dashboard';
import { DataSourcesState } from './datasources';
import { ExploreState } from './explore';
import { UsersState, UserState } from './user';
import { OrganizationState } from './organization';
import { AppNotificationsState } from './appNotifications';
import { PluginsState } from './plugins';

export interface StoreState {
  navIndex: NavIndex;
  location: LocationState;
  alertRules: AlertRulesState;
  teams: TeamsState;
  team: TeamState;
  folder: FolderState;
  dashboard: DashboardState;
  dataSources: DataSourcesState;
  explore: ExploreState;
  users: UsersState;
  organization: OrganizationState;
  appNotifications: AppNotificationsState;
  user: UserState;
  plugins: PluginsState;
}


Fix issue where Ship didn't render in map because GameFeatureObject.frame was undefined.

--- source/game/objects/gameFeatureObject.ts
+++ source/game/objects/gameFeatureObject.ts
@@ -24,12 +24,14 @@
       type: string; // TODO: enum?
       passable:boolean;
       groups:any;
+      frame:number;
       constructor(options:any) {
          super(_.omit(options || {},["x","y","type"]));
          this.feature = options;
          this.point.x = options.x;
          this.point.y = options.y;
          this.type = options.type;
+         this.frame = typeof options.frame !== 'undefined' ? options.frame : 0;
          this.groups = typeof options.groups === 'string' ? JSON.parse(options.groups) : options.groups;
       }
    }

<|original_code|>
/**
 Copyright (C) 2013 by Justin DuJardin

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */

/// <reference path="../../tile/tileObject.ts" />
/// <reference path="../gameTileMap.ts" />

module pow2 {
   export class GameFeatureObject extends pow2.TileObject {
      tileMap:GameTileMap;
      feature:any; // TODO: Feature Interface
      type: string; // TODO: enum?
      passable:boolean;
      groups:any;
      constructor(options:any) {
         super(_.omit(options || {},["x","y","type"]));
         this.feature = options;
         this.point.x = options.x;
         this.point.y = options.y;
         this.type = options.type;
         this.groups = typeof options.groups === 'string' ? JSON.parse(options.groups) : options.groups;
      }
   }
}
<|edits_diff|>
--- source/game/objects/gameFeatureObject.ts
+++ source/game/objects/gameFeatureObject.ts
@@ -24,6 +24,7 @@
       type: string; // TODO: enum?
       passable:boolean;
       groups:any;
+      frame:number;
       constructor(options:any) {
          super(_.omit(options || {},["x","y","type"]));
          this.feature = options;
<|current_version|>
/**
 Copyright (C) 2013 by Justin DuJardin

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */

/// <reference path="../../tile/tileObject.ts" />
/// <reference path="../gameTileMap.ts" />

module pow2 {
   export class GameFeatureObject extends pow2.TileObject {
      tileMap:GameTileMap;
      feature:any; // TODO: Feature Interface
      type: string; // TODO: enum?
      passable:boolean;
      groups:any;
      frame:number;
      constructor(options:any) {
         super(_.omit(options || {},["x","y","type"]));
         this.feature = options;
         this.point.x = options.x;
         this.point.y = options.y;
         this.type = options.type;
         this.groups = typeof options.groups === 'string' ? JSON.parse(options.groups) : options.groups;
      }
   }
}
<|next_version|>
/**
 Copyright (C) 2013 by Justin DuJardin

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */

/// <reference path="../../tile/tileObject.ts" />
/// <reference path="../gameTileMap.ts" />

module pow2 {
   export class GameFeatureObject extends pow2.TileObject {
      tileMap:GameTileMap;
      feature:any; // TODO: Feature Interface
      type: string; // TODO: enum?
      passable:boolean;
      groups:any;
      frame:number;
      constructor(options:any) {
         super(_.omit(options || {},["x","y","type"]));
         this.feature = options;
         this.point.x = options.x;
         this.point.y = options.y;
         this.type = options.type;
         this.frame = typeof options.frame !== 'undefined' ? options.frame : 0;
         this.groups = typeof options.groups === 'string' ? JSON.parse(options.groups) : options.groups;
      }
   }
}


Add dtslint type assertion test.

Add dtslint type assertion test.

--- types/react-router/test/WithRouterDecorator.tsx
+++ types/react-router/test/WithRouterDecorator.tsx
@@ -5,6 +5,7 @@
   username: string;
 }

+// $ExpectType Component
 @withRouter
 class Component extends React.Component<TOwnProps, {}> {
 	render() {
@@ -16,4 +17,7 @@

 const WithRouterTest = () => (<Component username="John" />);

+// $ExpectType Element
+WithRouterTest();
+
 export default WithRouterTest;

<|original_code|>
import * as React from 'react';
import { withRouter, RouteComponentProps } from 'react-router-dom';

interface TOwnProps {
  username: string;
}

@withRouter
class Component extends React.Component<TOwnProps, {}> {
	render() {
		return (

Welcome {this.props.username}

		);
	}
}

const WithRouterTest = () => (<Component username="John" />);

export default WithRouterTest;

<|edits_diff|>
--- types/react-router/test/WithRouterDecorator.tsx
+++ types/react-router/test/WithRouterDecorator.tsx
@@ -5,6 +5,7 @@
   username: string;
 }

+// $ExpectType Component
 @withRouter
 class Component extends React.Component<TOwnProps, {}> {
 	render() {
<|current_version|>
import * as React from 'react';
import { withRouter, RouteComponentProps } from 'react-router-dom';

interface TOwnProps {
  username: string;
}

// $ExpectType Component
@withRouter
class Component extends React.Component<TOwnProps, {}> {
	render() {
		return (

Welcome {this.props.username}

		);
	}
}

const WithRouterTest = () => (<Component username="John" />);

export default WithRouterTest;

<|next_version|>
import * as React from 'react';
import { withRouter, RouteComponentProps } from 'react-router-dom';

interface TOwnProps {
  username: string;
}

// $ExpectType Component
@withRouter
class Component extends React.Component<TOwnProps, {}> {
	render() {
		return (

Welcome {this.props.username}

		);
	}
}

const WithRouterTest = () => (<Component username="John" />);

// $ExpectType Element
WithRouterTest();

export default WithRouterTest;


Add default theme to exports

Add default theme to exports

--- src/styles/themes/index.ts
+++ src/styles/themes/index.ts
@@ -1,3 +1,5 @@
+import theme from './light';
+
 export interface Palette {
     primary1Color: string,
     primary2Color: string,
@@ -20,3 +22,5 @@
   fontFamily: string;
   palette: Palette;
 }
+
+export const defaultTheme = theme;

<|original_code|>
export interface Palette {
    primary1Color: string,
    primary2Color: string,
    primary3Color: string,
    accent1Color: string,
    accent2Color: string,
    accent3Color: string,
    textColor: string,
    secondaryTextColor: string,
    alternateTextColor: string,
    canvasColor: string,
    borderColor: string,
    disabledColor: string,
    pickerHeaderColor: string,
    clockCircleColor: string,
    shadowColor?: string
}

export interface Theme {
  fontFamily: string;
  palette: Palette;
}

<|edits_diff|>
--- src/styles/themes/index.ts
+++ src/styles/themes/index.ts
@@ -1,3 +1,5 @@
+import theme from './light';
+
 export interface Palette {
     primary1Color: string,
     primary2Color: string,
<|current_version|>
import theme from './light';

export interface Palette {
    primary1Color: string,
    primary2Color: string,
    primary3Color: string,
    accent1Color: string,
    accent2Color: string,
    accent3Color: string,
    textColor: string,
    secondaryTextColor: string,
    alternateTextColor: string,
    canvasColor: string,
    borderColor: string,
    disabledColor: string,
    pickerHeaderColor: string,
    clockCircleColor: string,
    shadowColor?: string
}

export interface Theme {
  fontFamily: string;
  palette: Palette;
}

<|next_version|>
import theme from './light';

export interface Palette {
    primary1Color: string,
    primary2Color: string,
    primary3Color: string,
    accent1Color: string,
    accent2Color: string,
    accent3Color: string,
    textColor: string,
    secondaryTextColor: string,
    alternateTextColor: string,
    canvasColor: string,
    borderColor: string,
    disabledColor: string,
    pickerHeaderColor: string,
    clockCircleColor: string,
    shadowColor?: string
}

export interface Theme {
  fontFamily: string;
  palette: Palette;
}

export const defaultTheme = theme;


Add TODO to comment patterns config to add all language ids

--- src/utils/comments/commentPatterns.ts
+++ src/utils/comments/commentPatterns.ts
@@ -1,3 +1,5 @@
+// TODO: add all languages from https://code.visualstudio.com/docs/languages/identifiers
+
 const BY_LANGUAGE = {
   xml: "<!-- %s -->",
   hash: "# %s",
@@ -37,6 +39,7 @@
     "typescript",
     "java",
     "c",
+    "c#",
     "cpp",
     "d"
   ]

<|original_code|>
const BY_LANGUAGE = {
  xml: "<!-- %s -->",
  hash: "# %s",
  bat: "REM %s",
  percent: "% %s",
  handlebars: "{{!-- %s --}}",
  doubleDash: "-- %s",
  block: "/* %s */",
  doubleLine: "-- %s",
  pug: "//- %s",
  common: "// %s"
};

const BY_PATTERN = {
  block: ["css"],
  hash: [
    "python",
    "shellscript",
    "dockerfile",
    "ruby",
    "coffeescript",
    "dockerfile",
    "elixir",
    "julia",
    "makefile",
    "perl",
    "yaml"
  ],
  xml: ["xml", "xsl", "html", "markdown"],
  percent: ["tex", "prolog"],
  pug: ["pug", "jade"],
  doubleDash: ["lua", "sql", "haskell", "cabal"],
  doubleLine: ["sql", "ada", "haskell", "lua", "pig"],
  common: [
    "javascript",
    "javascriptreact",
    "typescript",
    "java",
    "c",
    "cpp",
    "d"
  ]
};

function computePatternByLanguage(): { [s: string]: string } {
  let result: { [s: string]: string } = {};
  for (let [pattern, languages] of Object.entries(BY_PATTERN)) {
    languages.forEach(language => {
      result[language] = BY_LANGUAGE[pattern];
    });
  }
  return result;
}

const patterns = computePatternByLanguage();

export default patterns;

<|edits_diff|>
--- src/utils/comments/commentPatterns.ts
+++ src/utils/comments/commentPatterns.ts
@@ -1,3 +1,5 @@
+// TODO: add all languages from https://code.visualstudio.com/docs/languages/identifiers
+
 const BY_LANGUAGE = {
   xml: "<!-- %s -->",
   hash: "# %s",
<|current_version|>
// TODO: add all languages from https://code.visualstudio.com/docs/languages/identifiers

const BY_LANGUAGE = {
  xml: "<!-- %s -->",
  hash: "# %s",
  bat: "REM %s",
  percent: "% %s",
  handlebars: "{{!-- %s --}}",
  doubleDash: "-- %s",
  block: "/* %s */",
  doubleLine: "-- %s",
  pug: "//- %s",
  common: "// %s"
};

const BY_PATTERN = {
  block: ["css"],
  hash: [
    "python",
    "shellscript",
    "dockerfile",
    "ruby",
    "coffeescript",
    "dockerfile",
    "elixir",
    "julia",
    "makefile",
    "perl",
    "yaml"
  ],
  xml: ["xml", "xsl", "html", "markdown"],
  percent: ["tex", "prolog"],
  pug: ["pug", "jade"],
  doubleDash: ["lua", "sql", "haskell", "cabal"],
  doubleLine: ["sql", "ada", "haskell", "lua", "pig"],
  common: [
    "javascript",
    "javascriptreact",
    "typescript",
    "java",
    "c",
    "cpp",
    "d"
  ]
};

function computePatternByLanguage(): { [s: string]: string } {
  let result: { [s: string]: string } = {};
  for (let [pattern, languages] of Object.entries(BY_PATTERN)) {
    languages.forEach(language => {
      result[language] = BY_LANGUAGE[pattern];
    });
  }
  return result;
}

const patterns = computePatternByLanguage();

export default patterns;

<|next_version|>
// TODO: add all languages from https://code.visualstudio.com/docs/languages/identifiers

const BY_LANGUAGE = {
  xml: "<!-- %s -->",
  hash: "# %s",
  bat: "REM %s",
  percent: "% %s",
  handlebars: "{{!-- %s --}}",
  doubleDash: "-- %s",
  block: "/* %s */",
  doubleLine: "-- %s",
  pug: "//- %s",
  common: "// %s"
};

const BY_PATTERN = {
  block: ["css"],
  hash: [
    "python",
    "shellscript",
    "dockerfile",
    "ruby",
    "coffeescript",
    "dockerfile",
    "elixir",
    "julia",
    "makefile",
    "perl",
    "yaml"
  ],
  xml: ["xml", "xsl", "html", "markdown"],
  percent: ["tex", "prolog"],
  pug: ["pug", "jade"],
  doubleDash: ["lua", "sql", "haskell", "cabal"],
  doubleLine: ["sql", "ada", "haskell", "lua", "pig"],
  common: [
    "javascript",
    "javascriptreact",
    "typescript",
    "java",
    "c",
    "c#",
    "cpp",
    "d"
  ]
};

function computePatternByLanguage(): { [s: string]: string } {
  let result: { [s: string]: string } = {};
  for (let [pattern, languages] of Object.entries(BY_PATTERN)) {
    languages.forEach(language => {
      result[language] = BY_LANGUAGE[pattern];
    });
  }
  return result;
}

const patterns = computePatternByLanguage();

export default patterns;


Fix `TypeError` when trying to re-throw

Fix `TypeError` when trying to re-throw

without the rxjs imports, re-throwing error in `handleError` results in a `TypeError: Observable_1.Observable.throw is not a function`

I have also added in the `do` debugging lib (commented out) as its a handy tool to point out to dev's who are not familiar with rxjs (like myself)

--- src/client/app/shared/name-list/name-list.service.ts
+++ src/client/app/shared/name-list/name-list.service.ts
@@ -1,6 +1,11 @@
 import { Injectable } from '@angular/core';
 import { Http, Response } from '@angular/http';
 import { Observable } from 'rxjs/Observable';
+
+import 'rxjs/add/observable/throw';
+import 'rxjs/add/operator/map';
+// import 'rxjs/add/operator/do';  // for debugging
+import 'rxjs/add/operator/catch';

 /**
  * This class provides the NameList service with methods to read names and add names.
@@ -22,6 +27,7 @@
   get(): Observable<string[]> {
     return this.http.get('/assets/data.json')
                     .map((res: Response) => res.json())
+    //              .do(data => console.log('server data:', data))  // debug
                     .catch(this.handleError);
   }

<|original_code|>
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';

/**
 * This class provides the NameList service with methods to read names and add names.
 */
@Injectable()
export class NameListService {

  /**
   * Creates a new NameListService with the injected Http.
   * @param {Http} http - The injected Http.
   * @constructor
   */
  constructor(private http: Http) {}

  /**
   * Returns an Observable for the HTTP GET request for the JSON resource.
   * @return {string[]} The Observable for the HTTP request.
   */
  get(): Observable<string[]> {
    return this.http.get('/assets/data.json')
                    .map((res: Response) => res.json())
                    .catch(this.handleError);
  }

  /**
    * Handle HTTP error
    */
  private handleError (error: any) {
    // In a real world app, we might use a remote logging infrastructure
    // We'd also dig deeper into the error to get a better message
    let errMsg = (error.message) ? error.message :
      error.status ? `${error.status} - ${error.statusText}` : 'Server error';
    console.error(errMsg); // log to console instead
    return Observable.throw(errMsg);
  }
}

<|edits_diff|>
--- src/client/app/shared/name-list/name-list.service.ts
+++ src/client/app/shared/name-list/name-list.service.ts
@@ -1,6 +1,11 @@
 import { Injectable } from '@angular/core';
 import { Http, Response } from '@angular/http';
 import { Observable } from 'rxjs/Observable';
+
+import 'rxjs/add/observable/throw';
+import 'rxjs/add/operator/map';
+// import 'rxjs/add/operator/do';  // for debugging
+import 'rxjs/add/operator/catch';

 /**
  * This class provides the NameList service with methods to read names and add names.
<|current_version|>
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';

import 'rxjs/add/observable/throw';
import 'rxjs/add/operator/map';
// import 'rxjs/add/operator/do';  // for debugging
import 'rxjs/add/operator/catch';

/**
 * This class provides the NameList service with methods to read names and add names.
 */
@Injectable()
export class NameListService {

  /**
   * Creates a new NameListService with the injected Http.
   * @param {Http} http - The injected Http.
   * @constructor
   */
  constructor(private http: Http) {}

  /**
   * Returns an Observable for the HTTP GET request for the JSON resource.
   * @return {string[]} The Observable for the HTTP request.
   */
  get(): Observable<string[]> {
    return this.http.get('/assets/data.json')
                    .map((res: Response) => res.json())
                    .catch(this.handleError);
  }

  /**
    * Handle HTTP error
    */
  private handleError (error: any) {
    // In a real world app, we might use a remote logging infrastructure
    // We'd also dig deeper into the error to get a better message
    let errMsg = (error.message) ? error.message :
      error.status ? `${error.status} - ${error.statusText}` : 'Server error';
    console.error(errMsg); // log to console instead
    return Observable.throw(errMsg);
  }
}

<|next_version|>
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';

import 'rxjs/add/observable/throw';
import 'rxjs/add/operator/map';
// import 'rxjs/add/operator/do';  // for debugging
import 'rxjs/add/operator/catch';

/**
 * This class provides the NameList service with methods to read names and add names.
 */
@Injectable()
export class NameListService {

  /**
   * Creates a new NameListService with the injected Http.
   * @param {Http} http - The injected Http.
   * @constructor
   */
  constructor(private http: Http) {}

  /**
   * Returns an Observable for the HTTP GET request for the JSON resource.
   * @return {string[]} The Observable for the HTTP request.
   */
  get(): Observable<string[]> {
    return this.http.get('/assets/data.json')
                    .map((res: Response) => res.json())
    //              .do(data => console.log('server data:', data))  // debug
                    .catch(this.handleError);
  }

  /**
    * Handle HTTP error
    */
  private handleError (error: any) {
    // In a real world app, we might use a remote logging infrastructure
    // We'd also dig deeper into the error to get a better message
    let errMsg = (error.message) ? error.message :
      error.status ? `${error.status} - ${error.statusText}` : 'Server error';
    console.error(errMsg); // log to console instead
    return Observable.throw(errMsg);
  }
}


fix(oidc): Add missing import on oidc-provider module

--- packages/oidc-provider/src/index.ts
+++ packages/oidc-provider/src/index.ts
@@ -1,8 +1,15 @@
 export * from "./decorators";
+
 export * from "./domain";
+
+export * from "./middlewares/OidcInteractionMiddleware";
+export * from "./middlewares/OidcNoCacheMiddleware";
+export * from "./middlewares/OidcSecureMiddleware";
+
 export * from "./services/OidcAdapters";
 export * from "./services/OidcInteractions";
 export * from "./services/OidcInteractionContext";
 export * from "./services/OidcJwks";
 export * from "./services/OidcProvider";
+
 export * from "./OidcModule";

<|original_code|>
export * from "./decorators";
export * from "./domain";
export * from "./services/OidcAdapters";
export * from "./services/OidcInteractions";
export * from "./services/OidcInteractionContext";
export * from "./services/OidcJwks";
export * from "./services/OidcProvider";
export * from "./OidcModule";

<|edits_diff|>
--- packages/oidc-provider/src/index.ts
+++ packages/oidc-provider/src/index.ts
@@ -1,5 +1,11 @@
 export * from "./decorators";
+
 export * from "./domain";
+
+export * from "./middlewares/OidcInteractionMiddleware";
+export * from "./middlewares/OidcNoCacheMiddleware";
+export * from "./middlewares/OidcSecureMiddleware";
+
 export * from "./services/OidcAdapters";
 export * from "./services/OidcInteractions";
 export * from "./services/OidcInteractionContext";
<|current_version|>
export * from "./decorators";

export * from "./domain";

export * from "./middlewares/OidcInteractionMiddleware";
export * from "./middlewares/OidcNoCacheMiddleware";
export * from "./middlewares/OidcSecureMiddleware";

export * from "./services/OidcAdapters";
export * from "./services/OidcInteractions";
export * from "./services/OidcInteractionContext";
export * from "./services/OidcJwks";
export * from "./services/OidcProvider";
export * from "./OidcModule";

<|next_version|>
export * from "./decorators";

export * from "./domain";

export * from "./middlewares/OidcInteractionMiddleware";
export * from "./middlewares/OidcNoCacheMiddleware";
export * from "./middlewares/OidcSecureMiddleware";

export * from "./services/OidcAdapters";
export * from "./services/OidcInteractions";
export * from "./services/OidcInteractionContext";
export * from "./services/OidcJwks";
export * from "./services/OidcProvider";

export * from "./OidcModule";


Configure scheduling when the value is updated

--- src/js/Actions/UIActions/Settings.ts
+++ src/js/Actions/UIActions/Settings.ts
@@ -1,12 +1,18 @@
+import InstanceCache from 'Core/InstanceCache';
+
 import { updatePollPeriod } from 'Actions/Settings';
+import { configurePollingScheduler } from 'Helpers/System/Scheduler';

 /**
  * @param  {string} pollPeriod
  */
 export function configurePollPeriod(pollPeriod: string)
 {
+  let scheduler = InstanceCache.getInstance<IScheduler>('IScheduler');
+
   return dispatch =>
   {
     dispatch(updatePollPeriod(pollPeriod));
+    configurePollingScheduler(pollPeriod);
   };
 };

<|original_code|>
import { updatePollPeriod } from 'Actions/Settings';

/**
 * @param  {string} pollPeriod
 */
export function configurePollPeriod(pollPeriod: string)
{
  return dispatch =>
  {
    dispatch(updatePollPeriod(pollPeriod));
  };
};
<|edits_diff|>
--- src/js/Actions/UIActions/Settings.ts
+++ src/js/Actions/UIActions/Settings.ts
@@ -1,10 +1,15 @@
+import InstanceCache from 'Core/InstanceCache';
+
 import { updatePollPeriod } from 'Actions/Settings';
+import { configurePollingScheduler } from 'Helpers/System/Scheduler';

 /**
  * @param  {string} pollPeriod
  */
 export function configurePollPeriod(pollPeriod: string)
 {
+  let scheduler = InstanceCache.getInstance<IScheduler>('IScheduler');
+
   return dispatch =>
   {
     dispatch(updatePollPeriod(pollPeriod));
<|current_version|>
import InstanceCache from 'Core/InstanceCache';

import { updatePollPeriod } from 'Actions/Settings';
import { configurePollingScheduler } from 'Helpers/System/Scheduler';

/**
 * @param  {string} pollPeriod
 */
export function configurePollPeriod(pollPeriod: string)
{
  let scheduler = InstanceCache.getInstance<IScheduler>('IScheduler');

  return dispatch =>
  {
    dispatch(updatePollPeriod(pollPeriod));
  };
};
<|next_version|>
import InstanceCache from 'Core/InstanceCache';

import { updatePollPeriod } from 'Actions/Settings';
import { configurePollingScheduler } from 'Helpers/System/Scheduler';

/**
 * @param  {string} pollPeriod
 */
export function configurePollPeriod(pollPeriod: string)
{
  let scheduler = InstanceCache.getInstance<IScheduler>('IScheduler');

  return dispatch =>
  {
    dispatch(updatePollPeriod(pollPeriod));
    configurePollingScheduler(pollPeriod);
  };
};


Add RSS source tag for items

Add RSS source tag for items

--- src/v2/pages/rss/components/RssItem/index.tsx
+++ src/v2/pages/rss/components/RssItem/index.tsx
@@ -22,6 +22,7 @@
   link,
   pubDate,
   guid,
+  source,
   description,
 }) => {
   const html = `
@@ -29,6 +30,7 @@
     <link>${link}</link>
     <pubDate>${new Date(pubDate).toUTCString()}</pubDate>
     <guid>${guid}</guid>
+    <source url="${source.split('?')[0]}" />
     <description>
       <![CDATA[${description}]]>
     </description>

<|original_code|>
import React from 'react'
import { ReactElement } from 'react'

const rssElement = (name: string) => p => {
  const { children, ...props } = p
  return React.createElement(name, props, children)
}

const Item = rssElement('item')

interface RssItemProps {
  title?: string
  link?: string
  pubDate?: string
  guid?: string
  source?: string
  description?: ReactElement
}

export const RssItem: React.FC<RssItemProps> = ({
  title,
  link,
  pubDate,
  guid,
  description,
}) => {
  const html = `
    <title>${title}</title>
    <link>${link}</link>
    <pubDate>${new Date(pubDate).toUTCString()}</pubDate>
    <guid>${guid}</guid>
    <description>
      <![CDATA[${description}]]>
    </description>
  `

  return <Item dangerouslySetInnerHTML={{ __html: html }} />
}

<|edits_diff|>
--- src/v2/pages/rss/components/RssItem/index.tsx
+++ src/v2/pages/rss/components/RssItem/index.tsx
@@ -22,6 +22,7 @@
   link,
   pubDate,
   guid,
+  source,
   description,
 }) => {
   const html = `
<|current_version|>
import React from 'react'
import { ReactElement } from 'react'

const rssElement = (name: string) => p => {
  const { children, ...props } = p
  return React.createElement(name, props, children)
}

const Item = rssElement('item')

interface RssItemProps {
  title?: string
  link?: string
  pubDate?: string
  guid?: string
  source?: string
  description?: ReactElement
}

export const RssItem: React.FC<RssItemProps> = ({
  title,
  link,
  pubDate,
  guid,
  source,
  description,
}) => {
  const html = `
    <title>${title}</title>
    <link>${link}</link>
    <pubDate>${new Date(pubDate).toUTCString()}</pubDate>
    <guid>${guid}</guid>
    <description>
      <![CDATA[${description}]]>
    </description>
  `

  return <Item dangerouslySetInnerHTML={{ __html: html }} />
}

<|next_version|>
import React from 'react'
import { ReactElement } from 'react'

const rssElement = (name: string) => p => {
  const { children, ...props } = p
  return React.createElement(name, props, children)
}

const Item = rssElement('item')

interface RssItemProps {
  title?: string
  link?: string
  pubDate?: string
  guid?: string
  source?: string
  description?: ReactElement
}

export const RssItem: React.FC<RssItemProps> = ({
  title,
  link,
  pubDate,
  guid,
  source,
  description,
}) => {
  const html = `
    <title>${title}</title>
    <link>${link}</link>
    <pubDate>${new Date(pubDate).toUTCString()}</pubDate>
    <guid>${guid}</guid>
    <source url="${source.split('?')[0]}" />
    <description>
      <![CDATA[${description}]]>
    </description>
  `

  return <Item dangerouslySetInnerHTML={{ __html: html }} />
}


Add link to Mongoose API.

Add link to Mongoose API.

--- console/src/app/core/services/monitoring-api/MongooseApi.model.ts
+++ console/src/app/core/services/monitoring-api/MongooseApi.model.ts
@@ -1,4 +1,9 @@
+// A class that describes endpoints for Mongoose API.
+// See Mongoose API (as for 27.03.2019): ...
+// ... https://github.com/emc-mongoose/mongoose-base/tree/master/doc/interfaces/api/remote
+
 export namespace MongooseApi {
+
     export class RunApi {
         public static readonly RUN = "/run";
     }

<|original_code|>
export namespace MongooseApi {
    export class RunApi {
        public static readonly RUN = "/run";
    }

    export class LogsApi {
        public static readonly LOGS = "/logs";
    }
}
<|edits_diff|>
--- console/src/app/core/services/monitoring-api/MongooseApi.model.ts
+++ console/src/app/core/services/monitoring-api/MongooseApi.model.ts
@@ -1,3 +1,7 @@
+// A class that describes endpoints for Mongoose API.
+// See Mongoose API (as for 27.03.2019): ...
+// ... https://github.com/emc-mongoose/mongoose-base/tree/master/doc/interfaces/api/remote
+
 export namespace MongooseApi {
     export class RunApi {
         public static readonly RUN = "/run";
<|current_version|>
// A class that describes endpoints for Mongoose API.
// See Mongoose API (as for 27.03.2019): ...
// ... https://github.com/emc-mongoose/mongoose-base/tree/master/doc/interfaces/api/remote

export namespace MongooseApi {
    export class RunApi {
        public static readonly RUN = "/run";
    }

    export class LogsApi {
        public static readonly LOGS = "/logs";
    }
}
<|next_version|>
// A class that describes endpoints for Mongoose API.
// See Mongoose API (as for 27.03.2019): ...
// ... https://github.com/emc-mongoose/mongoose-base/tree/master/doc/interfaces/api/remote

export namespace MongooseApi {

    export class RunApi {
        public static readonly RUN = "/run";
    }

    export class LogsApi {
        public static readonly LOGS = "/logs";
    }
}


Allow storing schema locations with namespaces.

--- src/Namespace.ts
+++ src/Namespace.ts
@@ -8,9 +8,11 @@

 	addElement(name: string) { this.elementNameList.push(name); }
 	addAttribute(name: string) { this.attributeNameList.push(name); }
+	addLocation(url: string) { this.schemaLocationList.push(url); }

 	elementNameList: string[] = [];
 	attributeNameList: string[] = [];
+	schemaLocationList: string[] = [];

 	id: number;

<|original_code|>
export class Namespace {

	/** @param uri Unique identifier for the namespace, should be a valid URI.
	  * @param defaultPrefix Default xmlns prefix for serializing to XML. */
	constructor(public defaultPrefix: string, public uri: string, id?: number) {
		this.id = id || Namespace.idLast++;
	}

	addElement(name: string) { this.elementNameList.push(name); }
	addAttribute(name: string) { this.attributeNameList.push(name); }

	elementNameList: string[] = [];
	attributeNameList: string[] = [];

	id: number;

	static idLast = 0;
	static unknown = new Namespace('', '');

}

<|edits_diff|>
--- src/Namespace.ts
+++ src/Namespace.ts
@@ -8,6 +8,7 @@

 	addElement(name: string) { this.elementNameList.push(name); }
 	addAttribute(name: string) { this.attributeNameList.push(name); }
+	addLocation(url: string) { this.schemaLocationList.push(url); }

 	elementNameList: string[] = [];
 	attributeNameList: string[] = [];
<|current_version|>
export class Namespace {

	/** @param uri Unique identifier for the namespace, should be a valid URI.
	  * @param defaultPrefix Default xmlns prefix for serializing to XML. */
	constructor(public defaultPrefix: string, public uri: string, id?: number) {
		this.id = id || Namespace.idLast++;
	}

	addElement(name: string) { this.elementNameList.push(name); }
	addAttribute(name: string) { this.attributeNameList.push(name); }
	addLocation(url: string) { this.schemaLocationList.push(url); }

	elementNameList: string[] = [];
	attributeNameList: string[] = [];

	id: number;

	static idLast = 0;
	static unknown = new Namespace('', '');

}

<|next_version|>
export class Namespace {

	/** @param uri Unique identifier for the namespace, should be a valid URI.
	  * @param defaultPrefix Default xmlns prefix for serializing to XML. */
	constructor(public defaultPrefix: string, public uri: string, id?: number) {
		this.id = id || Namespace.idLast++;
	}

	addElement(name: string) { this.elementNameList.push(name); }
	addAttribute(name: string) { this.attributeNameList.push(name); }
	addLocation(url: string) { this.schemaLocationList.push(url); }

	elementNameList: string[] = [];
	attributeNameList: string[] = [];
	schemaLocationList: string[] = [];

	id: number;

	static idLast = 0;
	static unknown = new Namespace('', '');

}


Set round pixels to true.

Set round pixels to true.

--- src/states/boot.state.ts
+++ src/states/boot.state.ts
@@ -7,8 +7,11 @@

     create(): void {
         this.game.stage.backgroundColor = 'd6f3f6'
+
         this.game.scale.pageAlignHorizontally = true
         this.game.scale.pageAlignVertically = true
+
+        this.game.renderer.renderSession.roundPixels = true

         this.game.physics.startSystem(Phaser.Physics.ARCADE)

<|original_code|>
import { LoadState } from './load.state'

export class BootState extends Phaser.State {

    static KEY: string = 'boot_state'

    create(): void {
        this.game.stage.backgroundColor = 'd6f3f6'
        this.game.scale.pageAlignHorizontally = true
        this.game.scale.pageAlignVertically = true

        this.game.physics.startSystem(Phaser.Physics.ARCADE)

        this.game.state.start(LoadState.KEY)
    }

}
<|edits_diff|>
--- src/states/boot.state.ts
+++ src/states/boot.state.ts
@@ -7,6 +7,7 @@

     create(): void {
         this.game.stage.backgroundColor = 'd6f3f6'
+
         this.game.scale.pageAlignHorizontally = true
         this.game.scale.pageAlignVertically = true

<|current_version|>
import { LoadState } from './load.state'

export class BootState extends Phaser.State {

    static KEY: string = 'boot_state'

    create(): void {
        this.game.stage.backgroundColor = 'd6f3f6'

        this.game.scale.pageAlignHorizontally = true
        this.game.scale.pageAlignVertically = true

        this.game.physics.startSystem(Phaser.Physics.ARCADE)

        this.game.state.start(LoadState.KEY)
    }

}
<|next_version|>
import { LoadState } from './load.state'

export class BootState extends Phaser.State {

    static KEY: string = 'boot_state'

    create(): void {
        this.game.stage.backgroundColor = 'd6f3f6'

        this.game.scale.pageAlignHorizontally = true
        this.game.scale.pageAlignVertically = true

        this.game.renderer.renderSession.roundPixels = true

        this.game.physics.startSystem(Phaser.Physics.ARCADE)

        this.game.state.start(LoadState.KEY)
    }

}


import * as React from "react";
import * as ReactDOM from "react-dom";
import * as injectTapEventPlugin from "react-tap-event-plugin";
import MenuBar from "./components/menu/MenuBar";
import SimpleContent from "./components/SimpleContent";
import TopPage from "./components/top/TopPage";
import EventPage from "./components/event/EventPage";
import StagePage from "./components/stage/StagePage";
import SearchPage from "./components/search/SearchPage";
import MapPage from "./components/map/MapPage";
import MapEventList from "./components/map/MapEventList";

import { Router, Route, hashHistory, IndexRoute } from "react-router";
injectTapEventPlugin();

interface Text {
    content: string;
}

class TestElement extends React.Component<Text, {}> {
    render() {
        return (
            <div className="test">
                <MenuBar appName="Shibaura Fes Navi" />
                {this.props.children || <TopPage />}
            </div>
        );
    }
}

ReactDOM.render((
    <Router history={hashHistory}>
        <Route path="/" component={TestElement}>
            <IndexRoute component={TopPage} />
            <Route path="/event" component={EventPage} />
            <Route path="/stage" component={StagePage} />
            <Route path="/search" component={SearchPage} />
            <Route path="/map" component={MapPage} />
            <Route path="/building/:building/:room_or_stall" component={MapEventList} />
        </Route>
    </Router>
), document.getElementById("app"));

import * as React from "react";
import * as ReactDOM from "react-dom";
import * as injectTapEventPlugin from "react-tap-event-plugin";
import MenuBar from "./components/menu/MenuBar";
import SimpleContent from "./components/SimpleContent";
import TopPage from "./components/top/TopPage";
import EventPage from "./components/event/EventPage";
import StagePage from "./components/stage/StagePage";
import SearchPage from "./components/search/SearchPage";
import MapPage from "./components/map/MapPage";
import MapEventList from "./components/map/MapEventList";
import AboutPage from "./components/about/AboutPage";

import { Router, Route, hashHistory, IndexRoute } from "react-router";
injectTapEventPlugin();

interface Text {
    content: string;
}

class TestElement extends React.Component<Text, {}> {
    render() {
        return (
            <div className="test">
                <MenuBar appName="Shibaura Fes Navi" />
                {this.props.children || <TopPage />}
            </div>
        );
    }
}

ReactDOM.render((
    <Router history={hashHistory}>
        <Route path="/" component={TestElement}>
            <IndexRoute component={TopPage} />
            <Route path="/event" component={EventPage} />
            <Route path="/stage" component={StagePage} />
            <Route path="/search" component={SearchPage} />
            <Route path="/map" component={MapPage} />
            <Route path="/building/:building/:room_or_stall" component={MapEventList} />
            <Route path="/about" component={AboutPage} />
        </Route>
    </Router>
), document.getElementById("app"));

Add react-router path for abou

Add react-router path for abou

--- src/main.tsx
+++ src/main.tsx
@@ -9,6 +9,7 @@
 import SearchPage from "./components/search/SearchPage";
 import MapPage from "./components/map/MapPage";
 import MapEventList from "./components/map/MapEventList";
+import AboutPage from "./components/about/AboutPage";

 import { Router, Route, hashHistory, IndexRoute } from "react-router";
 injectTapEventPlugin();
@@ -37,6 +38,7 @@
             <Route path="/search" component={SearchPage} />
             <Route path="/map" component={MapPage} />
             <Route path="/building/:building/:room_or_stall" component={MapEventList} />
+            <Route path="/about" component={AboutPage} />
         </Route>
     </Router>
 ), document.getElementById("app"));

import * as React from "react";
import * as ReactDOM from "react-dom";
import * as injectTapEventPlugin from "react-tap-event-plugin";
import MenuBar from "./components/menu/MenuBar";
import SimpleContent from "./components/SimpleContent";
import TopPage from "./components/top/TopPage";
import EventPage from "./components/event/EventPage";
import StagePage from "./components/stage/StagePage";
import SearchPage from "./components/search/SearchPage";
import MapPage from "./components/map/MapPage";
import MapEventList from "./components/map/MapEventList";
import AboutPage from "./components/about/AboutPage";

import { Router, Route, hashHistory, IndexRoute } from "react-router";
injectTapEventPlugin();

interface Text {
    content: string;
}

class TestElement extends React.Component<Text, {}> {
    render() {
        return (
            <div className="test">
                <MenuBar appName="Shibaura Fes Navi" />
                {this.props.children || <TopPage />}
            </div>
        );
    }
}

ReactDOM.render((
    <Router history={hashHistory}>
        <Route path="/" component={TestElement}>
            <IndexRoute component={TopPage} />
            <Route path="/event" component={EventPage} />
            <Route path="/stage" component={StagePage} />
            <Route path="/search" component={SearchPage} />
            <Route path="/map" component={MapPage} />
            <Route path="/building/:building/:room_or_stall" component={MapEventList} />
        </Route>
    </Router>
), document.getElementById("app"));

<|original_code|>
import * as React from "react";
import * as ReactDOM from "react-dom";
import * as injectTapEventPlugin from "react-tap-event-plugin";
import MenuBar from "./components/menu/MenuBar";
import SimpleContent from "./components/SimpleContent";
import TopPage from "./components/top/TopPage";
import EventPage from "./components/event/EventPage";
import StagePage from "./components/stage/StagePage";
import SearchPage from "./components/search/SearchPage";
import MapPage from "./components/map/MapPage";
import MapEventList from "./components/map/MapEventList";

import { Router, Route, hashHistory, IndexRoute } from "react-router";
injectTapEventPlugin();

interface Text {
    content: string;
}

class TestElement extends React.Component<Text, {}> {
    render() {
        return (

                <MenuBar appName="Shibaura Fes Navi" />
                {this.props.children || <TopPage />}

        );
    }
}

ReactDOM.render((
    <Router history={hashHistory}>
        <Route path="/" component={TestElement}>
            <IndexRoute component={TopPage} />
            <Route path="/event" component={EventPage} />
            <Route path="/stage" component={StagePage} />
            <Route path="/search" component={SearchPage} />
            <Route path="/map" component={MapPage} />
            <Route path="/building/:building/:room_or_stall" component={MapEventList} />
        </Route>
    </Router>
), document.getElementById("app"));
<|edits_diff|>
--- src/main.tsx
+++ src/main.tsx
@@ -9,6 +9,7 @@
 import SearchPage from "./components/search/SearchPage";
 import MapPage from "./components/map/MapPage";
 import MapEventList from "./components/map/MapEventList";
+import AboutPage from "./components/about/AboutPage";

 import { Router, Route, hashHistory, IndexRoute } from "react-router";
 injectTapEventPlugin();
<|current_version|>
import * as React from "react";
import * as ReactDOM from "react-dom";
import * as injectTapEventPlugin from "react-tap-event-plugin";
import MenuBar from "./components/menu/MenuBar";
import SimpleContent from "./components/SimpleContent";
import TopPage from "./components/top/TopPage";
import EventPage from "./components/event/EventPage";
import StagePage from "./components/stage/StagePage";
import SearchPage from "./components/search/SearchPage";
import MapPage from "./components/map/MapPage";
import MapEventList from "./components/map/MapEventList";
import AboutPage from "./components/about/AboutPage";

import { Router, Route, hashHistory, IndexRoute } from "react-router";
injectTapEventPlugin();

interface Text {
    content: string;
}

class TestElement extends React.Component<Text, {}> {
    render() {
        return (

                <MenuBar appName="Shibaura Fes Navi" />
                {this.props.children || <TopPage />}

        );
    }
}

ReactDOM.render((
    <Router history={hashHistory}>
        <Route path="/" component={TestElement}>
            <IndexRoute component={TopPage} />
            <Route path="/event" component={EventPage} />
            <Route path="/stage" component={StagePage} />
            <Route path="/search" component={SearchPage} />
            <Route path="/map" component={MapPage} />
            <Route path="/building/:building/:room_or_stall" component={MapEventList} />
        </Route>
    </Router>
), document.getElementById("app"));
<|next_version|>
import * as React from "react";
import * as ReactDOM from "react-dom";
import * as injectTapEventPlugin from "react-tap-event-plugin";
import MenuBar from "./components/menu/MenuBar";
import SimpleContent from "./components/SimpleContent";
import TopPage from "./components/top/TopPage";
import EventPage from "./components/event/EventPage";
import StagePage from "./components/stage/StagePage";
import SearchPage from "./components/search/SearchPage";
import MapPage from "./components/map/MapPage";
import MapEventList from "./components/map/MapEventList";
import AboutPage from "./components/about/AboutPage";

import { Router, Route, hashHistory, IndexRoute } from "react-router";
injectTapEventPlugin();

interface Text {
    content: string;
}

class TestElement extends React.Component<Text, {}> {
    render() {
        return (

                <MenuBar appName="Shibaura Fes Navi" />
                {this.props.children || <TopPage />}

        );
    }
}

ReactDOM.render((
    <Router history={hashHistory}>
        <Route path="/" component={TestElement}>
            <IndexRoute component={TopPage} />
            <Route path="/event" component={EventPage} />
            <Route path="/stage" component={StagePage} />
            <Route path="/search" component={SearchPage} />
            <Route path="/map" component={MapPage} />
            <Route path="/building/:building/:room_or_stall" component={MapEventList} />
            <Route path="/about" component={AboutPage} />
        </Route>
    </Router>
), document.getElementById("app"));


Add a proxy response type.

Add a proxy response type.

--- src/Types.ts
+++ src/Types.ts
@@ -1,3 +1,12 @@
+import { IncomingMessage } from 'http';
+import { Buffer } from 'buffer';
+
+
 export type Map<T> = {[key: string]: T};

 export type HttpVerb = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS' | 'PATCH';
+
+export interface ProxyResponse {
+    message: IncomingMessage,
+    body: string | Buffer
+}

<|original_code|>
export type Map<T> = {[key: string]: T};

export type HttpVerb = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS' | 'PATCH';

<|edits_diff|>
--- src/Types.ts
+++ src/Types.ts
@@ -1,3 +1,7 @@
+import { IncomingMessage } from 'http';
+import { Buffer } from 'buffer';
+
+
 export type Map<T> = {[key: string]: T};

 export type HttpVerb = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS' | 'PATCH';
<|current_version|>
import { IncomingMessage } from 'http';
import { Buffer } from 'buffer';

export type Map<T> = {[key: string]: T};

export type HttpVerb = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS' | 'PATCH';

<|next_version|>
import { IncomingMessage } from 'http';
import { Buffer } from 'buffer';

export type Map<T> = {[key: string]: T};

export type HttpVerb = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS' | 'PATCH';

export interface ProxyResponse {
    message: IncomingMessage,
    body: string | Buffer
}


Add more ignore patterns to ocamldoc parser

--- src/shared/parser/ocamldoc/index.ts
+++ src/shared/parser/ocamldoc/index.ts
@@ -1,9 +1,11 @@
 const parser = require("./grammar"); // tslint:disable-line

 export const ignore = new RegExp([
+  /^Needed cmti file of module/,
   /^No documentation available/,
   /^Not a valid identifier/,
   /^Not in environment '.*'/,
+  /^didn't manage to find/,
 ].map((rx) => rx.source).join("|"));

 export function intoMarkdown(ocamldoc: string): string {

<|original_code|>
const parser = require("./grammar"); // tslint:disable-line

export const ignore = new RegExp([
  /^No documentation available/,
  /^Not a valid identifier/,
  /^Not in environment '.*'/,
].map((rx) => rx.source).join("|"));

export function intoMarkdown(ocamldoc: string): string {
  let result = ocamldoc;
  try {
    result = parser.parse(ocamldoc);
  } catch (err) {
    //
  }
  return result;
}

<|edits_diff|>
--- src/shared/parser/ocamldoc/index.ts
+++ src/shared/parser/ocamldoc/index.ts
@@ -1,6 +1,7 @@
 const parser = require("./grammar"); // tslint:disable-line

 export const ignore = new RegExp([
+  /^Needed cmti file of module/,
   /^No documentation available/,
   /^Not a valid identifier/,
   /^Not in environment '.*'/,
<|current_version|>
const parser = require("./grammar"); // tslint:disable-line

export const ignore = new RegExp([
  /^Needed cmti file of module/,
  /^No documentation available/,
  /^Not a valid identifier/,
  /^Not in environment '.*'/,
].map((rx) => rx.source).join("|"));

export function intoMarkdown(ocamldoc: string): string {
  let result = ocamldoc;
  try {
    result = parser.parse(ocamldoc);
  } catch (err) {
    //
  }
  return result;
}

<|next_version|>
const parser = require("./grammar"); // tslint:disable-line

export const ignore = new RegExp([
  /^Needed cmti file of module/,
  /^No documentation available/,
  /^Not a valid identifier/,
  /^Not in environment '.*'/,
  /^didn't manage to find/,
].map((rx) => rx.source).join("|"));

export function intoMarkdown(ocamldoc: string): string {
  let result = ocamldoc;
  try {
    result = parser.parse(ocamldoc);
  } catch (err) {
    //
  }
  return result;
}


Remove IDs from group children

Remove IDs from group children

--- src/helpers/export.ts
+++ src/helpers/export.ts
@@ -2,10 +2,14 @@
 import type { CommandType } from "../data/templates"
 import type { Snippet } from "../classes/Snippets/SnippetTypes/Snippet"
 import { duplicate_snippet } from "./duplicate_snippet"
+import { GroupSnippet } from "../classes/Snippets/SnippetTypes/GroupSnippet";

 function strip_id(snippet: Snippet): Snippet {
   delete snippet.id;
   snippet.hover_event_children = snippet.hover_event_children.map(child => strip_id(child));
+  if (snippet instanceof GroupSnippet) {
+    snippet.children = snippet.children.map(child => strip_id(child));
+  }
   return snippet;
 }

<|original_code|>
import { VERSION } from "../constants"
import type { CommandType } from "../data/templates"
import type { Snippet } from "../classes/Snippets/SnippetTypes/Snippet"
import { duplicate_snippet } from "./duplicate_snippet"

function strip_id(snippet: Snippet): Snippet {
  delete snippet.id;
  snippet.hover_event_children = snippet.hover_event_children.map(child => strip_id(child));
  return snippet;
}

export function export_snippets(snippets: Array<Snippet>, command: string, type: CommandType): string {
  const snippets_stripped = snippets
    .map(snippet => duplicate_snippet(snippet))
    .map(snippet => strip_id(snippet));

  const data = {
    "jformat": VERSION,
    "jobject": snippets_stripped,
    "command": command,
    "jtemplate": type
  }

  return JSON.stringify(data)
}
<|edits_diff|>
--- src/helpers/export.ts
+++ src/helpers/export.ts
@@ -2,6 +2,7 @@
 import type { CommandType } from "../data/templates"
 import type { Snippet } from "../classes/Snippets/SnippetTypes/Snippet"
 import { duplicate_snippet } from "./duplicate_snippet"
+import { GroupSnippet } from "../classes/Snippets/SnippetTypes/GroupSnippet";

 function strip_id(snippet: Snippet): Snippet {
   delete snippet.id;
<|current_version|>
import { VERSION } from "../constants"
import type { CommandType } from "../data/templates"
import type { Snippet } from "../classes/Snippets/SnippetTypes/Snippet"
import { duplicate_snippet } from "./duplicate_snippet"
import { GroupSnippet } from "../classes/Snippets/SnippetTypes/GroupSnippet";

function strip_id(snippet: Snippet): Snippet {
  delete snippet.id;
  snippet.hover_event_children = snippet.hover_event_children.map(child => strip_id(child));
  return snippet;
}

export function export_snippets(snippets: Array<Snippet>, command: string, type: CommandType): string {
  const snippets_stripped = snippets
    .map(snippet => duplicate_snippet(snippet))
    .map(snippet => strip_id(snippet));

  const data = {
    "jformat": VERSION,
    "jobject": snippets_stripped,
    "command": command,
    "jtemplate": type
  }

  return JSON.stringify(data)
}
<|next_version|>
import { VERSION } from "../constants"
import type { CommandType } from "../data/templates"
import type { Snippet } from "../classes/Snippets/SnippetTypes/Snippet"
import { duplicate_snippet } from "./duplicate_snippet"
import { GroupSnippet } from "../classes/Snippets/SnippetTypes/GroupSnippet";

function strip_id(snippet: Snippet): Snippet {
  delete snippet.id;
  snippet.hover_event_children = snippet.hover_event_children.map(child => strip_id(child));
  if (snippet instanceof GroupSnippet) {
    snippet.children = snippet.children.map(child => strip_id(child));
  }
  return snippet;
}

export function export_snippets(snippets: Array<Snippet>, command: string, type: CommandType): string {
  const snippets_stripped = snippets
    .map(snippet => duplicate_snippet(snippet))
    .map(snippet => strip_id(snippet));

  const data = {
    "jformat": VERSION,
    "jobject": snippets_stripped,
    "command": command,
    "jtemplate": type
  }

  return JSON.stringify(data)
}


Add routing path for EnvironmentComponent.

--- step-release-vis/src/app/app-routing.module.ts
+++ step-release-vis/src/app/app-routing.module.ts
@@ -3,11 +3,13 @@
 import {HomeComponent} from './components/home/home';
 import {SvgGridComponent} from './components/grid/svg/svg';
 import {CanvasGridComponent} from './components/grid/canvas/canvas';
+import {EnvironmentComponent} from './components/environment/environment';

 const routes: Routes = [
   {path: '', component: HomeComponent},
   {path: 'svg', component: SvgGridComponent},
   {path: 'canvas', component: CanvasGridComponent},
+  {path: 'env', component: EnvironmentComponent},
 ];

 @NgModule({

<|original_code|>
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {HomeComponent} from './components/home/home';
import {SvgGridComponent} from './components/grid/svg/svg';
import {CanvasGridComponent} from './components/grid/canvas/canvas';

const routes: Routes = [
  {path: '', component: HomeComponent},
  {path: 'svg', component: SvgGridComponent},
  {path: 'canvas', component: CanvasGridComponent},
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule],
})
export class AppRoutingModule {}

<|edits_diff|>
--- step-release-vis/src/app/app-routing.module.ts
+++ step-release-vis/src/app/app-routing.module.ts
@@ -3,6 +3,7 @@
 import {HomeComponent} from './components/home/home';
 import {SvgGridComponent} from './components/grid/svg/svg';
 import {CanvasGridComponent} from './components/grid/canvas/canvas';
+import {EnvironmentComponent} from './components/environment/environment';

 const routes: Routes = [
   {path: '', component: HomeComponent},
<|current_version|>
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {HomeComponent} from './components/home/home';
import {SvgGridComponent} from './components/grid/svg/svg';
import {CanvasGridComponent} from './components/grid/canvas/canvas';
import {EnvironmentComponent} from './components/environment/environment';

const routes: Routes = [
  {path: '', component: HomeComponent},
  {path: 'svg', component: SvgGridComponent},
  {path: 'canvas', component: CanvasGridComponent},
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule],
})
export class AppRoutingModule {}

<|next_version|>
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {HomeComponent} from './components/home/home';
import {SvgGridComponent} from './components/grid/svg/svg';
import {CanvasGridComponent} from './components/grid/canvas/canvas';
import {EnvironmentComponent} from './components/environment/environment';

const routes: Routes = [
  {path: '', component: HomeComponent},
  {path: 'svg', component: SvgGridComponent},
  {path: 'canvas', component: CanvasGridComponent},
  {path: 'env', component: EnvironmentComponent},
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule],
})
export class AppRoutingModule {}


Add debug logging for cache hit and miss

--- loaders/LoaderEntriesCache.ts
+++ loaders/LoaderEntriesCache.ts
@@ -44,8 +44,11 @@

   private async getEntries(): Promise<Entry[]> {
     if (this.cachedEntries !== null) {
+      console.debug(`Cache hit for key ${this.#cacheKey}`)
       return this.cachedEntries
     }
+
+    console.debug(`Cache miss for key ${this.#cacheKey}`)

     const entries = await this.entriesReloader()
     this.cachedEntries = entries

<|original_code|>
import { Cache, CacheClass } from "memory-cache"

export type EntriesReloader<Entry> = () => Promise<Entry[]>

export class LoaderEntriesCache<Entry> {
  get entries(): Promise<Entry[]> {
    return this.getEntries()
  }

  readonly timeout: number

  private get cachedEntries(): Entry[] | null {
    return this.#cache.get(this.#cacheKey)
  }

  private set cachedEntries(entries: Entry[] | null) {
    if (entries === null) {
      this.#cache.del(this.#cacheKey)
    } else {
      this.#cache.put(this.#cacheKey, entries, this.timeout)
    }
  }

  private entriesReloader: EntriesReloader<Entry>

  #cache: CacheClass<string, Entry[]>

  #cacheKey: string

  /**
   *
   * @param timeout The time in ms for cached values to be valid for. Defaults to 6 hours.
   */
  constructor(
    entriesReloader: EntriesReloader<Entry>,
    key: string,
    timeout: number = 6 * 60 * 1000,
  ) {
    this.entriesReloader = entriesReloader
    this.#cache = new Cache()
    this.#cacheKey = key
    this.timeout = timeout
  }

  private async getEntries(): Promise<Entry[]> {
    if (this.cachedEntries !== null) {
      return this.cachedEntries
    }

    const entries = await this.entriesReloader()
    this.cachedEntries = entries

    return entries
  }
}

<|edits_diff|>
--- loaders/LoaderEntriesCache.ts
+++ loaders/LoaderEntriesCache.ts
@@ -44,6 +44,7 @@

   private async getEntries(): Promise<Entry[]> {
     if (this.cachedEntries !== null) {
+      console.debug(`Cache hit for key ${this.#cacheKey}`)
       return this.cachedEntries
     }

<|current_version|>
import { Cache, CacheClass } from "memory-cache"

export type EntriesReloader<Entry> = () => Promise<Entry[]>

export class LoaderEntriesCache<Entry> {
  get entries(): Promise<Entry[]> {
    return this.getEntries()
  }

  readonly timeout: number

  private get cachedEntries(): Entry[] | null {
    return this.#cache.get(this.#cacheKey)
  }

  private set cachedEntries(entries: Entry[] | null) {
    if (entries === null) {
      this.#cache.del(this.#cacheKey)
    } else {
      this.#cache.put(this.#cacheKey, entries, this.timeout)
    }
  }

  private entriesReloader: EntriesReloader<Entry>

  #cache: CacheClass<string, Entry[]>

  #cacheKey: string

  /**
   *
   * @param timeout The time in ms for cached values to be valid for. Defaults to 6 hours.
   */
  constructor(
    entriesReloader: EntriesReloader<Entry>,
    key: string,
    timeout: number = 6 * 60 * 1000,
  ) {
    this.entriesReloader = entriesReloader
    this.#cache = new Cache()
    this.#cacheKey = key
    this.timeout = timeout
  }

  private async getEntries(): Promise<Entry[]> {
    if (this.cachedEntries !== null) {
      console.debug(`Cache hit for key ${this.#cacheKey}`)
      return this.cachedEntries
    }

    const entries = await this.entriesReloader()
    this.cachedEntries = entries

    return entries
  }
}

<|next_version|>
import { Cache, CacheClass } from "memory-cache"

export type EntriesReloader<Entry> = () => Promise<Entry[]>

export class LoaderEntriesCache<Entry> {
  get entries(): Promise<Entry[]> {
    return this.getEntries()
  }

  readonly timeout: number

  private get cachedEntries(): Entry[] | null {
    return this.#cache.get(this.#cacheKey)
  }

  private set cachedEntries(entries: Entry[] | null) {
    if (entries === null) {
      this.#cache.del(this.#cacheKey)
    } else {
      this.#cache.put(this.#cacheKey, entries, this.timeout)
    }
  }

  private entriesReloader: EntriesReloader<Entry>

  #cache: CacheClass<string, Entry[]>

  #cacheKey: string

  /**
   *
   * @param timeout The time in ms for cached values to be valid for. Defaults to 6 hours.
   */
  constructor(
    entriesReloader: EntriesReloader<Entry>,
    key: string,
    timeout: number = 6 * 60 * 1000,
  ) {
    this.entriesReloader = entriesReloader
    this.#cache = new Cache()
    this.#cacheKey = key
    this.timeout = timeout
  }

  private async getEntries(): Promise<Entry[]> {
    if (this.cachedEntries !== null) {
      console.debug(`Cache hit for key ${this.#cacheKey}`)
      return this.cachedEntries
    }

    console.debug(`Cache miss for key ${this.#cacheKey}`)

    const entries = await this.entriesReloader()
    this.cachedEntries = entries

    return entries
  }
}