From 5716425bd2effe2e177058ed3073ce6783aa37db Mon Sep 17 00:00:00 2001 From: Robert <8934693+0x1eef@users.noreply.github.com> Date: Fri, 23 Jun 2023 22:31:25 -0300 Subject: [PATCH] Rename Packet to Postman (#131) --- .gitignore | 1 + package-lock.json | 49 +++++++++++-------- .../typescript/{packet => postman}/.gitignore | 0 .../typescript/{packet => postman}/LICENSE | 0 .../typescript/{packet => postman}/README.md | 4 +- .../{packet => postman}/package.json | 2 +- .../{packet => postman}/src/index.ts | 6 +-- .../src/postman}/fetchOptions.ts | 0 .../packet => postman/src/postman}/item.ts | 0 .../packet => postman/src/postman}/request.ts | 0 .../{packet => postman}/tsconfig.json | 0 src/js/pages/surah/index/loader.ts | 4 +- src/js/pages/surah/stream/loader.ts | 4 +- 13 files changed, 40 insertions(+), 30 deletions(-) rename packages/typescript/{packet => postman}/.gitignore (100%) rename packages/typescript/{packet => postman}/LICENSE (100%) rename packages/typescript/{packet => postman}/README.md (88%) rename packages/typescript/{packet => postman}/package.json (95%) rename packages/typescript/{packet => postman}/src/index.ts (93%) rename packages/typescript/{packet/src/packet => postman/src/postman}/fetchOptions.ts (100%) rename packages/typescript/{packet/src/packet => postman/src/postman}/item.ts (100%) rename packages/typescript/{packet/src/packet => postman/src/postman}/request.ts (100%) rename packages/typescript/{packet => postman}/tsconfig.json (100%) diff --git a/.gitignore b/.gitignore index 052499d..48692b7 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ node_modules/ *.conf *.yml *.mp3 +*.sh diff --git a/package-lock.json b/package-lock.json index a582d49..ef2d2bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3003,10 +3003,6 @@ "node": ">=6" } }, - "node_modules/packet": { - "resolved": "packages/typescript/packet", - "link": true - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -3215,6 +3211,10 @@ "node": ">=8" } }, + "node_modules/postman": { + "resolved": "packages/typescript/postman", + "link": true + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -4304,13 +4304,22 @@ }, "packages/typescript/packet": { "version": "0.1.0", + "extraneous": true, "license": "0BSDL", "devDependencies": { "@types/node": "^16.18", "typescript": "^4.5" } }, - "packages/typescript/packet/node_modules/@types/node": { + "packages/typescript/postman": { + "version": "0.1.0", + "license": "0BSDL", + "devDependencies": { + "@types/node": "^16.18", + "typescript": "^4.5" + } + }, + "packages/typescript/postman/node_modules/@types/node": { "version": "16.18.36", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.36.tgz", "integrity": "sha512-8egDX8dE50XyXWH6C6PRCNkTP106DuUrvdrednFouDSmCi7IOvrqr0frznfZaHifHH/3aq/7a7v9N4wdXMqhBQ==", @@ -6413,21 +6422,6 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, - "packet": { - "version": "file:packages/typescript/packet", - "requires": { - "@types/node": "^16.18", - "typescript": "^4.5" - }, - "dependencies": { - "@types/node": { - "version": "16.18.36", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.36.tgz", - "integrity": "sha512-8egDX8dE50XyXWH6C6PRCNkTP106DuUrvdrednFouDSmCi7IOvrqr0frznfZaHifHH/3aq/7a7v9N4wdXMqhBQ==", - "dev": true - } - } - }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -6563,6 +6557,21 @@ "find-up": "^4.0.0" } }, + "postman": { + "version": "file:packages/typescript/postman", + "requires": { + "@types/node": "^16.18", + "typescript": "^4.5" + }, + "dependencies": { + "@types/node": { + "version": "16.18.36", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.36.tgz", + "integrity": "sha512-8egDX8dE50XyXWH6C6PRCNkTP106DuUrvdrednFouDSmCi7IOvrqr0frznfZaHifHH/3aq/7a7v9N4wdXMqhBQ==", + "dev": true + } + } + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", diff --git a/packages/typescript/packet/.gitignore b/packages/typescript/postman/.gitignore similarity index 100% rename from packages/typescript/packet/.gitignore rename to packages/typescript/postman/.gitignore diff --git a/packages/typescript/packet/LICENSE b/packages/typescript/postman/LICENSE similarity index 100% rename from packages/typescript/packet/LICENSE rename to packages/typescript/postman/LICENSE diff --git a/packages/typescript/packet/README.md b/packages/typescript/postman/README.md similarity index 88% rename from packages/typescript/packet/README.md rename to packages/typescript/postman/README.md index 00ff6cd..d119ef5 100644 --- a/packages/typescript/packet/README.md +++ b/packages/typescript/postman/README.md @@ -1,6 +1,6 @@ ## About -Packet is a JavaScript library that can download the dependencies +Postman is a JavaScript library that can download the dependencies of a web page, and afterwards display the web page with all of its dependencies in-place, ready to use. @@ -11,7 +11,7 @@ as plain-text. ## Examples ```typescript -import packet, { item } from "packet"; +import postman, { item } from "postman"; packet( item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)"), item.script("/js/app.js"), diff --git a/packages/typescript/packet/package.json b/packages/typescript/postman/package.json similarity index 95% rename from packages/typescript/packet/package.json rename to packages/typescript/postman/package.json index 6334be5..e6d2157 100644 --- a/packages/typescript/packet/package.json +++ b/packages/typescript/postman/package.json @@ -1,5 +1,5 @@ { - "name": "packet", + "name": "postman", "version": "0.1.0", "description": "Download a web page's dependencies before the page loads.", "main": "dist/index.js", diff --git a/packages/typescript/packet/src/index.ts b/packages/typescript/postman/src/index.ts similarity index 93% rename from packages/typescript/packet/src/index.ts rename to packages/typescript/postman/src/index.ts index 01ce96b..ff6ab41 100644 --- a/packages/typescript/packet/src/index.ts +++ b/packages/typescript/postman/src/index.ts @@ -1,6 +1,6 @@ -import type { Item, FontItem } from './packet/item'; -import item from './packet/item'; -import request from './packet/request'; +import type { Item, FontItem } from './postman/item'; +import item from './postman/item'; +import request from './postman/request'; type Packet = { fetch: () => Promise }; type Items = Array; diff --git a/packages/typescript/packet/src/packet/fetchOptions.ts b/packages/typescript/postman/src/postman/fetchOptions.ts similarity index 100% rename from packages/typescript/packet/src/packet/fetchOptions.ts rename to packages/typescript/postman/src/postman/fetchOptions.ts diff --git a/packages/typescript/packet/src/packet/item.ts b/packages/typescript/postman/src/postman/item.ts similarity index 100% rename from packages/typescript/packet/src/packet/item.ts rename to packages/typescript/postman/src/postman/item.ts diff --git a/packages/typescript/packet/src/packet/request.ts b/packages/typescript/postman/src/postman/request.ts similarity index 100% rename from packages/typescript/packet/src/packet/request.ts rename to packages/typescript/postman/src/postman/request.ts diff --git a/packages/typescript/packet/tsconfig.json b/packages/typescript/postman/tsconfig.json similarity index 100% rename from packages/typescript/packet/tsconfig.json rename to packages/typescript/postman/tsconfig.json diff --git a/src/js/pages/surah/index/loader.ts b/src/js/pages/surah/index/loader.ts index 122976f..91e7938 100644 --- a/src/js/pages/surah/index/loader.ts +++ b/src/js/pages/surah/index/loader.ts @@ -1,4 +1,4 @@ -import packet, { item } from 'packet'; +import postman, { item } from 'postman'; (function() { const parent: HTMLElement = document.querySelector('.webpackage.loader')!; @@ -6,7 +6,7 @@ import packet, { item } from 'packet'; const progressNumber: HTMLSpanElement = parent.querySelector('.percentage')!; const inlineStyle: HTMLStyleElement = document.querySelector('.css.webpackage')!; - packet( + postman( item.script('/js/pages/surah/index.js'), item.css('/css/pages/surah/index.css'), item.image('/images/moon.svg'), diff --git a/src/js/pages/surah/stream/loader.ts b/src/js/pages/surah/stream/loader.ts index 00a6893..600968d 100644 --- a/src/js/pages/surah/stream/loader.ts +++ b/src/js/pages/surah/stream/loader.ts @@ -1,4 +1,4 @@ -import packet, { item } from 'packet'; +import postman, { item } from 'postman'; (function() { const parent: HTMLElement = document.querySelector('.webpackage.loader')!; @@ -7,7 +7,7 @@ import packet, { item } from 'packet'; const inlineStyle: HTMLStyleElement = document.querySelector('.css.webpackage')!; const { locale, surahId } = document.querySelector('.root')!.dataset; - packet( + postman( item.script('/js/pages/surah/stream.js'), item.css('/css/pages/surah/strean.css'), item.image('/images/moon,svg'),