From 857e9b2e16b4cee9f6286d173532c74e5005932b Mon Sep 17 00:00:00 2001 From: Nulo Date: Wed, 22 Sep 2021 19:32:17 -0300 Subject: [PATCH] TypeScript y Prettier --- .gitignore | 2 ++ .prettierignore | 2 ++ demo/index.html | 8 ++++++++ index.ts | 3 +++ package.json | 10 +++++++++- pnpm-lock.yaml | 28 ++++++++++++++++++++++++++++ tsconfig.json | 19 +++++++++++++++++++ 7 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .prettierignore create mode 100644 demo/index.html create mode 100644 index.ts create mode 100644 pnpm-lock.yaml create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e2e84b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build/ +node_modules/ diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..25e5f67 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +pnpm-lock.yaml +build/ diff --git a/demo/index.html b/demo/index.html new file mode 100644 index 0000000..8620ab4 --- /dev/null +++ b/demo/index.html @@ -0,0 +1,8 @@ + + +hyperpop.js demo + + diff --git a/index.ts b/index.ts new file mode 100644 index 0000000..8b8c604 --- /dev/null +++ b/index.ts @@ -0,0 +1,3 @@ +export function prueba() { + console.log("¡Hola desde hyperpop.js!"); +} diff --git a/package.json b/package.json index 5420868..2bc7f73 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,10 @@ "description": "Un cliente de API de https://github.com/TangoSoftware/ApiTiendas", "main": "index.js", "scripts": { + "build": "tsc", + "watch-build": "tsc --watch", + "format": "prettier --write .", + "check-format": "prettier --check .", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { @@ -15,5 +19,9 @@ "api" ], "author": "Sutty ", - "license": "SEE LICENSE IN LICENSE" + "license": "SEE LICENSE IN LICENSE", + "devDependencies": { + "prettier": "^2.4.1", + "typescript": "^4.4.3" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..84c18b1 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,28 @@ +lockfileVersion: 5.3 + +specifiers: + prettier: ^2.4.1 + typescript: ^4.4.3 + +devDependencies: + prettier: 2.4.1 + typescript: 4.4.3 + +packages: + /prettier/2.4.1: + resolution: + { + integrity: sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==, + } + engines: { node: ">=10.13.0" } + hasBin: true + dev: true + + /typescript/4.4.3: + resolution: + { + integrity: sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==, + } + engines: { node: ">=4.2.0" } + hasBin: true + dev: true diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..9c509d4 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + + "target": "es5", + "module": "es6", + + "outDir": "./build", + + "allowJs": false, + + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + + "strict": true, + + "skipLibCheck": true + } +}