Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Configure Renovate #1

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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ We can easy to setup own Alexa custom skill with TypeScript and AWS CloudFormati
## Usage

```
% ask new --template-url https://github.com/ask-utils/talkyjs-alexa-skill-template-helloworld.git
% ask new --template-url https://github.com/talkyjs/talkyjs-alexa-skill-template-helloworld.git

Please follow the wizard to start your Alexa skill project ->
? Choose a method to host your skill's backend resources:
[Warn]: CLI is about to download the skill template from unofficial template https://github.com/ask-utils/talkyjs-alexa-skill-template-helloworld.git. Please make sure you understand the source code to best protect yourself
? Choose a method to host your skill's backend resources: (Use arrow keys)
❯ Alexa-hosted skills
Host your skill code by Alexa (free).
AWS with CloudFormation
Host your skill code with AWS services and provision with AWS CloudFormation (requires AWS account)
AWS Lambda
Host your skill code on AWS Lambda (requires AWS account).
──────────────
self-hosted and manage your own hosting

[Warn]: CLI is about to download the skill template from unofficial template https://github.com//talkyjs/talkyjs-alexa-skill-template-helloworld.git. Please make sure you understand the source code to best protect yourself
from malicious usage.
? Would you like to continue download the skill template? Yes
? Please type in your skill name: talkyjs-alexa-skill-template-helloworld
Expand Down
21 changes: 0 additions & 21 deletions lambda/.npmignore

This file was deleted.

11 changes: 7 additions & 4 deletions lambda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
"author": "TalkyJS team",
"license": "MIT",
"dependencies": {
"@talkyjs/core": "0.x",
"@ask-utils/router": "3.x",
"@ask-utils/speech-script": "3.x",
"@talkyjs/core": "1.x",
"@talkyjs/ssml": "0.2.0",
"ask-sdk-core": "^2.6.0",
"ask-sdk-model": "^1.18.0"
"ask-sdk-model": "^1.18.0",
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"directories": {
"lib": "src",
Expand Down Expand Up @@ -49,6 +50,8 @@
"@ask-utils/test": "3.x",
"@types/jest": "^25.2.1",
"@types/node": "^13.13.5",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/webpack": "^4.41.12",
"jest": "^26.0.1",
"source-map-support": "^0.5.19",
Expand Down
2 changes: 1 addition & 1 deletion lambda/src/HelpIntent/HelpIntent.router.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Router } from "@ask-utils/router";
import { Router } from "@talkyjs/core";

import { HelpIntentScript } from './HelpIntent.speech'

Expand Down
7 changes: 2 additions & 5 deletions lambda/src/HelpIntent/HelpIntent.speech.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/** @jsx ssml */
import {
ssml,
SpeechScriptJSX,
} from '@ask-utils/speech-script'
import React from 'react';
import { SpeechScriptJSX } from '@talkyjs/ssml'

export class HelpIntentScript extends SpeechScriptJSX {
speech() {
Expand Down
2 changes: 1 addition & 1 deletion lambda/src/HelpIntent/tests/HelpIntent.router.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HandlerInputCreator } from '@ask-utils/test';
import { RequestHandlerFactory } from '@ask-utils/router';
import { RequestHandlerFactory } from '@talkyjs/core';
import { RequestHandler } from 'ask-sdk-core';
import { HelpIntentRouter } from '../HelpIntent.router'

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`HelpIntentRouter canHandle should return false when given a not IntentRequest 1`] = `true`;

exports[`HelpIntentRouter handle should match snapshot 1`] = `
Object {
"outputSpeech": Object {
"ssml": "<speak><p>Hello! It's a nice development. How are you?</p></speak>",
"type": "SSML",
},
"reprompt": Object {
"outputSpeech": Object {
"ssml": "<speak><p>How are you?</p></speak>",
"type": "SSML",
},
},
"shouldEndSession": false,
}
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`HelpIntentScript should return false when given a not IntentRequest 1`] = `
Object {
"outputSpeech": Object {
"ssml": "<speak><p>Hello! It's a nice development. How are you?</p></speak>",
"type": "SSML",
},
"reprompt": Object {
"outputSpeech": Object {
"ssml": "<speak><p>How are you?</p></speak>",
"type": "SSML",
},
},
"shouldEndSession": false,
}
`;
6 changes: 4 additions & 2 deletions lambda/src/LaunchRequest/LaunchRequest.router.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Router } from "@ask-utils/router";
import { Router } from "@talkyjs/core";

import { LaunchRequestScript } from './LaunchRequest.speech'

