Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: use latest arborist 6 and drop support for node 12 and 14 #925

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/pr-testing-with-test-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '12', '14', '16' ]
node: [ '16.13', '18' ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down
10 changes: 5 additions & 5 deletions lib/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const filenamify = require('filenamify');
const git = require('simple-git');
const log = require('loglevel');
const Arborist = require('@npmcli/arborist');
const pacote = require('pacote');
const { validateTemplateConfig } = require('./templateConfigValidator');
const {
convertMapToObject,
Expand Down Expand Up @@ -395,12 +396,11 @@ class Generator {
saveType: 'prod',
save: false
});

const addResult = arb[Symbol.for('resolvedAdd')];
if (!addResult) return reject('Unable to resolve the name of the added package. It was most probably not added to node_modules successfully');

const packageName = addResult[0].name;

const manifest = await pacote.manifest(this.templateName);
const packageName = manifest.name;
const packageVersion = installResult.children.get(packageName).version;

const packagePath = installResult.children.get(packageName).path;

if (!isFileSystemPath(this.templateName)) log.debug(logMessage.templateSuccessfullyInstalled(packageName, packagePath));
Expand Down
Loading