{"id":19218696,"url":"https://github.com/fadilxcoder/typescript","last_synced_at":"2025-02-23T09:14:46.694Z","repository":{"id":86245793,"uuid":"527189132","full_name":"fadilxcoder/typescript","owner":"fadilxcoder","description":"Typescript Basics \u0026 Mini PoC","archived":false,"fork":false,"pushed_at":"2022-08-24T18:32:18.000Z","size":589,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"poc","last_synced_at":"2025-01-04T19:23:26.546Z","etag":null,"topics":["axios","courses","jquery","jsondb-api","poc","typescript","udemy"],"latest_commit_sha":null,"homepage":"https://fadilxcoder.github.io/typescript/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fadilxcoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-21T11:41:11.000Z","updated_at":"2022-08-24T18:34:06.000Z","dependencies_parsed_at":"2023-03-08T18:00:14.189Z","dependency_job_id":null,"html_url":"https://github.com/fadilxcoder/typescript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadilxcoder%2Ftypescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadilxcoder%2Ftypescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadilxcoder%2Ftypescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadilxcoder%2Ftypescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fadilxcoder","download_url":"https://codeload.github.com/fadilxcoder/typescript/tar.gz/refs/heads/poc","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240292395,"owners_count":19778311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["axios","courses","jquery","jsondb-api","poc","typescript","udemy"],"created_at":"2024-11-09T14:27:46.984Z","updated_at":"2025-02-23T09:14:46.625Z","avatar_url":"https://github.com/fadilxcoder.png","language":"JavaScript","readme":"# Notes\n\n- https://github.com/fadilxcoder/typescript/tree/master (Udemy branch)\n\n\n---\n\n- Install typescript\n\n```\nnpm i typescript \n```\n\n- Init the tsconfig and configure it\n\n```\ntsc --init\n```\n- tsconfig.json\n\n```\n{\n    \"outDir\": \"./dist\",\n    \"rootDir\": \"./src\", \n}\n```\n\n- Configure Webpack\n- RUN : `npm i -D webpack webpack-cli typescript ts-loader`\n- NOTE : **(\"npm i -D X\" is the shorthand for \"npm install --save-dev X\")**\n- Configure `webpack.config.js` according to project\n\n```js\nconst path = require('path');\n\nmodule.exports = {\n  mode: \"development\",\n  devtool: \"inline-source-map\",\n  entry: {\n    main: \"./src/app.ts\",\n  },\n  output: {\n    path: path.resolve(__dirname, './dist'),\n    filename: \"app-bundle.js\" // \u003c--- Will be compiled to this single file\n  },\n  resolve: {\n    extensions: [\".ts\", \".tsx\", \".js\"],\n  },\n  module: {\n    rules: [\n      { \n        test: /\\.tsx?$/,\n        loader: \"ts-loader\"\n      }\n    ]\n  }\n};\n```\n\n- Launch app with `http-server`\n- Compile everything with `npx webpack` / `npx webpack --watch`\n\n## Run typescript without compiling to JS\n\n- Install `npm i @digitak/esrun -g`\n- RUN `esrun ./src/app.ts `\n\n```\n$ esrun ./src/app.ts\n-------------------------------\n{\n  id: 1,\n  full_name: 'full_name',\n  email: 'email',\n  phone_number: 'phone_number',\n  address: 'address',\n  job: 'job',\n  company: 'company',\n  card_type: 'card_type',\n  account_number: 'account_number'\n}\n```\n\n## Axios / JQuery - Api\n\n- `npm install -D axios`\n- `npm install --save-dev @types/jquery`\n- `npm install jquery`\n- Axios promise - fetch data\n\n### Reference\n\n- https://dev.to/silvenleaf/simplest-way-to-compile-all-typescript-into-one-single-js-file-19bj (HTML / Typescript / Webpack)\n- https://webpack.js.org/configuration/ (webpack.config.js configuration)\n- https://bobbyhadz.com/blog/typescript-http-request-axios (Axios)\n\n\n### Preview\n\n\u003cimg src=\"./app.png\" alt=\"App\"\u003e","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadilxcoder%2Ftypescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffadilxcoder%2Ftypescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadilxcoder%2Ftypescript/lists"}