From 9894177b7318faecc7d44c2545d770d235c52e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Jim=C3=A9nez=20Rivera?= Date: Wed, 19 Mar 2025 15:52:57 +0100 Subject: [PATCH 01/10] Update publish-npm.yml --- .github/workflows/publish-npm.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 1efc12ef..16ed786d 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -1,12 +1,13 @@ name: Publish package to npmjs on: - release: - types: [published] + # release: + # types: [published] + pull_request: jobs: build: - runs-on: ubuntu-latest + runs-on: windows-latest permissions: contents: read @@ -24,6 +25,9 @@ jobs: - name: Install dependencies run: yarn install --ignore-scripts + - name: Build package + run: yarn build + - name: Create .npmrc file run: | touch .npmrc From 77914f1f097102a40852e529cfc13f7693b8f93b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Jim=C3=A9nez=20Rivera?= Date: Wed, 19 Mar 2025 16:02:09 +0100 Subject: [PATCH 02/10] Update publish-npm.yml --- .github/workflows/publish-npm.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 16ed786d..c3021c2c 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -6,7 +6,7 @@ on: pull_request: jobs: - build: + package: runs-on: windows-latest permissions: @@ -18,15 +18,24 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 with: node-version: 18 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: 3.10 + + - name: Install node-gyp + run: npm install -g node-gyp + - name: Install dependencies run: yarn install --ignore-scripts - name: Build package - run: yarn build + run: npm run build - name: Create .npmrc file run: | From 50c869b16580858c28c2bf539aa75d355cde957d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Jim=C3=A9nez=20Rivera?= Date: Wed, 19 Mar 2025 16:04:13 +0100 Subject: [PATCH 03/10] Update publish-npm.yml --- .github/workflows/publish-npm.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index c3021c2c..9c024505 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -21,12 +21,12 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 18 + node-version: "18" - name: Setup Python uses: actions/setup-python@v3 with: - python-version: 3.10 + python-version: "3.10" - name: Install node-gyp run: npm install -g node-gyp From 9a3dec468fedc422f87123125a0ef27ea5cbe1e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Jim=C3=A9nez=20Rivera?= Date: Thu, 20 Mar 2025 11:22:24 +0100 Subject: [PATCH 04/10] Rename to @internxt/node-win --- .github/workflows/publish-npm.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 9c024505..03e19851 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -21,7 +21,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: "18" + node-version: 18 - name: Setup Python uses: actions/setup-python@v3 diff --git a/package.json b/package.json index 7872aa7d..4dd5ffe9 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "node-win", + "name": "@internxt/node-win", "version": "1.0.0", "description": "", "main": "dist/index.ts", From 2eb7b96900163ee393258dc25f5e3e758ccb56ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Jim=C3=A9nez=20Rivera?= Date: Thu, 20 Mar 2025 11:29:58 +0100 Subject: [PATCH 05/10] Update publish-npm.yml --- .github/workflows/publish-npm.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 03e19851..74edb0a9 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -1,9 +1,8 @@ name: Publish package to npmjs on: - # release: - # types: [published] - pull_request: + release: + types: [published] jobs: package: From 5298890c680809ffe4c8480754407bfdc1083e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Jim=C3=A9nez=20Rivera?= Date: Thu, 20 Mar 2025 11:40:50 +0100 Subject: [PATCH 06/10] Change package description --- .github/workflows/publish-npm.yml | 5 +++-- package.json | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 74edb0a9..03e19851 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -1,8 +1,9 @@ name: Publish package to npmjs on: - release: - types: [published] + # release: + # types: [published] + pull_request: jobs: package: diff --git a/package.json b/package.json index 4dd5ffe9..e7145ec8 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,16 @@ { "name": "@internxt/node-win", "version": "1.0.0", - "description": "", + "description": "Drive desktop node addon", "main": "dist/index.ts", "types": "dist/index.d.ts", + "author": "Internxt ", + "license": "MIT", + "gypfile": true, + "repository": { + "type": "git", + "url": "git+https://github.com/internxt/node-win.git" + }, "scripts": { "========== Testing ==========": "", "test": "vitest", @@ -25,9 +32,6 @@ "unregister": "ts-node -r tsconfig-paths/register ./examples/unregister.ts", "disconnect": "ts-node -r tsconfig-paths/register ./examples/disconnect.ts" }, - "author": "", - "license": "ISC", - "gypfile": true, "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^5.2.1", "@types/lodash.chunk": "^4.2.9", From 782fe6c09d5124988c3b2de762f3a22f89a25127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Jim=C3=A9nez=20Rivera?= Date: Thu, 20 Mar 2025 11:45:21 +0100 Subject: [PATCH 07/10] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e7145ec8..b34518ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@internxt/node-win", - "version": "1.0.0", + "version": "1.0.1", "description": "Drive desktop node addon", "main": "dist/index.ts", "types": "dist/index.d.ts", From e6d46c8b8a07d4bdaf5aee51fd3efed755cf04ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Jim=C3=A9nez=20Rivera?= Date: Thu, 20 Mar 2025 12:14:22 +0100 Subject: [PATCH 08/10] Publish to github npm --- .github/workflows/publish-npm.yml | 13 ++++++++--- .github/workflows/pull-request.yml | 6 ++--- README.md | 35 ++++++++++++++++++++++++++++++ package.json | 4 +++- 4 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 README.md diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 03e19851..c9511a61 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -39,9 +39,16 @@ jobs: - name: Create .npmrc file run: | - touch .npmrc - echo "registry=https://registry.npmjs.org/" >> .npmrc - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc + echo "@internxt:registry=https://npm.pkg.github.com/" > .npmrc + echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc - name: Publish package run: npm publish --scope=@internxt --access public + + # - name: Create .npmrc file + # run: | + # echo "registry=https://registry.npmjs.org/" > .npmrc + # echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc + + # - name: Publish package + # run: npm publish --scope=@internxt --access public diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 7e9a6ad6..6c616d8b 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -20,10 +20,10 @@ jobs: run: yarn install --ignore-scripts - name: Run TypeScript compiler - run: yarn tsc + run: npm run type-check - name: Run Prettier - run: yarn prettier . --check + run: npm run format - name: Run tests - run: yarn test:once + run: npm run test:once diff --git a/README.md b/README.md new file mode 100644 index 00000000..b4b710a1 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# Setup + +This guide explains how to set up and build the node-win project. + +--- + +## Prerequisites + +Before proceeding, ensure you have the following tools installed: + +```markdown +- Python 3.10 (configured correctly). +- Node.js and yarn. +- node-gyp (global installation): +``` + +```bash +npm install -g node-gyp +``` + +- **Visual Studio** (not VS Code) for building native dependencies. + +--- + +## Build Steps + +Run the following command to build the project: + +```bash +npm run build +``` + +This step compiles the necessary native bindings. + +--- diff --git a/package.json b/package.json index b34518ed..d904e00d 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,9 @@ "config:gyp": "python gyp.config.py", "build": "python gyp.config.py && node-gyp clean && node-gyp configure build && yarn build:ts", "========== Linter ==========": "", - "format": "prettier . --write", + "format": "prettier . --check", + "format:fix": "prettier . --write", + "type-check": "tsc", "========== Examples ==========": "", "prod:register": "node ./dist/examples/register.js", "register": "nodemon", From 7016e3646b8bfb3242f56a8cf248c2dfc84d6564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Jim=C3=A9nez=20Rivera?= Date: Thu, 20 Mar 2025 12:22:56 +0100 Subject: [PATCH 09/10] Update publish-npm.yml --- .github/workflows/publish-npm.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index c9511a61..83f71c80 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -1,9 +1,8 @@ name: Publish package to npmjs on: - # release: - # types: [published] - pull_request: + release: + types: [published] jobs: package: @@ -42,13 +41,13 @@ jobs: echo "@internxt:registry=https://npm.pkg.github.com/" > .npmrc echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc - - name: Publish package + - name: Publish package to github run: npm publish --scope=@internxt --access public - # - name: Create .npmrc file - # run: | - # echo "registry=https://registry.npmjs.org/" > .npmrc - # echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc + - name: Create .npmrc file + run: | + echo "registry=https://registry.npmjs.org/" > .npmrc + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc - # - name: Publish package - # run: npm publish --scope=@internxt --access public + - name: Publish package to npm + run: npm publish --scope=@internxt --access public From 99b0f8dd63e663db1d0220b01b389b4f57488494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Jim=C3=A9nez=20Rivera?= Date: Thu, 20 Mar 2025 12:23:39 +0100 Subject: [PATCH 10/10] Update Planceholders.cpp --- native-src/placeholders_interface/Planceholders.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/native-src/placeholders_interface/Planceholders.cpp b/native-src/placeholders_interface/Planceholders.cpp index cbcc7860..ad99b88e 100644 --- a/native-src/placeholders_interface/Planceholders.cpp +++ b/native-src/placeholders_interface/Planceholders.cpp @@ -48,7 +48,6 @@ void Placeholders::CreateOne( if (std::filesystem::exists(fullPath)) { Placeholders::ConvertToPlaceholder(fullPath, fileIdentity); - wprintf(L"[CreatePlaceholder] File already exists. Skipping creation. Initializing identity maintenance...\n"); Placeholders::MaintainIdentity(fullPath, fileIdentity, false); return; // No hacer nada si ya existe } @@ -158,7 +157,6 @@ void Placeholders::CreateEntry( if (DirectoryExists(fullDestPath.c_str())) { Placeholders::ConvertToPlaceholder(fullDestPath, itemIdentity); - wprintf(L"[CreatePlaceholder] Directory already exists. Skipping creation. Initializing identity maintenance...\n"); Placeholders::MaintainIdentity(fullDestPath, itemIdentity, true); return; // No hacer nada si ya existe } @@ -296,7 +294,6 @@ void Placeholders::UpdateSyncStatus(const std::wstring &filePath, bool inputSync // wprintf(L"Marking item as %s: %ls\n", inputSyncState ? L"IN_SYNC" : L"NOT_IN_SYNC", filePath.c_str()); HRESULT hr = CfSetInSyncState(fileHandle, syncState, CF_SET_IN_SYNC_FLAG_NONE, nullptr); // imprimir hresult - wprintf(L"hr: %ld\n", hr); if (FAILED(hr)) { wprintf(L"[UpdateSyncStatus] Error al establecer el estado de sincronización: %ld\n", hr);