From ba0c0c7499b065de01edb0ee703e38ee8591543f Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 10:22:16 +0000 Subject: [PATCH 01/17] Update test icon --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 59e26a1..71e2f15 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Package](https://img.shields.io/npm/v/@remotemerge/nepali-date-converter?logo=npm)](https://www.npmjs.com/package/@remotemerge/nepali-date-converter) ![Build](https://img.shields.io/github/actions/workflow/status/remotemerge/nepali-date-converter/publish.yml?logo=github) -![Tests](https://img.shields.io/github/actions/workflow/status/remotemerge/nepali-date-converter/test.yml?style=flat&logo=counterstrike&label=test) +![Tests](https://img.shields.io/github/actions/workflow/status/remotemerge/nepali-date-converter/test.yml?&logo=jest&label=test) ![Downloads](https://img.shields.io/npm/dt/@remotemerge/nepali-date-converter?logo=spreadshirt) [![Size](https://img.shields.io/bundlephobia/minzip/@remotemerge/nepali-date-converter?logo=ipfs&label=size)](https://bundlephobia.com/result?p=@remotemerge/nepali-date-converter) ![License](https://img.shields.io/github/license/remotemerge/nepali-date-converter?logo=opensourceinitiative) From a7e67f2beb55626e103908a157b2e756a77f99ac Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 10:53:17 +0000 Subject: [PATCH 02/17] Create entrypoint script --- entrypoint.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..53393d7 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Exit on error +set -e + +# Change to the app directory +cd /app + +# Install dependencies +npm install + +# Start the app +npm run dev From 56fff8be5ccbe50b36d5851cc665033cb912b260 Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 10:54:02 +0000 Subject: [PATCH 03/17] Create docker compose --- docker-compose.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9bde4b1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,28 @@ +# Docker Compose configuration for NPM package deployment + +# Define network +networks: + npm-dev-network: + name: npm-dev-network + driver: bridge + external: false + +# Define services +services: + npm-dev-server: + image: node:22 + user: node + working_dir: /app + volumes: + - ./:/app + ports: + - "5173:5173" + networks: + - npm-dev-network + entrypoint: [ "/bin/bash", "/app/entrypoint.sh" ] + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:5173" ] + interval: 30s + timeout: 10s + retries: 3 + restart: unless-stopped From 81f066cee97fb29ceba86c993fb77acec1a3fdbe Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 10:55:37 +0000 Subject: [PATCH 04/17] Rename compose file --- docker-compose.yml => ducker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) rename docker-compose.yml => ducker-compose.yml (85%) diff --git a/docker-compose.yml b/ducker-compose.yml similarity index 85% rename from docker-compose.yml rename to ducker-compose.yml index 9bde4b1..664b1c4 100644 --- a/docker-compose.yml +++ b/ducker-compose.yml @@ -1,4 +1,6 @@ # Docker Compose configuration for NPM package deployment +# If you read this file, start docker compose with the following command: +# bash start-docker.sh # Define network networks: From ba2c3381ac435826c9667319070632ef70158230 Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 10:55:56 +0000 Subject: [PATCH 05/17] Add docker helper scripts --- app-cli.sh | 4 ++++ start-docker.sh | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 app-cli.sh create mode 100644 start-docker.sh diff --git a/app-cli.sh b/app-cli.sh new file mode 100644 index 0000000..6490335 --- /dev/null +++ b/app-cli.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Login to the app container +docker compose --file ducker-compose.yml exec --user node npm-dev-server bash diff --git a/start-docker.sh b/start-docker.sh new file mode 100644 index 0000000..9c85e71 --- /dev/null +++ b/start-docker.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# Stop and remove orphan services +docker compose --file ducker-compose.yml down --remove-orphans + +# Remove dangling services +docker container prune -f +docker network prune -f +docker builder prune -f +docker image prune -f +docker volume prune -f + +# Start services +docker compose --file ducker-compose.yml up From f0e4af25a9b2bdb226d804e3505cf14a0cad5fe8 Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 11:00:40 +0000 Subject: [PATCH 06/17] Change source directory --- .gitignore | 14 +++++++------- ducker-compose.yml | 2 +- .npmrc => html/.npmrc | 0 {__tests__ => html/__tests__}/ad.spec.ts | 2 +- {__tests__ => html/__tests__}/bs.spec.ts | 2 +- {__tests__ => html/__tests__}/data.dist.json | 0 entrypoint.sh => html/entrypoint.sh | 0 eslint.config.js => html/eslint.config.js | 0 index.html => html/index.html | 4 ++-- jest.config.ts => html/jest.config.ts | 0 {maker => html/maker}/package-manager.ts | 0 package-lock.json => html/package-lock.json | 0 package.json => html/package.json | 12 ++++++------ {src => html/src}/index.ts | 0 {src => html/src}/years.ts | 0 tsconfig.json => html/tsconfig.json | 10 ++++++++-- vite.config.ts => html/vite.config.ts | 0 17 files changed, 26 insertions(+), 20 deletions(-) rename .npmrc => html/.npmrc (100%) rename {__tests__ => html/__tests__}/ad.spec.ts (92%) rename {__tests__ => html/__tests__}/bs.spec.ts (92%) rename {__tests__ => html/__tests__}/data.dist.json (100%) rename entrypoint.sh => html/entrypoint.sh (100%) rename eslint.config.js => html/eslint.config.js (100%) rename index.html => html/index.html (71%) rename jest.config.ts => html/jest.config.ts (100%) rename {maker => html/maker}/package-manager.ts (100%) rename package-lock.json => html/package-lock.json (100%) rename package.json => html/package.json (84%) rename {src => html/src}/index.ts (100%) rename {src => html/src}/years.ts (100%) rename tsconfig.json => html/tsconfig.json (82%) rename vite.config.ts => html/vite.config.ts (100%) diff --git a/.gitignore b/.gitignore index 3461baa..41b0c9b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,12 @@ ### Vendor directories -/.yarn/ -/node_modules/ -/vendor/ +/html/.yarn/ +/html/node_modules/ +/html/vendor/ ### Build directories -/build/ -/bundle/ -/dist/ +/html/build/ +/html/bundle/ +/html/dist/ ### JetBrains /.idea/* @@ -56,4 +56,4 @@ pnpm-lock.yaml yarn.lock ## Data Files -/__tests__/data.json +/html/__tests__/data.json diff --git a/ducker-compose.yml b/ducker-compose.yml index 664b1c4..e182f96 100644 --- a/ducker-compose.yml +++ b/ducker-compose.yml @@ -16,7 +16,7 @@ services: user: node working_dir: /app volumes: - - ./:/app + - ./html:/app ports: - "5173:5173" networks: diff --git a/.npmrc b/html/.npmrc similarity index 100% rename from .npmrc rename to html/.npmrc diff --git a/__tests__/ad.spec.ts b/html/__tests__/ad.spec.ts similarity index 92% rename from __tests__/ad.spec.ts rename to html/__tests__/ad.spec.ts index f15ec9c..516a06b 100644 --- a/__tests__/ad.spec.ts +++ b/html/__tests__/ad.spec.ts @@ -1,4 +1,4 @@ -import DateConverter from '../src/index'; +import DateConverter from '../src'; import records from './data.json'; diff --git a/__tests__/bs.spec.ts b/html/__tests__/bs.spec.ts similarity index 92% rename from __tests__/bs.spec.ts rename to html/__tests__/bs.spec.ts index d588c43..62bac60 100644 --- a/__tests__/bs.spec.ts +++ b/html/__tests__/bs.spec.ts @@ -1,4 +1,4 @@ -import DateConverter from '../src/index'; +import DateConverter from '../src'; import records from './data.json'; diff --git a/__tests__/data.dist.json b/html/__tests__/data.dist.json similarity index 100% rename from __tests__/data.dist.json rename to html/__tests__/data.dist.json diff --git a/entrypoint.sh b/html/entrypoint.sh similarity index 100% rename from entrypoint.sh rename to html/entrypoint.sh diff --git a/eslint.config.js b/html/eslint.config.js similarity index 100% rename from eslint.config.js rename to html/eslint.config.js diff --git a/index.html b/html/index.html similarity index 71% rename from index.html rename to html/index.html index 7f28fdb..46ce2bb 100644 --- a/index.html +++ b/html/index.html @@ -1,4 +1,4 @@ - + @@ -6,6 +6,6 @@ Console - + diff --git a/jest.config.ts b/html/jest.config.ts similarity index 100% rename from jest.config.ts rename to html/jest.config.ts diff --git a/maker/package-manager.ts b/html/maker/package-manager.ts similarity index 100% rename from maker/package-manager.ts rename to html/maker/package-manager.ts diff --git a/package-lock.json b/html/package-lock.json similarity index 100% rename from package-lock.json rename to html/package-lock.json diff --git a/package.json b/html/package.json similarity index 84% rename from package.json rename to html/package.json index b33c4da..92c11de 100644 --- a/package.json +++ b/html/package.json @@ -41,12 +41,12 @@ }, "type": "module", "scripts": { - "lint": "eslint **/*.ts", - "lint:fix": "eslint **/*.ts --fix", - "test": "jest", - "dev": "vite", - "preview": "vite preview", - "build": "vite build && npx tsx maker/package-manager.ts" + "lint": "../node_modules/.bin/eslint **/*.ts", + "lint:fix": "../node_modules/.bin/eslint **/*.ts --fix", + "test": "../node_modules/.bin/jest", + "dev": "../node_modules/.bin/vite", + "preview": "../node_modules/.bin/vite preview", + "build": "../node_modules/.bin/vite build && npx tsx html/maker/package-manager.ts" }, "dependencies": { "date-fns": "^4.1.0" diff --git a/src/index.ts b/html/src/index.ts similarity index 100% rename from src/index.ts rename to html/src/index.ts diff --git a/src/years.ts b/html/src/years.ts similarity index 100% rename from src/years.ts rename to html/src/years.ts diff --git a/tsconfig.json b/html/tsconfig.json similarity index 82% rename from tsconfig.json rename to html/tsconfig.json index 39d4f8b..252b542 100644 --- a/tsconfig.json +++ b/html/tsconfig.json @@ -28,6 +28,12 @@ }, // Include and Exclude - "include": ["*.ts", "__tests__/**/*.ts", "maker/*.ts", "src/**/*.ts"], - "exclude": ["node_modules", "dist"] + "include": [ + "*.ts", + "html/__tests__/**/*.ts", + "html/maker/*.ts", + "html/src/**/*.ts" + ], + "exclude": [ + "../node_modules", "dist"] } diff --git a/vite.config.ts b/html/vite.config.ts similarity index 100% rename from vite.config.ts rename to html/vite.config.ts From 56914d4dda17b7e5537147a1a2db844e94fb3b99 Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 11:15:36 +0000 Subject: [PATCH 07/17] Fix module path --- html/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/index.html b/html/index.html index 46ce2bb..5efd41d 100644 --- a/html/index.html +++ b/html/index.html @@ -6,6 +6,6 @@ Console - + From 9fbd41c67b3982073f75135aa567c4fa742eafc0 Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 11:16:00 +0000 Subject: [PATCH 08/17] Update internal and external ports --- ducker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ducker-compose.yml b/ducker-compose.yml index e182f96..e8ee387 100644 --- a/ducker-compose.yml +++ b/ducker-compose.yml @@ -16,14 +16,14 @@ services: user: node working_dir: /app volumes: - - ./html:/app + - ./html/:/app ports: - - "5173:5173" + - "3000:3000" networks: - npm-dev-network entrypoint: [ "/bin/bash", "/app/entrypoint.sh" ] healthcheck: - test: [ "CMD", "curl", "-f", "http://localhost:5173" ] + test: [ "CMD", "curl", "-f", "http://localhost:3000" ] interval: 30s timeout: 10s retries: 3 From a7d8706841458ee6b2da13d38b9d4a68cb1116ab Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 11:16:20 +0000 Subject: [PATCH 09/17] Fix source paths --- html/tsconfig.json | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/html/tsconfig.json b/html/tsconfig.json index 252b542..39d4f8b 100644 --- a/html/tsconfig.json +++ b/html/tsconfig.json @@ -28,12 +28,6 @@ }, // Include and Exclude - "include": [ - "*.ts", - "html/__tests__/**/*.ts", - "html/maker/*.ts", - "html/src/**/*.ts" - ], - "exclude": [ - "../node_modules", "dist"] + "include": ["*.ts", "__tests__/**/*.ts", "maker/*.ts", "src/**/*.ts"], + "exclude": ["node_modules", "dist"] } From 1acc8962ff8827f4bdcf5a186e3ea8537fa57d50 Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 11:18:03 +0000 Subject: [PATCH 10/17] Update script and version --- html/package-lock.json | 4 ++-- html/package.json | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/html/package-lock.json b/html/package-lock.json index 92a635d..5809db0 100644 --- a/html/package-lock.json +++ b/html/package-lock.json @@ -1,12 +1,12 @@ { "name": "@remotemerge/nepali-date-converter", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@remotemerge/nepali-date-converter", - "version": "1.0.0", + "version": "1.0.1", "license": "MIT", "dependencies": { "date-fns": "^4.1.0" diff --git a/html/package.json b/html/package.json index 92c11de..12568f8 100644 --- a/html/package.json +++ b/html/package.json @@ -1,6 +1,6 @@ { "name": "@remotemerge/nepali-date-converter", - "version": "1.0.0", + "version": "1.0.1", "description": "A modern JavaScript library for seamless conversion between Bikram Sambat (BS) and Gregorian (AD) dates. Easily convert Nepali dates to English dates and vice versa with support for years 1975 BS to 2099 BS.", "homepage": "https://madansapkota.com", "license": "MIT", @@ -41,12 +41,12 @@ }, "type": "module", "scripts": { - "lint": "../node_modules/.bin/eslint **/*.ts", - "lint:fix": "../node_modules/.bin/eslint **/*.ts --fix", - "test": "../node_modules/.bin/jest", - "dev": "../node_modules/.bin/vite", - "preview": "../node_modules/.bin/vite preview", - "build": "../node_modules/.bin/vite build && npx tsx html/maker/package-manager.ts" + "lint": "eslint **/*.ts", + "lint:fix": "eslint **/*.ts --fix", + "test": "jest", + "dev": "vite --host 0.0.0.0 --port 3000", + "preview": "vite preview", + "build": "vite build && npx tsx ./maker/package-manager.ts" }, "dependencies": { "date-fns": "^4.1.0" From c79823f2e64141283a8dccbb7f9932d102cb18e6 Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 11:23:12 +0000 Subject: [PATCH 11/17] Update path within workflow --- .github/workflows/install.yml | 2 +- .github/workflows/publish.yml | 3 +++ .github/workflows/test.yml | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 70de3e6..f28f0c3 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -30,7 +30,7 @@ jobs: - name: Generate package.json file run: npm init -y - - name: Install ndc package + - name: Install Nepali Date Converter run: npm install @remotemerge/nepali-date-converter - name: List installed packages diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8f0c69f..c7ba63e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,6 +22,9 @@ jobs: node-version: 22 registry-url: 'https://registry.npmjs.org' + - name: Change the working directory + run: npx shx cd html + - name: Install dependencies run: npm install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6a50534..cd7ed18 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,9 @@ jobs: with: node-version: ${{ matrix.node-version }} + - name: Change the working directory + run: npx shx cd html + - name: Install dependencies run: npm install From 363fd3e9904a87e44ee036f161d01c459c4bed84 Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 11:27:02 +0000 Subject: [PATCH 12/17] Remove shx from command --- .github/workflows/publish.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c7ba63e..03de587 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,7 +23,7 @@ jobs: registry-url: 'https://registry.npmjs.org' - name: Change the working directory - run: npx shx cd html + run: cd html - name: Install dependencies run: npm install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cd7ed18..b57d5de 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: node-version: ${{ matrix.node-version }} - name: Change the working directory - run: npx shx cd html + run: cd html - name: Install dependencies run: npm install From e2f25ab2855025ff88885ba3bed01e5c59ef4a59 Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 11:36:09 +0000 Subject: [PATCH 13/17] Set default working directory --- .github/workflows/install.yml | 6 ++++++ .github/workflows/publish.yml | 9 ++++++--- .github/workflows/test.yml | 15 +++++++++------ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index f28f0c3..01ad628 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -18,6 +18,12 @@ jobs: node-version: [18, 20, 22] fail-fast: false + # Set default values for the jobs + defaults: + run: + shell: bash + working-directory: ./html + steps: # Checkout the repository - uses: actions/checkout@v4 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 03de587..0a2dfbd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,6 +12,12 @@ jobs: # Run on the latest Ubuntu runs-on: ubuntu-latest + # Set default values for the jobs + defaults: + run: + shell: bash + working-directory: ./html + steps: # Checkout the repository - uses: actions/checkout@v4 @@ -22,9 +28,6 @@ jobs: node-version: 22 registry-url: 'https://registry.npmjs.org' - - name: Change the working directory - run: cd html - - name: Install dependencies run: npm install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b57d5de..3b23a13 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ name: Test # Trigger the workflow on pull requests -on: [pull_request] +on: [ pull_request ] jobs: test: @@ -9,10 +9,16 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - node-version: [18, 20, 22] + os: [ ubuntu-latest, windows-latest, macos-latest ] + node-version: [ 18, 20, 22 ] fail-fast: false + # Set default values for the jobs + defaults: + run: + shell: bash + working-directory: ./html + steps: # Checkout the repository - uses: actions/checkout@v4 @@ -22,9 +28,6 @@ jobs: with: node-version: ${{ matrix.node-version }} - - name: Change the working directory - run: cd html - - name: Install dependencies run: npm install From 123ab84e65a7dd245c3995a371041baa79935de9 Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 11:42:51 +0000 Subject: [PATCH 14/17] Fix doc and license file path --- ducker-compose.yml | 2 ++ html/maker/package-manager.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ducker-compose.yml b/ducker-compose.yml index e8ee387..14c5b11 100644 --- a/ducker-compose.yml +++ b/ducker-compose.yml @@ -17,6 +17,8 @@ services: working_dir: /app volumes: - ./html/:/app + - ./README.md:/README.md + - ./LICENSE:/LICENSE ports: - "3000:3000" networks: diff --git a/html/maker/package-manager.ts b/html/maker/package-manager.ts index 14c739f..6fd9278 100644 --- a/html/maker/package-manager.ts +++ b/html/maker/package-manager.ts @@ -64,5 +64,5 @@ await writeFile( // Copy static files to the dist folder await copyFile('.npmrc', join(distPath, '.npmrc')); -await copyFile('README.md', join(distPath, 'README.md')); -await copyFile('LICENSE', join(distPath, 'LICENSE')); +await copyFile('../../README.md', join(distPath, 'README.md')); +await copyFile('../../LICENSE', join(distPath, 'LICENSE')); From 1fff95abbe7534ec987e0231948c5b632cbb2f6b Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 11:48:41 +0000 Subject: [PATCH 15/17] Fix working dirs --- .github/workflows/install.yml | 12 +++--------- .github/workflows/publish.yml | 15 ++++++--------- .github/workflows/test.yml | 14 ++++---------- html/maker/package-manager.ts | 2 -- 4 files changed, 13 insertions(+), 30 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 01ad628..cb458e4 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -18,12 +18,6 @@ jobs: node-version: [18, 20, 22] fail-fast: false - # Set default values for the jobs - defaults: - run: - shell: bash - working-directory: ./html - steps: # Checkout the repository - uses: actions/checkout@v4 @@ -34,10 +28,10 @@ jobs: node-version: ${{ matrix.node-version }} - name: Generate package.json file - run: npm init -y + run: cd html && npm init -y - name: Install Nepali Date Converter - run: npm install @remotemerge/nepali-date-converter + run: cd html && npm install @remotemerge/nepali-date-converter - name: List installed packages - run: npm list --depth=0 + run: cd html && npm list --depth=0 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0a2dfbd..21c0492 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,12 +12,6 @@ jobs: # Run on the latest Ubuntu runs-on: ubuntu-latest - # Set default values for the jobs - defaults: - run: - shell: bash - working-directory: ./html - steps: # Checkout the repository - uses: actions/checkout@v4 @@ -29,12 +23,15 @@ jobs: registry-url: 'https://registry.npmjs.org' - name: Install dependencies - run: npm install + run: cd html && npm install - name: Build project - run: npm run build + run: cd html && npm run build + + - name: Copy Documentation and License + run: cp README.md LICENSE html/dist - name: Publish the package to npm - run: npm publish ./dist --access public + run: cd html && npm publish ./dist --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3b23a13..44c0616 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,12 +13,6 @@ jobs: node-version: [ 18, 20, 22 ] fail-fast: false - # Set default values for the jobs - defaults: - run: - shell: bash - working-directory: ./html - steps: # Checkout the repository - uses: actions/checkout@v4 @@ -29,13 +23,13 @@ jobs: node-version: ${{ matrix.node-version }} - name: Install dependencies - run: npm install + run: cd html && npm install - name: Build project - run: npm run build + run: cd html && npm run build - name: Create data file - run: npx shx cp __tests__/data.dist.json __tests__/data.json + run: cd html && npx shx cp __tests__/data.dist.json __tests__/data.json - name: Run Tests - run: npm run test + run: cd html && npm run test diff --git a/html/maker/package-manager.ts b/html/maker/package-manager.ts index 6fd9278..ad1f637 100644 --- a/html/maker/package-manager.ts +++ b/html/maker/package-manager.ts @@ -64,5 +64,3 @@ await writeFile( // Copy static files to the dist folder await copyFile('.npmrc', join(distPath, '.npmrc')); -await copyFile('../../README.md', join(distPath, 'README.md')); -await copyFile('../../LICENSE', join(distPath, 'LICENSE')); From f8a81e4e2b00ee1ed2f3acd6dc05b743c6f6cd0e Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 11:49:14 +0000 Subject: [PATCH 16/17] Remove files mount --- ducker-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/ducker-compose.yml b/ducker-compose.yml index 14c5b11..e8ee387 100644 --- a/ducker-compose.yml +++ b/ducker-compose.yml @@ -17,8 +17,6 @@ services: working_dir: /app volumes: - ./html/:/app - - ./README.md:/README.md - - ./LICENSE:/LICENSE ports: - "3000:3000" networks: From 2e6929d1f2c020979bfec72d29a30b96985d30a8 Mon Sep 17 00:00:00 2001 From: Madan Sapkota Date: Sat, 4 Jan 2025 11:52:05 +0000 Subject: [PATCH 17/17] Fix OS list --- .github/workflows/install.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index cb458e4..6815e08 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] + os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, windows-latest, macos-latest ] node-version: [18, 20, 22] fail-fast: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 44c0616..44003c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] + os: [ ubuntu-24.04, windows-latest, macos-latest ] node-version: [ 18, 20, 22 ] fail-fast: false