This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { glob } from 'glob' | |
import { readFile, writeFile } from 'fs/promises' | |
import path from 'path'; | |
export function addFileExtension(importStatement) { | |
const staticImportRegex = /(import\s+(?:.+\s+from\s+)?['"])(\.\/[^'\"]+)(?<!\.js)(['"])/g; | |
const dynamicImportRegex = /(import\(['"])(\.\/[^'\"]+)(?<!\.js)(['"]\))/g; | |
const reexportRegex = /(export .+ from ['"])(\.\/[^'\"]+)(?<!\.js)(['"])/g; | |
importStatement = importStatement.replace(staticImportRegex, "$1$2.js$3"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.23/tailwind.min.css" rel="stylesheet" /> | |
<header class="bg-blue-500"> | |
<div class="container mx-auto flex justify-between items-center py-5"> | |
<a href="/" class="text-white font-bold text-xl">My Website</a> | |
<nav class="flex items-center"> | |
<a href="/about" class="text-white mr-8">About</a> | |
<a href="/contact" class="text-white">Contact</a> | |
</nav> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>My E-commerce Website</title> | |
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.16/dist/tailwind.min.css" rel="stylesheet"> | |
</head> | |
<body> | |
<nav class="bg-blue-500 p-6"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as fs from 'fs' | |
class GameSampleMap { | |
// Pourrait-on avoir un décorateur @GameMap() au lieu des deux propriétés ? | |
id = 'mymap' | |
file = './maps/map.tiled' | |
// --- | |
// mettez les types. | |
layers = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { RpgEvent, EventData, RpgPlayer } from '@rpgjs/server' | |
import { NlpManager } from 'node-nlp' | |
const trainNpc = async () => { | |
const manager = new NlpManager({ languages: ['en'], forceNER: true }); | |
manager.addDocument('en', 'goodbye for now', 'greetings.bye'); | |
manager.addDocument('en', 'bye bye take care', 'greetings.bye'); | |
manager.addDocument('en', 'okay see you later', 'greetings.bye'); | |
manager.addDocument('en', 'bye for now', 'greetings.bye'); | |
manager.addDocument('en', 'i must go', 'greetings.bye'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { RpgClient, RpgModule, RpgSceneMap } from '@rpgjs/client' | |
import { Characters } from './characters/characters'; | |
import { MapTilesets } from './maps/map'; | |
import prompt from './gui/prompt.vue' | |
@RpgModule<RpgClient>({ | |
spritesheets: [ | |
MapTilesets, | |
Characters | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div id="prompt"> | |
<rpg-window position="middle"> | |
<p>{{ text }}</p> | |
<input type="text" v-model="promptText"> | |
<p class="small">(Enter to validate)</p> | |
</rpg-window> | |
</div> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Intent('greeting') | |
greeting() { | |
> Hello ! | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
import code from './main.converse' | |
const SERVER_ACCESS_TOKEN = '' | |
export default { | |
code, | |
nlp: { | |
async witAi(text) { | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Intent('booking', [ | |
'I want to book accommodation today', | |
'I get a room' | |
]) | |
book() { | |
if (unknown :intent.date) { | |
> Start again by giving a date | |
return | |
} | |
> Ok, I take your order { :intent.date.value } |
NewerOlder