diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 1efc12ef..83f71c80 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -5,8 +5,8 @@ on: types: [published] jobs: - build: - runs-on: ubuntu-latest + package: + runs-on: windows-latest permissions: contents: read @@ -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 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/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); diff --git a/package.json b/package.json index 7872aa7d..d904e00d 100644 --- a/package.json +++ b/package.json @@ -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 ", + "license": "MIT", + "gypfile": true, + "repository": { + "type": "git", + "url": "git+https://github.com/internxt/node-win.git" + }, "scripts": { "========== Testing ==========": "", "test": "vitest", @@ -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", @@ -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",