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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [ 20.x, 22.x, 24.x ]
node-version: [ 22.x, 24.x ]
os: [ windows-latest, ubuntu-latest, macOS-latest ]

# Go
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Notify
uses: sarisia/actions-status-discord@v1
# Only fire alert once
if: github.ref == 'refs/heads/main' && failure() && matrix.node-version == '20.x' && matrix.os == 'ubuntu-latest'
if: github.ref == 'refs/heads/main' && failure() && matrix.node-version == '22.x' && matrix.os == 'ubuntu-latest'
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: "build and test"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ test/integration/tmp
test/tmp
vendor/
.DS_Store
.kiro
32 changes: 32 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
# Architect Hydrate changelog
---

## [6.0.0]

### Breaking Changes

- **Node.js 22+ required**: Updated minimum Node.js version from 20 to 22
- Replaced external glob dependency (`@architect/utils/glob`) with native Node.js `fs.globSync`
- Takes advantage of Node.js 22's built-in glob support
- Reduces external dependencies and improves performance
- No functional changes to dependency discovery behavior

### Migration Guide

If you are upgrading from version 5.x:

1. **Upgrade Node.js**: Ensure you are running Node.js 22 or later
- Check your version: `node --version`
- If using Node.js 20 or earlier, upgrade to Node.js 22+ or stay on `@architect/hydrate` 5.x

2. **Update your CI/CD**: Update any CI/CD configurations to use Node.js 22 or later
- GitHub Actions: Update `node-version` in workflow files
- Other CI systems: Update Node.js version in configuration

3. **No code changes required**: The API remains unchanged, all existing code will continue to work

### Changed

- Updated `engines.node` in package.json from `>=20` to `>=22`
- Migrated from `@architect/utils/glob` to native `fs.globSync` for file pattern matching
- Updated CI test matrix to use Node.js 22.x and 24.x

---

## [5.0.0]

- Update deps and move to node > 20
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"name": "@architect/hydrate",
"version": "5.0.1",
"version": "5.0.2-RC.0",
"description": "Architect dependency hydrator and shared file manager",
"main": "src/index.js",
"bin": {
"arc-hydrate": "src/cli.js"
},
"scripts": {
"test": "node test/unit/src/actions/install-update-tests.js",
"_test": "npm run lint && npm run test:integration && npm run coverage",
"test": "npm run lint && npm run test:integration && npm run coverage",
"test:nolint": "npm run test:integration && npm run coverage",
"test:unit": "cross-env tape 'test/unit/**/*-tests.js'",
"test:integration": "cross-env tape 'test/integration/**/*-tests.js'",
Expand All @@ -19,7 +18,7 @@
"vendor": "cd src/actions/autoinstall/python/py/ && vendoring sync && zip -r9 vendor.zip ./vendor"
},
"engines": {
"node": ">=20"
"node": ">=22"
},
"repository": {
"type": "git",
Expand Down
6 changes: 6 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
- **Ruby** via `bundle` using `Gemfile` and `Gemfile.lock` files


# Requirements

- **Node.js 22 or later** is required to use `@architect/hydrate` version 6.0.0 and above
- For Node.js 20 support, use `@architect/hydrate` version 5.x


# Installation

npm install @architect/hydrate
Expand Down
4 changes: 2 additions & 2 deletions src/actions/autoinstall/node/get-lambda-deps.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let { join } = require('path')
let { globSync } = require('@architect/utils/glob')
let { globSync } = require('fs')
let { destroyPath, ignoreDeps } = require('../../../lib')
let getRequires = require('./find-lambda-deps')

Expand All @@ -17,7 +17,7 @@ module.exports = function getDirDeps ({ dir, update, inventory, ignored }) {
let failures = []

// Gather ye business logic while ye may
let files = globSync('**/*.+(js|cjs|mjs)', { cwd: dir }).filter(ignoreDeps)
let files = Array.from(globSync('**/*.{js,cjs,mjs}', { cwd: dir })).filter(ignoreDeps)
files.forEach(f => {
try {
let requires = getRequires({ dir, file: join(dir, f), update })
Expand Down
7 changes: 3 additions & 4 deletions src/hydrate.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
let { dirname, join, sep } = require('path')
let { readFileSync } = require('fs')
let { readFileSync, globSync } = require('fs')
let { pathToUnix, updater, series } = require('@architect/utils')
let { globSync } = require('@architect/utils/glob')
let _inventory = require('@architect/inventory')
let { isDep, ignoreDeps, stripCwd } = require('./lib')
let shared = require('./shared')
Expand Down Expand Up @@ -76,10 +75,10 @@ function hydrator (inventory, installing, params, callback) {
/**
* Find our dependency manifests
*/
let pattern = p => pathToUnix(`${p}/**/@(${manifestFiles.join('|')})`)
let pattern = p => pathToUnix(`${p}/**/{${manifestFiles.join(',')}}`)
let dir = basepath || '.'
// Get everything except shared
let manifests = globSync(pattern(dir), { dot: true }).filter(file => {
let manifests = globSync(pattern(dir)).filter(file => {
if (possibleLambdaManifests.includes(file)) return true
if (isDep(file)) return false
if (sharedDir && file.includes(sharedDir)) return false
Expand Down
5 changes: 2 additions & 3 deletions test/integration/_shared.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
let { dirname, join } = require('path')
let { cp, existsSync } = require('fs')
let { globSync } = require('@architect/utils/glob')
let { cp, existsSync, globSync } = require('fs')
let { pathToUnix } = require('@architect/utils')
let { destroyPath } = require('../../src/lib')

Expand Down Expand Up @@ -59,7 +58,7 @@ let pythonDependencies = pythonFunctions
.map(p => join(p, 'vendor', 'urllib3'))

let rubyDependencies = () => rubyFunctions
.map(p => globSync(pathToUnix(`${p}/vendor/bundle/ruby/**/gems/a-0.2.1`))[0])
.map(p => Array.from(globSync(pathToUnix(`${p}/vendor/bundle/ruby/**/gems/a-0.2.1`)))[0])

let nodeDependencies = nodeFunctions
.map(p => join(p, 'node_modules', 'tiny-json-http'))
Expand Down
10 changes: 6 additions & 4 deletions test/unit/src/actions/install-update-tests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/**
let test = require('tape')

// Mock the child_process module to avoid actual command execution
Expand Down Expand Up @@ -34,7 +35,7 @@ let installUpdate = require('../../../../src/actions/install-update')
// Restore original require
Module.prototype.require = originalRequire

/*

test('install-update handles absolute paths correctly', t => {
t.plan(1)

Expand Down Expand Up @@ -71,7 +72,7 @@ test('install-update handles absolute paths correctly', t => {
start: () => ({ cancel: () => {} }),
cancel: () => {},
status: () => {},
error: (e) => {console.log(e)},
error: (e) => { console.log(e) },
},
verbose: false,
}
Expand Down Expand Up @@ -118,7 +119,7 @@ test('install-update handles relative paths correctly', t => {
start: () => ({ cancel: () => {} }),
cancel: () => {},
status: () => {},
error: (e) => {console.log(e)},
error: (e) => { console.log(e) },
},
verbose: false,
}
Expand All @@ -127,4 +128,5 @@ test('install-update handles relative paths correctly', t => {
installUpdate(params, (err) => {
t.notOk(err, 'install-update completes successfully with relative path')
})
}) */
})
*/