Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed Dec 24, 2023
1 parent d3953e9 commit 737e3ce
Show file tree
Hide file tree
Showing 13 changed files with 131 additions and 527 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"@mantine/notifications": "^7.3.0",
"@mantine/spotlight": "^7.3.0",
"@nx/devkit": "17.2.7",
"@nx/linter": "17.2.7",
"@solana-developers/preset-anchor": "2.0.0-beta.4",
"@beeman/preset-anchor": "^2.0.0",
"@solana/spl-token": "^0.3.9",
"@solana/wallet-adapter-base": "^0.9.23",
"@solana/wallet-adapter-react": "^0.15.35",
Expand Down
7 changes: 4 additions & 3 deletions packages/create-pubkey-ui-app/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ async function main() {
throw new Error('Please provide a name for the workspace')
}

console.log(`Creating the workspace: ${name}`)

// This assumes "@pubkey-ui/generators" and "create-pubkey-ui-app" are at the same version
// eslint-disable-next-line @typescript-eslint/no-var-requires
const presetVersion = require('../package.json').version
const presetName = '@pubkey-ui/generators'
const preset = `${presetName}@${presetVersion}`
console.log(`Creating the workspace: ${name} with preset: ${preset}`)

// TODO: update below to customize the workspace
const { directory } = await createWorkspace(`@pubkey-ui/generators@${presetVersion}`, {
const { directory } = await createWorkspace(preset, {
name,
nxCloud: false,
packageManager: pm,
Expand Down
15 changes: 9 additions & 6 deletions packages/generators-e2e/src/create-pubkey-ui-app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@ describe('create-pubkey-ui-app', () => {
it('should be installed', () => {
projectDirectory = createTestProject()

// npm ls will fail if the package is not installed properly
execSync('npm ls @pubkey-ui/generators', {
// pnpm why will fail if the package is not installed properly
const result = execSync('pnpm why @pubkey-ui/generators', {
cwd: projectDirectory,
stdio: 'inherit',
stdio: 'pipe',
})
if (!result.toString().length) {
throw new Error('The plugin was not installed properly')
}
})
})

/**
* Creates a test project with create-nx-workspace and installs the plugin
* @returns The directory where the test project was created
*/
function createTestProject(extraArgs = '') {
function createTestProject() {
const projectName = 'test-project'
const projectDirectory = join(process.cwd(), 'tmp', projectName)

Expand All @@ -41,9 +44,9 @@ function createTestProject(extraArgs = '') {
recursive: true,
})

execSync(`npx --yes create-pubkey-ui-app@e2e ${projectName} ${extraArgs}`, {
execSync(`npx --yes create-pubkey-ui-app@e2e ${projectName} --verbose`, {
cwd: dirname(projectDirectory),
stdio: 'inherit',
stdio: 'pipe',
env: process.env,
})
console.log(`Created test project in "${projectDirectory}"`)
Expand Down
18 changes: 12 additions & 6 deletions packages/generators-e2e/src/generators.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ describe('generators', () => {

// The plugin has been built and published to a local registry in the jest globalSetup
// Install the plugin built with the latest source code into the test repo
execSync(`npm install @pubkey-ui/generators@e2e`, {
execSync(`pnpm install @pubkey-ui/generators@e2e`, {
cwd: projectDirectory,
stdio: 'inherit',
stdio: 'pipe',
env: process.env,
})
})
Expand All @@ -26,11 +26,17 @@ describe('generators', () => {
})

it('should be installed', () => {
// npm ls will fail if the package is not installed properly
execSync('npm ls @pubkey-ui/generators', {
// pnpm why will fail if the package is not installed properly
const result = execSync('pnpm why @pubkey-ui/generators', {
cwd: projectDirectory,
stdio: 'inherit',
stdio: 'pipe',
})
const output = result?.toString('utf-8')

if (!output?.length) {
throw new Error('The plugin was not installed properly')
}
expect(output).toContain('@pubkey-ui/generators')
})
})

Expand All @@ -51,7 +57,7 @@ function createTestProject() {
recursive: true,
})

execSync(`npx --yes create-nx-workspace@latest ${projectName} --preset apps --no-nxCloud --no-interactive`, {
execSync(`pnpx create-nx-workspace@latest ${projectName} --preset apps --no-nxCloud --no-interactive --pm pnpm`, {
cwd: dirname(projectDirectory),
stdio: 'inherit',
env: process.env,
Expand Down
10 changes: 5 additions & 5 deletions packages/generators/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "@pubkey-ui/generators",
"version": "0.0.1",
"dependencies": {
"@nx/devkit": "17.1.3",
"@nx/devkit": "17.2.7",
"tslib": "^2.3.0",
"@nx/js": "17.1.3",
"@nx/linter": "^17.1.3",
"@nx/react": "17.1.3",
"@solana-developers/preset-anchor": "2.0.0-beta.4"
"@nx/js": "17.2.7",
"@nx/react": "17.2.7",
"@beeman/preset-anchor": "2.0.0",
"@nx/eslint": "17.2.7"
},
"type": "commonjs",
"main": "./src/index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getProjects, Tree, updateJson } from '@nx/devkit'
import { anchorApplicationGenerator } from '@solana-developers/preset-anchor'
import { anchorApplicationGenerator } from '@beeman/preset-anchor'
import { join } from 'path'
import { generateReactApplication } from '../../utils/generate-react-application'
import {
Expand Down
Loading

0 comments on commit 737e3ce

Please sign in to comment.