build: fix build

This commit is contained in:
2024-08-02 13:14:33 +03:00
parent 78a6889e26
commit 42516469bc
17 changed files with 43 additions and 20 deletions

View File

@@ -36,12 +36,27 @@ jobs:
- build
- test
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
release-type: node
- run: npm publish
publish:
needs: release
runs-on: ubuntu-latest
if: ${{ needs.release.outputs.release_created }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm i -g pnpm
- run: pnpm run ci
- run: pnpm build
- run: cd build && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.release.outputs.release_created }}

3
.gitignore vendored
View File

@@ -128,3 +128,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# Output files
build/

View File

@@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"ci": "pnpm install --frozen-lockfile",
"build": "tsc",
"build": "rm -rf build && tsc && cp package.json README.md build/",
"test": "jest"
},
"keywords": [

View File

@@ -1,4 +1,4 @@
import { MegaHAL } from '@/megahal'
import { MegaHAL } from '../megahal'
MegaHAL.addPersonality('aliens', [
"Hello there, it is indeed a great pleasure to meet you. I'm Bishop.",

View File

@@ -1,4 +1,4 @@
import { MegaHAL } from '@/megahal'
import { MegaHAL } from '../megahal'
MegaHAL.addPersonality('bill', [
'Thank you for coming, I can now take your questions.',

View File

@@ -1,4 +1,4 @@
import { MegaHAL } from '@/megahal'
import { MegaHAL } from '../megahal'
MegaHAL.addPersonality('caitsith', [
'Hello there, it is indeed a great pleasure to meet you.',

View File

@@ -1,4 +1,4 @@
import { MegaHAL } from '@/megahal'
import { MegaHAL } from '../megahal'
MegaHAL.addPersonality('default', [
'Hello there, it is indeed a great pleasure to meet you.',

View File

@@ -1,4 +1,4 @@
import { MegaHAL } from '@/megahal'
import { MegaHAL } from '../megahal'
MegaHAL.addPersonality('ferris', [
"Hello there, it is indeed a great pleasure to meet you. I'm Ferris.",

View File

@@ -1,4 +1,4 @@
import { MegaHAL } from '@/megahal'
import { MegaHAL } from '../megahal'
MegaHAL.addPersonality('manson', [
'Anti choice',

View File

@@ -1,4 +1,4 @@
import { MegaHAL } from '@/megahal'
import { MegaHAL } from '../megahal'
MegaHAL.addPersonality('pepys', [
`I was sent for to the Privy Seal, whither I was forced to go and stay so long and late that I was much vexed.`,

View File

@@ -1,4 +1,4 @@
import { MegaHAL } from '@/megahal'
import { MegaHAL } from '../megahal'
MegaHAL.addPersonality('pulp', [
`Hello there, it is indeed a great pleasure to meet you. I'm Marsellus.`,

View File

@@ -1,4 +1,4 @@
import { MegaHAL } from '@/megahal'
import { MegaHAL } from '../megahal'
MegaHAL.addPersonality('scream', [
`Hello there, it is indeed a great pleasure to meet you. I'm Randy.`,

View File

@@ -1,4 +1,4 @@
import { MegaHAL } from '@/megahal'
import { MegaHAL } from '../megahal'
MegaHAL.addPersonality('sherlock', [
'I think, Watson, that you have put on seven and a half pounds since I saw you.',

View File

@@ -1,4 +1,4 @@
import { MegaHAL } from '@/megahal'
import { MegaHAL } from '../megahal'
MegaHAL.addPersonality('startrek', [
`Hello, it is indeed a great pleasure to meet you. I am Lt. Commander Data. `,

View File

@@ -1,4 +1,4 @@
import { MegaHAL } from '@/megahal'
import { MegaHAL } from '../megahal'
MegaHAL.addPersonality('starwars', [
`Hello there, it is indeed a great pleasure to meet you. I'm Threepio.`,

View File

@@ -1,7 +1,7 @@
import fs from 'node:fs/promises'
import path from 'node:path'
import os from 'node:os'
import MegaHAL from '@/index'
import MegaHAL from '../src/index'
import '@/personalities/sherlock'
describe('megahal', () => {

View File

@@ -1,4 +1,7 @@
{
"include": [
"src/**/*"
],
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
@@ -26,9 +29,11 @@
// "rootDir": "./", /* Specify the root folder within your source files. */
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
"baseUrl": "./src" /* Specify the base directory to resolve non-relative module names. */,
"paths": {
"@/*": ["./*"]
} /* Specify a set of entries that re-map imports to additional lookup locations. */,
// "paths": {
// "@/*": [
// "./*"
// ]
// } /* Specify a set of entries that re-map imports to additional lookup locations. */,
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
@@ -46,7 +51,7 @@
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */