Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
package:
runs-on: windows-latest

permissions:
contents: read
Expand All @@ -17,18 +17,37 @@ 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: npm run build

- name: Create .npmrc file
run: |
echo "@internxt:registry=https://npm.pkg.github.com/" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc

- name: Publish package to github
run: npm publish --scope=@internxt --access public

- name: Create .npmrc file
run: |
touch .npmrc
echo "registry=https://registry.npmjs.org/" >> .npmrc
echo "registry=https://registry.npmjs.org/" > .npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc

- name: Publish package
- name: Publish package to npm
run: npm publish --scope=@internxt --access public
6 changes: 3 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

---
3 changes: 0 additions & 3 deletions native-src/placeholders_interface/Planceholders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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);
Expand Down
20 changes: 13 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
{
"name": "node-win",
"version": "1.0.0",
"description": "",
"name": "@internxt/node-win",
"version": "1.0.1",
"description": "Drive desktop node addon",
"main": "dist/index.ts",
"types": "dist/index.d.ts",
"author": "Internxt <hello@internxt.com>",
"license": "MIT",
"gypfile": true,
"repository": {
"type": "git",
"url": "git+https://github.com/internxt/node-win.git"
},
"scripts": {
"========== Testing ==========": "",
"test": "vitest",
Expand All @@ -16,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",
Expand All @@ -25,9 +34,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",
Expand Down