Skip to content

Commit 12f05b8

Browse files
author
Chris Brody
authored
remove library API support for namespace (#276)
* remove library API support for namespace followup to 0de40fa - remove Windows (C#) support (PR #264) extra namespace parameter no longer needed was discovered through mutation testing using Stryker Mutator (as reported in issue #274) namespace parameter is commented out for now, at least removed from library API since Windows platform is no longer supported Note that it should be possible to add Windows platform support and support the namespace parameter at some point in the future. * update a related comment * add another blank line to the affected code * update an error logging test snapshot
1 parent b68cb77 commit 12f05b8

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

lib/lib.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ const generateWithNormalizedOptions = ({
6767
className,
6868
modulePrefix,
6969
packageIdentifier = DEFAULT_PACKAGE_IDENTIFIER,
70-
namespace,
70+
// namespace - library API member removed since Windows platform
71+
// is now removed (may be added back someday in the future)
72+
// namespace,
7173
platforms = DEFAULT_PLATFORMS,
7274
tvosEnabled = false,
7375
githubAccount = DEFAULT_GITHUB_ACCOUNT,
@@ -164,7 +166,9 @@ const generateWithNormalizedOptions = ({
164166
name: className,
165167
moduleName,
166168
packageIdentifier,
167-
namespace,
169+
// namespace - library API member removed since Windows platform
170+
// is now removed (may be added back someday in the future)
171+
// namespace,
168172
platforms,
169173
tvosEnabled,
170174
githubAccount,

lib/normalized-options.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ module.exports = (options) => {
1818

1919
const moduleName = options.moduleName;
2020

21-
// OPTIONS NOT DOCUMENTED, not supported by CLI:
21+
// [TBD] option NOT DOCUMENTED & NOT SUPPORTED by CLI:
2222
const className = options.className;
23-
const namespace = options.namespace;
23+
24+
// namespace - library API member removed since Windows platform
25+
// is now removed (may be added back someday in the future)
26+
// const namespace = options.namespace;
2427

2528
return Object.assign(
2629
{ name, prefix, modulePrefix },
@@ -31,8 +34,10 @@ module.exports = (options) => {
3134
className
3235
? {}
3336
: { className: `${prefix}${pascalCase(name)}` },
34-
namespace
35-
? {}
36-
: { namespace: pascalCase(name).split(/(?=[A-Z])/).join('.') },
37+
// namespace - library API member removed since Windows platform
38+
// is now removed (may be added back someday in the future)
39+
// namespace
40+
// ? {}
41+
// : { namespace: pascalCase(name).split(/(?=[A-Z])/).join('.') },
3742
);
3843
};

tests/with-mocks/cli/command/func/with-logging/with-error/__snapshots__/cli-command-with-logging-with-error.test.js.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ Array [
4545
"error": Array [
4646
"Error: ENOPERM not permitted
4747
at Object.ensureDir (.../tests/with-mocks/cli/command/func/with-logging/with-error/cli-command-with-logging-with-error.test.js:9:27)
48-
at ensureDir (.../lib/lib.js:155:15)
49-
at generateLibraryModule (.../lib/lib.js:281:10)
50-
at generateWithNormalizedOptions (.../lib/lib.js:298:10)
48+
at ensureDir (.../lib/lib.js:157:15)
49+
at generateLibraryModule (.../lib/lib.js:285:10)
50+
at generateWithNormalizedOptions (.../lib/lib.js:302:10)
5151
at createLibraryModule (.../lib/cli-command.js:...
5252
at Object.func (.../tests/with-mocks/cli/command/func/with-logging/with-error/cli-command-with-logging-with-error.test.js:62:9)
5353
",

0 commit comments

Comments
 (0)