Skip to content

Commit e113c48

Browse files
committed
Move composer.json inside src/ directory.
1 parent 667feff commit e113c48

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

scripts/bundle.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { spawn } from 'child_process'
1+
import { spawn, SpawnOptions } from 'child_process'
22
import { createWriteStream } from 'fs'
33
import process from 'node:process'
44
import { webpack as webpackAsync } from 'webpack'
@@ -25,12 +25,12 @@ const BUNDLE_FILES = [
2525
'CHANGELOG.md'
2626
]
2727

28-
const execute = (command: string, ...args: readonly string[]): Promise<number | null> =>
28+
const execute = (command: string, args: readonly string[], options: SpawnOptions): Promise<number | null> =>
2929
new Promise(resolve => {
30-
const child = spawn(command, args)
30+
const child = spawn(command, args, { ...options })
3131

32-
child.stdout.on('data', (data: string) => process.stdout.write(data))
33-
child.stderr.on('data', (data: string) => process.stderr.write(data))
32+
child.stdout?.on('data', (data: string) => process.stdout.write(data))
33+
child.stderr?.on('data', (data: string) => process.stderr.write(data))
3434
child.on('close', code => resolve(code))
3535
})
3636

@@ -57,15 +57,15 @@ const bundle = async () => {
5757

5858
await Promise.all([
5959
cleanup(`${plugin.name}.*.zip`),
60-
execute('composer', 'install', '--no-dev'),
60+
execute('composer', ['install', '--no-dev'], { cwd: 'src' }),
6161
webpack({ mode: 'production' })
6262
])
6363

6464
await copy(BUNDLE_FILES, DEST_DIR, filename =>
6565
filename.replace(/^src\//, ''))
6666

6767
await createArchive()
68-
await execute('composer', 'install')
68+
await execute('composer', ['install'], { cwd: 'src' })
6969
}
7070

7171
void bundle().then()

composer.json renamed to src/composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"autoload": {
2424
"classmap": [
25-
"src/php/"
25+
"php/"
2626
]
2727
},
2828
"require": {
@@ -37,7 +37,6 @@
3737
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0"
3838
},
3939
"config": {
40-
"vendor-dir": "src/vendor",
4140
"allow-plugins": {
4241
"dealerdirect/phpcodesniffer-composer-installer": true,
4342
"composer/installers": true
File renamed without changes.

0 commit comments

Comments
 (0)