Skip to content
This repository was archived by the owner on Apr 21, 2022. It is now read-only.

Commit 6fb3dc6

Browse files
committed
fix: rename oclif manifest to not be a dotfile
1 parent 560bd4b commit 6fb3dc6

4 files changed

Lines changed: 49 additions & 35 deletions

File tree

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
},
99
"bugs": "https://github.com/oclif/dev-cli/issues",
1010
"dependencies": {
11-
"@oclif/command": "^1.4.18",
12-
"@oclif/config": "^1.6.16",
13-
"@oclif/errors": "^1.0.7",
11+
"@oclif/command": "^1.4.19",
12+
"@oclif/config": "^1.6.17",
13+
"@oclif/errors": "^1.0.8",
1414
"@oclif/plugin-help": "^1.2.7",
1515
"cli-ux": "^3.4.1",
1616
"debug": "^3.1.0",
@@ -23,7 +23,7 @@
2323
},
2424
"devDependencies": {
2525
"@oclif/plugin-legacy": "^1.0.13",
26-
"@oclif/test": "^1.0.5",
26+
"@oclif/test": "^1.0.6",
2727
"@oclif/tslint": "^1.1.0",
2828
"@types/chai": "^4.1.3",
2929
"@types/execa": "^0.9.0",
@@ -32,10 +32,10 @@
3232
"@types/lodash": "^4.14.108",
3333
"@types/lodash.template": "^4.4.3",
3434
"@types/mocha": "^5.2.0",
35-
"@types/node": "^10.0.2",
35+
"@types/node": "^10.0.3",
3636
"@types/supports-color": "^5.3.0",
3737
"@types/write-json-file": "^2.2.1",
38-
"aws-sdk": "^2.230.1",
38+
"aws-sdk": "^2.231.1",
3939
"chai": "^4.1.2",
4040
"globby": "^8.0.1",
4141
"mocha": "^5.1.1",
@@ -47,7 +47,7 @@
4747
"node": ">=8.0.0"
4848
},
4949
"files": [
50-
".oclif.manifest.json",
50+
"oclif.manifest.json",
5151
"/bin",
5252
"/lib"
5353
],
@@ -85,7 +85,7 @@
8585
"repository": "oclif/dev-cli",
8686
"scripts": {
8787
"lint": "tsc -p test --noEmit && tslint -p test -t stylish",
88-
"postpack": "rm -f .oclif.manifest.json",
88+
"postpack": "rm -f oclif.manifest.json",
8989
"posttest": "tsc -p test --noEmit && tslint -p test -t stylish",
9090
"prepack": "rm -rf lib && tsc && node ./bin/run manifest",
9191
"test": "mocha --forbid-only \"test/**/*.test.ts\"",

src/commands/manifest.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import {Command} from '@oclif/command'
44
import * as Config from '@oclif/config'
5-
import * as fs from 'fs'
5+
import * as fs from 'fs-extra'
66
import * as path from 'path'
77

88
export default class Manifest extends Command {
@@ -12,7 +12,7 @@ export default class Manifest extends Command {
1212
]
1313

1414
async run() {
15-
try { fs.unlinkSync('.oclif.manifest.json') } catch {}
15+
try { fs.unlinkSync('oclif.manifest.json') } catch {}
1616
const {args} = this.parse(Manifest)
1717
const root = path.resolve(args.path)
1818
let plugin = new Config.Plugin({root, type: 'core', ignoreManifest: true, errorOnManifestCreate: true})
@@ -29,8 +29,13 @@ export default class Manifest extends Command {
2929
if (process.env.OCLIF_NEXT_VERSION) {
3030
plugin.manifest.version = process.env.OCLIF_NEXT_VERSION
3131
}
32-
const file = path.join(plugin.root, '.oclif.manifest.json')
32+
const file = path.join(plugin.root, 'oclif.manifest.json')
3333
fs.writeFileSync(file, JSON.stringify(plugin.manifest))
34+
if (this.config.pjson.files.includes('.oclif.manifest.json')) {
35+
const pjson = await fs.readJSON('package.json')
36+
pjson.files = pjson.files.map((f: string) => f === '.oclif.manifest.json' ? 'oclif.manifest.json' : f)
37+
await fs.outputJSON('package.json', pjson, {spaces: 2})
38+
}
3439
this.log(`wrote manifest to ${file}`)
3540
}
3641
}

test/manifest.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import * as fs from 'fs-extra'
55
describe('manifest', () => {
66
test
77
.stdout()
8-
.do(() => fs.remove('.oclif.manifest.json'))
9-
.finally(() => fs.remove('.oclif.manifest.json'))
8+
.do(() => fs.remove('oclif.manifest.json'))
9+
.finally(() => fs.remove('oclif.manifest.json'))
1010
.command(['manifest'])
1111
.it('outputs plugins', ctx => {
12-
const {commands} = fs.readJSONSync('.oclif.manifest.json') as Config.Manifest
12+
const {commands} = fs.readJSONSync('oclif.manifest.json') as Config.Manifest
1313
expect(commands.manifest).to.include({
1414
description: 'generates plugin manifest json'
1515
})
16-
expect(ctx.stdout).to.match(/wrote manifest to .*\.oclif.manifest.json/)
16+
expect(ctx.stdout).to.match(/wrote manifest to .*oclif.manifest.json/)
1717
})
1818
})

yarn.lock

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,18 @@
5454
debug "^3.1.0"
5555
semver "^5.5.0"
5656

57-
"@oclif/config@^1.6.16":
58-
version "1.6.16"
59-
resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.6.16.tgz#6bcb03bf30ee54eeafa788777d965bf47bb5047d"
57+
"@oclif/command@^1.4.19":
58+
version "1.4.19"
59+
resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.4.19.tgz#7158eec97d9b4c4a109181e6a71bd83d34757254"
60+
dependencies:
61+
"@oclif/errors" "^1.0.6"
62+
"@oclif/parser" "^3.3.3"
63+
debug "^3.1.0"
64+
semver "^5.5.0"
65+
66+
"@oclif/config@^1.6.17":
67+
version "1.6.17"
68+
resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.6.17.tgz#e9608f56e5acd49fcaf3bbfcc3e8818d81b1ba12"
6069
dependencies:
6170
debug "^3.1.0"
6271

@@ -70,9 +79,9 @@
7079
strip-ansi "^4.0.0"
7180
wrap-ansi "^3.0.1"
7281

73-
"@oclif/errors@^1.0.7":
74-
version "1.0.7"
75-
resolved "https://registry.yarnpkg.com/@oclif/errors/-/errors-1.0.7.tgz#13d7205801944c341534370e65140d21ab929e24"
82+
"@oclif/errors@^1.0.8":
83+
version "1.0.8"
84+
resolved "https://registry.yarnpkg.com/@oclif/errors/-/errors-1.0.8.tgz#2f8239267506bb7c3f5fd776144c2686e5b7fff7"
7685
dependencies:
7786
clean-stack "^1.3.0"
7887
fs-extra "^6.0.0"
@@ -118,11 +127,11 @@
118127
version "1.0.2"
119128
resolved "https://registry.yarnpkg.com/@oclif/screen/-/screen-1.0.2.tgz#c9d7c84b0ea60ecec8dd7a9b22c012ba9967aed8"
120129

121-
"@oclif/test@^1.0.5":
122-
version "1.0.5"
123-
resolved "https://registry.yarnpkg.com/@oclif/test/-/test-1.0.5.tgz#2b8e8384148a75c6cc6ef20df54cfa55cde15d4e"
130+
"@oclif/test@^1.0.6":
131+
version "1.0.6"
132+
resolved "https://registry.yarnpkg.com/@oclif/test/-/test-1.0.6.tgz#45dbab5610caed9f178e33ff6b416f6ce2dc245c"
124133
dependencies:
125-
fancy-test "^1.0.5"
134+
fancy-test "^1.0.6"
126135

127136
"@oclif/tslint@^1.1.0":
128137
version "1.1.0"
@@ -186,9 +195,9 @@
186195
version "8.10.11"
187196
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.11.tgz#971ea8cb91adbe0b74e3fbd867dec192d5893a5f"
188197

189-
"@types/node@^10.0.2":
190-
version "10.0.2"
191-
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.0.2.tgz#180046ebbc37de8b64777765c2486ebecb59448e"
198+
"@types/node@^10.0.3":
199+
version "10.0.3"
200+
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.0.3.tgz#1f89840c7aac2406cc43a2ecad98fc02a8e130e4"
192201

193202
"@types/supports-color@^5.3.0":
194203
version "5.3.0"
@@ -272,9 +281,9 @@ atob@^2.0.0:
272281
version "2.1.1"
273282
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.1.tgz#ae2d5a729477f289d60dd7f96a6314a22dd6c22a"
274283

275-
aws-sdk@^2.230.1:
276-
version "2.230.1"
277-
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.230.1.tgz#494cef6aed2e16db1ed9c12acf4bd2a7317f5365"
284+
aws-sdk@^2.231.1:
285+
version "2.231.1"
286+
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.231.1.tgz#ff0a63f73c71b6b098389b926b857b13816bd5f9"
278287
dependencies:
279288
buffer "4.9.1"
280289
events "1.1.1"
@@ -689,11 +698,11 @@ extract-stack@^1.0.0:
689698
version "1.0.0"
690699
resolved "https://registry.yarnpkg.com/extract-stack/-/extract-stack-1.0.0.tgz#b97acaf9441eea2332529624b732fc5a1c8165fa"
691700

692-
fancy-test@^1.0.5:
693-
version "1.0.5"
694-
resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-1.0.5.tgz#323970de576f7dc0938402c3a731ee4d59896a11"
701+
fancy-test@^1.0.6:
702+
version "1.0.6"
703+
resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-1.0.6.tgz#e0a061ecdcfb9d8fbea1f86375ed26e258ed7243"
695704
dependencies:
696-
lodash "^4.17.5"
705+
lodash "^4.17.10"
697706
stdout-stderr "^0.1.9"
698707

699708
fast-glob@^2.0.2:

0 commit comments

Comments
 (0)