Expand All @@ -9,7 +9,9 @@ export const LaunchRequestRouter: Router = {
handler: async (handlerInput) => {


const script = new LaunchRequestScript(handlerInput)
const script = new LaunchRequestScript(handlerInput, {
dummyProps: "It's a nice development."
})
return script
.createResponseBuilder()
.getResponse();
Expand Down
16 changes: 9 additions & 7 deletions lambda/src/LaunchRequest/LaunchRequest.speech.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
/** @jsx ssml */
import {
ssml,
SpeechScriptJSX,
} from '@ask-utils/speech-script'
import React from 'react';
import { SpeechScriptJSXWithOption } from '@talkyjs/ssml'

export class LaunchRequestScript extends SpeechScriptJSX {
export class LaunchRequestScript extends SpeechScriptJSXWithOption<{
dummyProps: string;
}> {
speech() {
return (
<speak>
<p>Hello! It's a nice development. How are you?</p>
<p>
<amazon-emotion name="excited" intensity="high">Hello!</amazon-emotion>
{this.options.dummyProps} How are you?
</p>
</speak>
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HandlerInputCreator } from '@ask-utils/test';
import { RequestHandlerFactory } from '@ask-utils/router';
import { RequestHandlerFactory } from '@talkyjs/core';
import { RequestHandler } from 'ask-sdk-core';
import { LaunchRequestRouter } from '../LaunchRequest.router'

Expand Down
4 changes: 3 additions & 1 deletion lambda/src/LaunchRequest/tests/LaunchRequest.speech.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ describe('LaunchRequestScript', () => {
name: "LaunchRequest",
confirmationStatus: 'NONE'
});
const script = new LaunchRequestScript(handlerInput);
const script = new LaunchRequestScript(handlerInput, {
dummyProps: "It's a nice development."
});
expect(script.createResponse()).toMatchSnapshot();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`LaunchRequestRouter canHandle should return false when given a not IntentRequest 1`] = `false`;

exports[`LaunchRequestRouter handle should match snapshot 1`] = `
Object {
"outputSpeech": Object {
"ssml": "<speak><p><amazon:emotion name=\\"excited\\" intensity=\\"high\\">Hello!</amazon:emotion>It's a nice development. How are you?</p></speak>",
"type": "SSML",
},
"reprompt": Object {
"outputSpeech": Object {
"ssml": "<speak><p>How are you?</p></speak>",
"type": "SSML",
},
},
"shouldEndSession": false,
}
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`LaunchRequestScript should return false when given a not IntentRequest 1`] = `
Object {
"outputSpeech": Object {
"ssml": "<speak><p><amazon:emotion name=\\"excited\\" intensity=\\"high\\">Hello!</amazon:emotion>It's a nice development. How are you?</p></speak>",
"type": "SSML",
},
"reprompt": Object {
"outputSpeech": Object {
"ssml": "<speak><p>How are you?</p></speak>",
"type": "SSML",
},
},
"shouldEndSession": false,
}
`;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Router } from "@ask-utils/router";
import { Router } from "@talkyjs/core";

import { StopAndCancelAndNoIntentScript } from './StopAndCancelAndNoIntent.speech'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/** @jsx ssml */
import {
ssml,
SpeechScriptJSX,
} from '@ask-utils/speech-script'
import React from 'react';
import { SpeechScriptJSX } from '@talkyjs/ssml'

export class StopAndCancelAndNoIntentScript extends SpeechScriptJSX {
speech() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HandlerInputCreator } from '@ask-utils/test';
import { RequestHandlerFactory } from '@ask-utils/router';
import { RequestHandlerFactory } from '@talkyjs/core';
import { RequestHandler } from 'ask-sdk-core';
import { StopAndCancelAndNoIntentRouter } from '../StopAndCancelAndNoIntent.router'

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`StopAndCancelAndNoIntentRouter canHandle should match the snapshot of the "AMAZON.CancelIntent" IntentRequest 1`] = `true`;

exports[`StopAndCancelAndNoIntentRouter canHandle should match the snapshot of the "AMAZON.NoIntent" IntentRequest 1`] = `true`;

exports[`StopAndCancelAndNoIntentRouter canHandle should match the snapshot of the "AMAZON.StopIntent" IntentRequest 1`] = `true`;

exports[`StopAndCancelAndNoIntentRouter handle should match snapshot 1`] = `
Object {
"outputSpeech": Object {
"ssml": "<speak><p>Good-bye!</p></speak>",
"type": "SSML",
},
}
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`StopAndCancelAndNoIntentScript should match the snapshot of the "AMAZON.CancelIntent" IntentRequest 1`] = `
Object {
"outputSpeech": Object {
"ssml": "<speak><p>Good-bye!</p></speak>",
"type": "SSML",
},
}
`;

exports[`StopAndCancelAndNoIntentScript should match the snapshot of the "AMAZON.NoIntent" IntentRequest 1`] = `
Object {
"outputSpeech": Object {
"ssml": "<speak><p>Good-bye!</p></speak>",
"type": "SSML",
},
}
`;

exports[`StopAndCancelAndNoIntentScript should match the snapshot of the "AMAZON.StopIntent" IntentRequest 1`] = `
Object {
"outputSpeech": Object {
"ssml": "<speak><p>Good-bye!</p></speak>",
"type": "SSML",
},
}
`;
14 changes: 9 additions & 5 deletions lambda/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ import { StopAndCancelAndNoIntentRouter } from './StopAndCancelAndNoIntent/StopA
const config: TalkyJSSkillConfig = {
stage: 'development', // [Optional] Skill Stage
logLevel: 'info', // [Optional] Log level
database: { // [Optional] Database configuration
type: "s3", // [Optional] Database type (none / s3 / dynamodb)
tableName: "PUT_YOUR_DB_NAME", // [Optional] Database table name
// s3PathPrefix: '' // [Optional] [Only S3] S3 path prefix
//database: { // [Optional] Database configuration
// type: "none", // [Optional] Database type (none / s3 / dynamodb)
// tableName: '', // [Optional] Database table name
// s3PathPrefix: '' // [Optional] [Only S3] S3 path prefix
//},
apiClient: { // SMAPI and Alexa API Client configuration
useDefault: true, // Use DefaultApiClient
// client: new DefaultApiClient() // If you have own ApiClient, put here
},
// skillId: '', // [Optional] Skill ID
errorHandler: { // [Optional] error handler configurations
Expand Down Expand Up @@ -51,4 +55,4 @@ export const createSkillHandler = (skill: CustomSkillBuilder = skillBuilder): Sk
* @param event
* @param context
*/
export const handler: SkillHandler = createSkillHandler()
export const handler: SkillHandler = createSkillHandler()
Loading