Skip to content

Commit 51faf28

Browse files
colomologhepting
authored andcommitted
feat: Stop publishing contentful-ui-extensions-sdk package to npm (#1584) [EXT-3593]
1 parent 95541bc commit 51faf28

File tree

4 files changed

+40
-47
lines changed

4 files changed

+40
-47
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ A new package version is automatically published to npm using [semantic-release]
3333

3434
To manually publish the package, run `npm run publish-all`.
3535

36-
This repository is published as two packages with identical data. We recommend using `@contentful/app-sdk`.
37-
38-
- `@contentful/app-sdk`
39-
- `contentful-ui-extensions-sdk`
36+
This repository is published as `@contentful/app-sdk` package.
4037

4138
#### Canary releases
4239

scripts/publish.js

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,34 @@ const {
33
isCanary,
44
restorePackageJson,
55
setPackageName,
6-
PACKAGES,
6+
PACKAGE_NAME,
77
MODULE_MAIN_PATH,
88
getVersion,
99
getTag,
1010
} = require('./shared')
1111

1212
try {
13-
for (const package of PACKAGES) {
14-
console.log('')
15-
console.log(`📦 Deploying package: ${package}`)
13+
console.log('')
14+
console.log(`📦 Deploying package: ${PACKAGE_NAME}`)
1615

17-
const version = getVersion()
18-
const tag = getTag(isCanary(version))
16+
const version = getVersion()
17+
const tag = getTag(isCanary(version))
1918

20-
console.log(` > 📝 Updating package name...`)
21-
setPackageName(package)
19+
console.log(` > 📝 Updating package name...`)
20+
setPackageName(PACKAGE_NAME)
2221

23-
console.log(` > 📚 Publishing ${package} on the registry...`)
24-
const { status } = spawn.sync('npm', ['publish', '--access', 'public', '--tag', tag], {
25-
stdio: 'inherit',
26-
cwd: MODULE_MAIN_PATH,
27-
})
22+
console.log(` > 📚 Publishing ${PACKAGE_NAME} on the registry...`)
23+
const { status } = spawn.sync('npm', ['publish', '--access', 'public', '--tag', tag], {
24+
stdio: 'inherit',
25+
cwd: MODULE_MAIN_PATH,
26+
})
2827

29-
if (status !== 0) {
30-
throw new Error(`Failed to publish ${package}`)
31-
}
32-
33-
console.log(`✅ Successfully published ${package}@${getVersion()} on ${tag}!`)
34-
console.log('')
28+
if (status !== 0) {
29+
throw new Error(`Failed to publish ${PACKAGE_NAME}`)
3530
}
31+
32+
console.log(`✅ Successfully published ${PACKAGE_NAME}@${getVersion()} on ${tag}!`)
33+
console.log('')
3634
} catch (err) {
3735
throw new Error(err)
3836
} finally {

scripts/shared.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require('path')
22
const spawn = require('cross-spawn')
33
const fs = require('fs')
44

5-
const PACKAGES = ['contentful-ui-extensions-sdk', '@contentful/app-sdk']
5+
const PACKAGE_NAME = '@contentful/app-sdk'
66
const MODULE_MAIN_PATH = path.resolve(__dirname, '..')
77
const PACKAGE_JSON_PATH = path.resolve(MODULE_MAIN_PATH, 'package.json')
88

@@ -33,7 +33,7 @@ function setPackageName(name) {
3333
}
3434

3535
module.exports = {
36-
PACKAGES,
36+
PACKAGE_NAME,
3737
MODULE_MAIN_PATH,
3838
PACKAGE_JSON_PATH,
3939
getVersion,

scripts/verify.js

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const {
44
getVersion,
55
restorePackageJson,
66
setPackageName,
7-
PACKAGES,
7+
PACKAGE_NAME,
88
MODULE_MAIN_PATH,
99
getTag,
1010
} = require('./shared')
@@ -14,33 +14,31 @@ if (!process.env.NPM_TOKEN) {
1414
}
1515

1616
try {
17-
for (const package of PACKAGES) {
18-
console.log('')
19-
console.log(`📦 Deploying package: ${package} (dry run)`)
17+
console.log('')
18+
console.log(`📦 Deploying package: ${PACKAGE_NAME} (dry run)`)
2019

21-
const version = getVersion()
22-
const tag = getTag(isCanary(version))
20+
const version = getVersion()
21+
const tag = getTag(isCanary(version))
2322

24-
console.log(` > 📝 Updating package name...`)
25-
setPackageName(package)
23+
console.log(` > 📝 Updating package name...`)
24+
setPackageName(PACKAGE_NAME)
2625

27-
console.log(` > 📚 Publishing ${package} on the registry... (dry run)`)
28-
const { status } = spawn.sync(
29-
'npm',
30-
['publish', '--access', 'public', '--dry-run', '--tag', tag],
31-
{
32-
stdio: 'inherit',
33-
cwd: MODULE_MAIN_PATH,
34-
}
35-
)
36-
37-
if (status !== 0) {
38-
throw new Error(`Failed to publish ${package}`)
26+
console.log(` > 📚 Publishing ${PACKAGE_NAME} on the registry... (dry run)`)
27+
const { status } = spawn.sync(
28+
'npm',
29+
['publish', '--access', 'public', '--dry-run', '--tag', tag],
30+
{
31+
stdio: 'inherit',
32+
cwd: MODULE_MAIN_PATH,
3933
}
34+
)
4035

41-
console.log(`✅ Dry run for ${package} on ${tag} successful!`)
42-
console.log('')
36+
if (status !== 0) {
37+
throw new Error(`Failed to publish ${PACKAGE_NAME}`)
4338
}
39+
40+
console.log(`✅ Dry run for ${PACKAGE_NAME} on ${tag} successful!`)
41+
console.log('')
4442
} catch (err) {
4543
throw new Error(err)
4644
} finally {

0 commit comments

Comments
 (0)