From 92159804719b1bfdef7fe70826863672f1c3ae44 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Thu, 7 Jan 2021 19:37:29 -0800 Subject: [PATCH] Remove moduleSpecName Summary: All our codegen JavaScript now simply uses libraryName instead of moduleSpecName. In our buck infra, we assign native_module_spec_name to libraryName. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D25842696 fbshipit-source-id: efd3af402585f9ad4ff3b593179147eea91cc331 --- packages/react-native-codegen/DEFS.bzl | 7 +++--- .../modules/GenerateModuleObjCpp-test.js | 4 ++-- .../src/cli/generators/generate-all.js | 7 +++--- .../src/generators/RNCodegen.js | 13 ++-------- .../GenerateComponentDescriptorH.js | 1 - .../components/GenerateComponentHObjCpp.js | 1 - .../components/GenerateEventEmitterCpp.js | 1 - .../components/GenerateEventEmitterH.js | 1 - .../generators/components/GeneratePropsCpp.js | 1 - .../generators/components/GeneratePropsH.js | 1 - .../components/GeneratePropsJavaDelegate.js | 1 - .../components/GeneratePropsJavaInterface.js | 1 - .../components/GenerateShadowNodeCpp.js | 1 - .../components/GenerateShadowNodeH.js | 1 - .../generators/components/GenerateTests.js | 1 - .../GenerateComponentDescriptorH-test.js | 4 +--- .../GenerateComponentHObjCpp-test.js | 4 +--- .../__tests__/GenerateEventEmitterCpp-test.js | 4 +--- .../__tests__/GenerateEventEmitterH-test.js | 4 +--- .../__tests__/GeneratePropsCpp-test.js | 4 +--- .../__tests__/GeneratePropsH-test.js | 4 +--- .../GeneratePropsJavaDelegate-test.js | 4 +--- .../GeneratePropsJavaInterface-test.js | 4 +--- .../__tests__/GenerateShadowNodeH-test.js | 4 +--- .../__tests__/GenerateTests-test.js | 4 +--- .../generators/modules/GenerateModuleCpp.js | 1 - .../src/generators/modules/GenerateModuleH.js | 1 - .../modules/GenerateModuleJavaSpec.js | 1 - .../modules/GenerateModuleJniCpp.js | 5 ++-- .../generators/modules/GenerateModuleJniH.js | 3 +-- .../modules/GenerateModuleObjCpp/index.js | 5 ++-- .../__tests__/GenerateModuleCpp-test.js | 1 - .../modules/__tests__/GenerateModuleH-test.js | 1 - .../__tests__/GenerateModuleHObjCpp-test.js | 3 +-- .../__tests__/GenerateModuleJavaSpec-test.js | 1 - .../__tests__/GenerateModuleJniCpp-test.js | 1 - .../__tests__/GenerateModuleJniH-test.js | 1 - .../__tests__/GenerateModuleMm-test.js | 6 +++-- .../GenerateModuleHObjCpp-test.js.snap | 12 +++++----- .../GenerateModuleJniCpp-test.js.snap | 24 +++++++++---------- .../GenerateModuleJniH-test.js.snap | 12 +++++----- .../GenerateModuleMm-test.js.snap | 24 +++++++++---------- scripts/generate-specs-cli.js | 10 +------- 43 files changed, 67 insertions(+), 127 deletions(-) diff --git a/packages/react-native-codegen/DEFS.bzl b/packages/react-native-codegen/DEFS.bzl index b8122b153b9627..4b1ff7acc7bd60 100644 --- a/packages/react-native-codegen/DEFS.bzl +++ b/packages/react-native-codegen/DEFS.bzl @@ -119,11 +119,10 @@ def rn_codegen_modules( fb_native.genrule( name = generate_fixtures_rule_name, srcs = native.glob(["src/generators/**/*.js"]), - cmd = "$(exe {generator_script}) $(location {schema_target}) {library_name} $OUT {native_module_spec_name} {android_package_name}".format( + cmd = "$(exe {generator_script}) $(location {schema_target}) {library_name} $OUT {android_package_name}".format( generator_script = react_native_root_target("packages/react-native-codegen:generate_all_from_schema"), schema_target = schema_target, - library_name = name, - native_module_spec_name = native_module_spec_name, + library_name = native_module_spec_name, android_package_name = android_package_name, ), out = "codegenfiles-{}".format(name), @@ -285,7 +284,7 @@ def rn_codegen_components( fb_native.genrule( name = generate_fixtures_rule_name, srcs = native.glob(["src/generators/**/*.js"]), - cmd = "$(exe {}) $(location {}) {} $OUT {}".format(react_native_root_target("packages/react-native-codegen:generate_all_from_schema"), schema_target, name, name), + cmd = "$(exe {}) $(location {}) {} $OUT".format(react_native_root_target("packages/react-native-codegen:generate_all_from_schema"), schema_target, name), out = "codegenfiles-{}".format(name), labels = ["codegen_rule"], ) diff --git a/packages/react-native-codegen/e2e/__tests__/modules/GenerateModuleObjCpp-test.js b/packages/react-native-codegen/e2e/__tests__/modules/GenerateModuleObjCpp-test.js index 2b2deec0b0fe33..039c05323bdd08 100644 --- a/packages/react-native-codegen/e2e/__tests__/modules/GenerateModuleObjCpp-test.js +++ b/packages/react-native-codegen/e2e/__tests__/modules/GenerateModuleObjCpp-test.js @@ -38,13 +38,13 @@ function getModules(): SchemaType { describe('GenerateModuleObjCpp', () => { it('can generate a header file NativeModule specs', () => { const libName = 'RNCodegenModuleFixtures'; - const output = generator.generate(libName, getModules(), libName); + const output = generator.generate(libName, getModules()); expect(output.get(libName + '.h')).toMatchSnapshot(); }); it('can generate an implementation file NativeModule specs', () => { const libName = 'RNCodegenModuleFixtures'; - const output = generator.generate(libName, getModules(), libName); + const output = generator.generate(libName, getModules()); expect(output.get(libName + '-generated.mm')).toMatchSnapshot(); }); }); diff --git a/packages/react-native-codegen/src/cli/generators/generate-all.js b/packages/react-native-codegen/src/cli/generators/generate-all.js index 6b7e8509e9589c..3aaca12c7a28ad 100644 --- a/packages/react-native-codegen/src/cli/generators/generate-all.js +++ b/packages/react-native-codegen/src/cli/generators/generate-all.js @@ -19,7 +19,7 @@ const fs = require('fs'); const mkdirp = require('mkdirp'); const args = process.argv.slice(2); -if (args.length < 4) { +if (args.length < 3) { throw new Error( `Expected to receive path to schema, library name, output directory and module spec name. Received ${args.join( ', ', @@ -30,8 +30,7 @@ if (args.length < 4) { const schemaPath = args[0]; const libraryName = args[1]; const outputDirectory = args[2]; -const moduleSpecName = args[3]; -const packageName = args[4]; +const packageName = args[3]; const schemaText = fs.readFileSync(schemaPath, 'utf-8'); @@ -49,7 +48,7 @@ try { } RNCodegen.generate( - {libraryName, schema, outputDirectory, moduleSpecName, packageName}, + {libraryName, schema, outputDirectory, packageName}, { generators: [ 'descriptors', diff --git a/packages/react-native-codegen/src/generators/RNCodegen.js b/packages/react-native-codegen/src/generators/RNCodegen.js index 06cf6f07845623..34b2a390300bc5 100644 --- a/packages/react-native-codegen/src/generators/RNCodegen.js +++ b/packages/react-native-codegen/src/generators/RNCodegen.js @@ -44,7 +44,6 @@ type Options = $ReadOnly<{ libraryName: string, schema: SchemaType, outputDirectory: string, - moduleSpecName: string, packageName?: string, // Some platforms have a notion of package, which should be configurable. }>; @@ -153,13 +152,7 @@ function checkFilesForChanges( module.exports = { generate( - { - libraryName, - schema, - outputDirectory, - moduleSpecName, - packageName, - }: Options, + {libraryName, schema, outputDirectory, packageName}: Options, {generators, test}: Config, ): boolean { schemaValidator.validate(schema); @@ -167,9 +160,7 @@ module.exports = { const generatedFiles = []; for (const name of generators) { for (const generator of GENERATORS[name]) { - generatedFiles.push( - ...generator(libraryName, schema, moduleSpecName, packageName), - ); + generatedFiles.push(...generator(libraryName, schema, packageName)); } } diff --git a/packages/react-native-codegen/src/generators/components/GenerateComponentDescriptorH.js b/packages/react-native-codegen/src/generators/components/GenerateComponentDescriptorH.js index cf3d0e03fbb0da..2adf7ad393631d 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateComponentDescriptorH.js +++ b/packages/react-native-codegen/src/generators/components/GenerateComponentDescriptorH.js @@ -47,7 +47,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { const fileName = 'ComponentDescriptors.h'; diff --git a/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js b/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js index b8950352b58c33..a2f42c8b3476f0 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js +++ b/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js @@ -323,7 +323,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { const fileName = 'RCTComponentViewHelpers.h'; diff --git a/packages/react-native-codegen/src/generators/components/GenerateEventEmitterCpp.js b/packages/react-native-codegen/src/generators/components/GenerateEventEmitterCpp.js index 62201df8f368c3..b4f32f428079c7 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateEventEmitterCpp.js +++ b/packages/react-native-codegen/src/generators/components/GenerateEventEmitterCpp.js @@ -189,7 +189,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { const moduleComponents: ComponentCollection = Object.keys(schema.modules) diff --git a/packages/react-native-codegen/src/generators/components/GenerateEventEmitterH.js b/packages/react-native-codegen/src/generators/components/GenerateEventEmitterH.js index 6a6607ac8bb8be..812783b947d3b3 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateEventEmitterH.js +++ b/packages/react-native-codegen/src/generators/components/GenerateEventEmitterH.js @@ -238,7 +238,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { const moduleComponents: ComponentCollection = Object.keys(schema.modules) diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js b/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js index 1380c768102c1c..39fc1ffc60fbb7 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js @@ -85,7 +85,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { const fileName = 'Props.cpp'; diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsH.js b/packages/react-native-codegen/src/generators/components/GeneratePropsH.js index d9dd5152248474..d218d809bc5bac 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsH.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsH.js @@ -751,7 +751,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { const fileName = 'Props.h'; diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js index e931e1fe125631..0e71cdbaa8673b 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js @@ -264,7 +264,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { // TODO: This doesn't support custom package name yet. diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js index daa2afe92c3d64..77781ec192b22a 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js @@ -212,7 +212,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { // TODO: This doesn't support custom package name yet. diff --git a/packages/react-native-codegen/src/generators/components/GenerateShadowNodeCpp.js b/packages/react-native-codegen/src/generators/components/GenerateShadowNodeCpp.js index 2644808cac19d8..f52444da89d64e 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateShadowNodeCpp.js +++ b/packages/react-native-codegen/src/generators/components/GenerateShadowNodeCpp.js @@ -44,7 +44,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { const fileName = 'ShadowNodes.cpp'; diff --git a/packages/react-native-codegen/src/generators/components/GenerateShadowNodeH.js b/packages/react-native-codegen/src/generators/components/GenerateShadowNodeH.js index 1855b379d447f8..b42da9bd557615 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateShadowNodeH.js +++ b/packages/react-native-codegen/src/generators/components/GenerateShadowNodeH.js @@ -54,7 +54,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { const fileName = 'ShadowNodes.h'; diff --git a/packages/react-native-codegen/src/generators/components/GenerateTests.js b/packages/react-native-codegen/src/generators/components/GenerateTests.js index b8fde56ab584b1..ef5c3a47dfc2af 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateTests.js +++ b/packages/react-native-codegen/src/generators/components/GenerateTests.js @@ -139,7 +139,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { const fileName = 'Tests.cpp'; diff --git a/packages/react-native-codegen/src/generators/components/__tests__/GenerateComponentDescriptorH-test.js b/packages/react-native-codegen/src/generators/components/__tests__/GenerateComponentDescriptorH-test.js index c73dd315c8bf95..02133c76f90539 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/GenerateComponentDescriptorH-test.js +++ b/packages/react-native-codegen/src/generators/components/__tests__/GenerateComponentDescriptorH-test.js @@ -21,9 +21,7 @@ describe('GenerateComponentDescriptorH', () => { const fixture = fixtures[fixtureName]; it(`can generate fixture ${fixtureName}`, () => { - expect( - generator.generate(fixtureName, fixture, 'SampleSpec'), - ).toMatchSnapshot(); + expect(generator.generate(fixtureName, fixture)).toMatchSnapshot(); }); }); }); diff --git a/packages/react-native-codegen/src/generators/components/__tests__/GenerateComponentHObjCpp-test.js b/packages/react-native-codegen/src/generators/components/__tests__/GenerateComponentHObjCpp-test.js index 44528dbbb02a37..52b638973aae82 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/GenerateComponentHObjCpp-test.js +++ b/packages/react-native-codegen/src/generators/components/__tests__/GenerateComponentHObjCpp-test.js @@ -21,9 +21,7 @@ describe('GenerateComponentHObjCpp', () => { const fixture = fixtures[fixtureName]; it(`can generate fixture ${fixtureName}`, () => { - expect( - generator.generate(fixtureName, fixture, 'SampleSpec'), - ).toMatchSnapshot(); + expect(generator.generate(fixtureName, fixture)).toMatchSnapshot(); }); }); }); diff --git a/packages/react-native-codegen/src/generators/components/__tests__/GenerateEventEmitterCpp-test.js b/packages/react-native-codegen/src/generators/components/__tests__/GenerateEventEmitterCpp-test.js index 5a17690e597b8f..14ac106e959b4d 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/GenerateEventEmitterCpp-test.js +++ b/packages/react-native-codegen/src/generators/components/__tests__/GenerateEventEmitterCpp-test.js @@ -21,9 +21,7 @@ describe('GenerateEventEmitterCpp', () => { const fixture = fixtures[fixtureName]; it(`can generate fixture ${fixtureName}`, () => { - expect( - generator.generate(fixtureName, fixture, 'SampleSpec'), - ).toMatchSnapshot(); + expect(generator.generate(fixtureName, fixture)).toMatchSnapshot(); }); }); }); diff --git a/packages/react-native-codegen/src/generators/components/__tests__/GenerateEventEmitterH-test.js b/packages/react-native-codegen/src/generators/components/__tests__/GenerateEventEmitterH-test.js index 3b1974f66539f1..2b6a26422aa306 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/GenerateEventEmitterH-test.js +++ b/packages/react-native-codegen/src/generators/components/__tests__/GenerateEventEmitterH-test.js @@ -21,9 +21,7 @@ describe('GenerateEventEmitterH', () => { const fixture = fixtures[fixtureName]; it(`can generate fixture ${fixtureName}`, () => { - expect( - generator.generate(fixtureName, fixture, 'SampleSpec'), - ).toMatchSnapshot(); + expect(generator.generate(fixtureName, fixture)).toMatchSnapshot(); }); }); }); diff --git a/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsCpp-test.js b/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsCpp-test.js index 284c5457acadcb..f9b9332a1259ca 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsCpp-test.js +++ b/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsCpp-test.js @@ -21,9 +21,7 @@ describe('GeneratePropsCpp', () => { const fixture = fixtures[fixtureName]; it(`can generate fixture ${fixtureName}`, () => { - expect( - generator.generate(fixtureName, fixture, 'SampleSpec'), - ).toMatchSnapshot(); + expect(generator.generate(fixtureName, fixture)).toMatchSnapshot(); }); }); }); diff --git a/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsH-test.js b/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsH-test.js index 23f8769ebeb814..77305fc2c4a077 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsH-test.js +++ b/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsH-test.js @@ -21,9 +21,7 @@ describe('GeneratePropsH', () => { const fixture = fixtures[fixtureName]; it(`can generate fixture ${fixtureName}`, () => { - expect( - generator.generate(fixtureName, fixture, 'SampleSpec'), - ).toMatchSnapshot(); + expect(generator.generate(fixtureName, fixture)).toMatchSnapshot(); }); }); }); diff --git a/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsJavaDelegate-test.js b/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsJavaDelegate-test.js index b9c5724c914e6a..36f1f9e8a5ca1a 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsJavaDelegate-test.js +++ b/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsJavaDelegate-test.js @@ -21,9 +21,7 @@ describe('GeneratePropsJavaDelegate', () => { const fixture = fixtures[fixtureName]; it(`can generate fixture ${fixtureName}`, () => { - expect( - generator.generate(fixtureName, fixture, 'SampleSpec'), - ).toMatchSnapshot(); + expect(generator.generate(fixtureName, fixture)).toMatchSnapshot(); }); }); }); diff --git a/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsJavaInterface-test.js b/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsJavaInterface-test.js index a14ac875cc7b9a..cc1eadab41ab78 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsJavaInterface-test.js +++ b/packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsJavaInterface-test.js @@ -21,9 +21,7 @@ describe('GeneratePropsJavaInterface', () => { const fixture = fixtures[fixtureName]; it(`can generate fixture ${fixtureName}`, () => { - expect( - generator.generate(fixtureName, fixture, 'SampleSpec'), - ).toMatchSnapshot(); + expect(generator.generate(fixtureName, fixture)).toMatchSnapshot(); }); }); }); diff --git a/packages/react-native-codegen/src/generators/components/__tests__/GenerateShadowNodeH-test.js b/packages/react-native-codegen/src/generators/components/__tests__/GenerateShadowNodeH-test.js index 3edd5e3695fdab..ea704d4773d614 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/GenerateShadowNodeH-test.js +++ b/packages/react-native-codegen/src/generators/components/__tests__/GenerateShadowNodeH-test.js @@ -21,9 +21,7 @@ describe('GenerateShadowNodeH', () => { const fixture = fixtures[fixtureName]; it(`can generate fixture ${fixtureName}`, () => { - expect( - generator.generate(fixtureName, fixture, 'SampleSpec'), - ).toMatchSnapshot(); + expect(generator.generate(fixtureName, fixture)).toMatchSnapshot(); }); }); }); diff --git a/packages/react-native-codegen/src/generators/components/__tests__/GenerateTests-test.js b/packages/react-native-codegen/src/generators/components/__tests__/GenerateTests-test.js index 8b9f066b0c18b4..6961d0b1754ee1 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/GenerateTests-test.js +++ b/packages/react-native-codegen/src/generators/components/__tests__/GenerateTests-test.js @@ -21,9 +21,7 @@ describe('GenerateTests', () => { const fixture = fixtures[fixtureName]; it(`can generate fixture ${fixtureName}`, () => { - expect( - generator.generate(fixtureName, fixture, 'SampleSpec'), - ).toMatchSnapshot(); + expect(generator.generate(fixtureName, fixture)).toMatchSnapshot(); }); }); }); diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js index bd94bb33cfb7a4..215b57846dc8a8 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js @@ -184,7 +184,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { const nativeModules = getModules(schema); diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js index e1925f02eed790..2b50bd76b827c6 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js @@ -123,7 +123,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { const nativeModules = getModules(schema); diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleJavaSpec.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleJavaSpec.js index 8739e09bafad58..3f7f81897497e3 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleJavaSpec.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleJavaSpec.js @@ -367,7 +367,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { const files = new Map(); diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js index b75aea926b731d..9bebea4886f8e0 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js @@ -357,7 +357,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { const nativeModules = getModules(schema); @@ -451,12 +450,12 @@ module.exports = { }, ); - const fileName = `${moduleSpecName}-generated.cpp`; + const fileName = `${libraryName}-generated.cpp`; const replacedTemplate = FileTemplate({ modules: modules, libraryName: libraryName.replace(/-/g, '_'), moduleLookups, - include: `"${moduleSpecName}.h"`, + include: `"${libraryName}.h"`, }); return new Map([[`jni/${fileName}`, replacedTemplate]]); }, diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleJniH.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleJniH.js index a83207961bf120..43aee3cb585b63 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleJniH.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleJniH.js @@ -97,7 +97,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { const nativeModules = getModules(schema); @@ -113,7 +112,7 @@ module.exports = { .map(hasteModuleName => ModuleClassDeclarationTemplate({hasteModuleName})) .join('\n'); - const fileName = `${moduleSpecName}.h`; + const fileName = `${libraryName}.h`; const replacedTemplate = HeaderFileTemplate({ modules: modules, libraryName: libraryName.replace(/-/g, '_'), diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/index.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/index.js index 69fecf7e0e336c..eae698f52ace35 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/index.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/index.js @@ -113,7 +113,6 @@ module.exports = { generate( libraryName: string, schema: SchemaType, - moduleSpecName: string, packageName?: string, ): FilesOutput { const nativeModules = getModules(schema); @@ -191,13 +190,13 @@ module.exports = { ); } - const headerFileName = `${moduleSpecName}.h`; + const headerFileName = `${libraryName}.h`; const headerFile = HeaderFileTemplate({ moduleDeclarations: moduleDeclarations.join('\n'), structInlineMethods: structInlineMethods.join('\n'), }); - const sourceFileName = `${moduleSpecName}-generated.mm`; + const sourceFileName = `${libraryName}-generated.mm`; const sourceFile = SourceFileTemplate({ headerFileName, moduleImplementations: moduleImplementations.join('\n'), diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleCpp-test.js b/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleCpp-test.js index 6904c804baf900..a03ef0508b7851 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleCpp-test.js +++ b/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleCpp-test.js @@ -25,7 +25,6 @@ describe('GenerateModuleCpp', () => { generator.generate( fixtureName, fixture, - 'SampleSpec', 'com.facebook.fbreact.specs', ), ).toMatchSnapshot(); diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleH-test.js b/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleH-test.js index ffe05d6880de5a..3acbc7f638f94c 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleH-test.js +++ b/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleH-test.js @@ -25,7 +25,6 @@ describe('GenerateModuleH', () => { generator.generate( fixtureName, fixture, - 'SampleSpec', 'com.facebook.fbreact.specs', ), ).toMatchSnapshot(); diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleHObjCpp-test.js b/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleHObjCpp-test.js index fc148e2efc47ff..4544348ccff62c 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleHObjCpp-test.js +++ b/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleHObjCpp-test.js @@ -24,11 +24,10 @@ describe('GenerateModuleHObjCpp', () => { const output = generator.generate( fixtureName, fixture, - 'SampleSpec', 'com.facebook.fbreact.specs', ); expect( - new Map([['SampleSpec.h', output.get('SampleSpec.h')]]), + new Map([[`${fixtureName}.h`, output.get(`${fixtureName}.h`)]]), ).toMatchSnapshot(); }); }); diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleJavaSpec-test.js b/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleJavaSpec-test.js index e7c77457dd7eba..854d21388c18a8 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleJavaSpec-test.js +++ b/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleJavaSpec-test.js @@ -25,7 +25,6 @@ describe('GenerateModuleJavaSpec', () => { generator.generate( fixtureName, fixture, - 'SampleSpec', 'com.facebook.fbreact.specs', ), ).toMatchSnapshot(); diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleJniCpp-test.js b/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleJniCpp-test.js index d3dae278440717..0dfc249f71458f 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleJniCpp-test.js +++ b/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleJniCpp-test.js @@ -25,7 +25,6 @@ describe('GenerateModuleJniCpp', () => { generator.generate( fixtureName, fixture, - 'SampleSpec', 'com.facebook.fbreact.specs', ), ).toMatchSnapshot(); diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleJniH-test.js b/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleJniH-test.js index d5ac7ecfb32858..4e9e116b9619cb 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleJniH-test.js +++ b/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleJniH-test.js @@ -25,7 +25,6 @@ describe('GenerateModuleJniH', () => { generator.generate( fixtureName, fixture, - 'SampleSpec', 'com.facebook.fbreact.specs', ), ).toMatchSnapshot(); diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleMm-test.js b/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleMm-test.js index 3c0e5686585416..0d3fd81dd20694 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleMm-test.js +++ b/packages/react-native-codegen/src/generators/modules/__tests__/GenerateModuleMm-test.js @@ -24,12 +24,14 @@ describe('GenerateModuleMm', () => { const output = generator.generate( fixtureName, fixture, - 'SampleSpec', 'com.facebook.fbreact.specs', ); expect( new Map([ - ['SampleSpec-generated.mm', output.get('SampleSpec-generated.mm')], + [ + `${fixtureName}-generated.mm`, + output.get(`${fixtureName}-generated.mm`), + ], ]), ).toMatchSnapshot(); }); diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap index bc98ff9c128927..713889b0cf196e 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap @@ -2,7 +2,7 @@ exports[`GenerateModuleHObjCpp can generate fixture COMPLEX_OBJECTS 1`] = ` Map { - "SampleSpec.h" => "/** + "COMPLEX_OBJECTS.h" => "/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the @@ -260,7 +260,7 @@ inline facebook::react::LazyVector "/** + "EMPTY_NATIVE_MODULES.h" => "/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the @@ -311,7 +311,7 @@ namespace facebook { exports[`GenerateModuleHObjCpp can generate fixture NATIVE_MODULES_WITH_TYPE_ALIASES 1`] = ` Map { - "SampleSpec.h" => "/** + "NATIVE_MODULES_WITH_TYPE_ALIASES.h" => "/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the @@ -482,7 +482,7 @@ inline folly::Optional JS::AliasTurboModule::Options::allowExternalStorage exports[`GenerateModuleHObjCpp can generate fixture REAL_MODULE_EXAMPLE 1`] = ` Map { - "SampleSpec.h" => "/** + "REAL_MODULE_EXAMPLE.h" => "/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the @@ -772,7 +772,7 @@ inline bool JS::NativeImagePickerIOS::SpecOpenCameraDialogConfig::videoMode() co exports[`GenerateModuleHObjCpp can generate fixture SIMPLE_NATIVE_MODULES 1`] = ` Map { - "SampleSpec.h" => "/** + "SIMPLE_NATIVE_MODULES.h" => "/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the @@ -878,7 +878,7 @@ inline JS::NativeSampleTurboModule::Constants::Builder::Builder(Constants i) : _ exports[`GenerateModuleHObjCpp can generate fixture TWO_MODULES_DIFFERENT_FILES 1`] = ` Map { - "SampleSpec.h" => "/** + "TWO_MODULES_DIFFERENT_FILES.h" => "/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniCpp-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniCpp-test.js.snap index 932a69b65e466b..328f1a34779a55 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniCpp-test.js.snap @@ -2,7 +2,7 @@ exports[`GenerateModuleJniCpp can generate fixture COMPLEX_OBJECTS 1`] = ` Map { - "jni/SampleSpec-generated.cpp" => " + "jni/COMPLEX_OBJECTS-generated.cpp" => " /** * Copyright (c) Facebook, Inc. and its affiliates. * @@ -12,7 +12,7 @@ Map { * @generated by codegen project: GenerateModuleJniCpp.js */ -#include \\"SampleSpec.h\\" +#include \\"COMPLEX_OBJECTS.h\\" namespace facebook { namespace react { @@ -56,7 +56,7 @@ std::shared_ptr COMPLEX_OBJECTS_ModuleProvider(const std::string mo exports[`GenerateModuleJniCpp can generate fixture EMPTY_NATIVE_MODULES 1`] = ` Map { - "jni/SampleSpec-generated.cpp" => " + "jni/EMPTY_NATIVE_MODULES-generated.cpp" => " /** * Copyright (c) Facebook, Inc. and its affiliates. * @@ -66,7 +66,7 @@ Map { * @generated by codegen project: GenerateModuleJniCpp.js */ -#include \\"SampleSpec.h\\" +#include \\"EMPTY_NATIVE_MODULES.h\\" namespace facebook { namespace react { @@ -93,7 +93,7 @@ std::shared_ptr EMPTY_NATIVE_MODULES_ModuleProvider(const std::stri exports[`GenerateModuleJniCpp can generate fixture NATIVE_MODULES_WITH_TYPE_ALIASES 1`] = ` Map { - "jni/SampleSpec-generated.cpp" => " + "jni/NATIVE_MODULES_WITH_TYPE_ALIASES-generated.cpp" => " /** * Copyright (c) Facebook, Inc. and its affiliates. * @@ -103,7 +103,7 @@ Map { * @generated by codegen project: GenerateModuleJniCpp.js */ -#include \\"SampleSpec.h\\" +#include \\"NATIVE_MODULES_WITH_TYPE_ALIASES.h\\" namespace facebook { namespace react { @@ -134,7 +134,7 @@ std::shared_ptr NATIVE_MODULES_WITH_TYPE_ALIASES_ModuleProvider(con exports[`GenerateModuleJniCpp can generate fixture REAL_MODULE_EXAMPLE 1`] = ` Map { - "jni/SampleSpec-generated.cpp" => " + "jni/REAL_MODULE_EXAMPLE-generated.cpp" => " /** * Copyright (c) Facebook, Inc. and its affiliates. * @@ -144,7 +144,7 @@ Map { * @generated by codegen project: GenerateModuleJniCpp.js */ -#include \\"SampleSpec.h\\" +#include \\"REAL_MODULE_EXAMPLE.h\\" namespace facebook { namespace react { @@ -216,7 +216,7 @@ std::shared_ptr REAL_MODULE_EXAMPLE_ModuleProvider(const std::strin exports[`GenerateModuleJniCpp can generate fixture SIMPLE_NATIVE_MODULES 1`] = ` Map { - "jni/SampleSpec-generated.cpp" => " + "jni/SIMPLE_NATIVE_MODULES-generated.cpp" => " /** * Copyright (c) Facebook, Inc. and its affiliates. * @@ -226,7 +226,7 @@ Map { * @generated by codegen project: GenerateModuleJniCpp.js */ -#include \\"SampleSpec.h\\" +#include \\"SIMPLE_NATIVE_MODULES.h\\" namespace facebook { namespace react { @@ -305,7 +305,7 @@ std::shared_ptr SIMPLE_NATIVE_MODULES_ModuleProvider(const std::str exports[`GenerateModuleJniCpp can generate fixture TWO_MODULES_DIFFERENT_FILES 1`] = ` Map { - "jni/SampleSpec-generated.cpp" => " + "jni/TWO_MODULES_DIFFERENT_FILES-generated.cpp" => " /** * Copyright (c) Facebook, Inc. and its affiliates. * @@ -315,7 +315,7 @@ Map { * @generated by codegen project: GenerateModuleJniCpp.js */ -#include \\"SampleSpec.h\\" +#include \\"TWO_MODULES_DIFFERENT_FILES.h\\" namespace facebook { namespace react { diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniH-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniH-test.js.snap index 412b15cb456707..821ffc8303e736 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniH-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniH-test.js.snap @@ -2,7 +2,7 @@ exports[`GenerateModuleJniH can generate fixture COMPLEX_OBJECTS 1`] = ` Map { - "jni/SampleSpec.h" => " + "jni/COMPLEX_OBJECTS.h" => " /** * Copyright (c) Facebook, Inc. and its affiliates. * @@ -68,7 +68,7 @@ include $(BUILD_SHARED_LIBRARY) exports[`GenerateModuleJniH can generate fixture EMPTY_NATIVE_MODULES 1`] = ` Map { - "jni/SampleSpec.h" => " + "jni/EMPTY_NATIVE_MODULES.h" => " /** * Copyright (c) Facebook, Inc. and its affiliates. * @@ -134,7 +134,7 @@ include $(BUILD_SHARED_LIBRARY) exports[`GenerateModuleJniH can generate fixture NATIVE_MODULES_WITH_TYPE_ALIASES 1`] = ` Map { - "jni/SampleSpec.h" => " + "jni/NATIVE_MODULES_WITH_TYPE_ALIASES.h" => " /** * Copyright (c) Facebook, Inc. and its affiliates. * @@ -200,7 +200,7 @@ include $(BUILD_SHARED_LIBRARY) exports[`GenerateModuleJniH can generate fixture REAL_MODULE_EXAMPLE 1`] = ` Map { - "jni/SampleSpec.h" => " + "jni/REAL_MODULE_EXAMPLE.h" => " /** * Copyright (c) Facebook, Inc. and its affiliates. * @@ -274,7 +274,7 @@ include $(BUILD_SHARED_LIBRARY) exports[`GenerateModuleJniH can generate fixture SIMPLE_NATIVE_MODULES 1`] = ` Map { - "jni/SampleSpec.h" => " + "jni/SIMPLE_NATIVE_MODULES.h" => " /** * Copyright (c) Facebook, Inc. and its affiliates. * @@ -340,7 +340,7 @@ include $(BUILD_SHARED_LIBRARY) exports[`GenerateModuleJniH can generate fixture TWO_MODULES_DIFFERENT_FILES 1`] = ` Map { - "jni/SampleSpec.h" => " + "jni/TWO_MODULES_DIFFERENT_FILES.h" => " /** * Copyright (c) Facebook, Inc. and its affiliates. * diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap index b72fed68efcdec..f59a5b2b6f47ab 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap @@ -2,7 +2,7 @@ exports[`GenerateModuleMm can generate fixture COMPLEX_OBJECTS 1`] = ` Map { - "SampleSpec-generated.mm" => "/** + "COMPLEX_OBJECTS-generated.mm" => "/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the @@ -15,7 +15,7 @@ Map { * must have a single output. More files => more genrule()s => slower builds. */ -#import \\"SampleSpec.h\\" +#import \\"COMPLEX_OBJECTS.h\\" @implementation RCTCxxConvert (NativeSampleTurboModule_SpecDifficultAE) + (RCTManagedPointer *)JS_NativeSampleTurboModule_SpecDifficultAE:(id)json @@ -95,7 +95,7 @@ namespace facebook { exports[`GenerateModuleMm can generate fixture EMPTY_NATIVE_MODULES 1`] = ` Map { - "SampleSpec-generated.mm" => "/** + "EMPTY_NATIVE_MODULES-generated.mm" => "/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the @@ -108,7 +108,7 @@ Map { * must have a single output. More files => more genrule()s => slower builds. */ -#import \\"SampleSpec.h\\" +#import \\"EMPTY_NATIVE_MODULES.h\\" namespace facebook { @@ -127,7 +127,7 @@ namespace facebook { exports[`GenerateModuleMm can generate fixture NATIVE_MODULES_WITH_TYPE_ALIASES 1`] = ` Map { - "SampleSpec-generated.mm" => "/** + "NATIVE_MODULES_WITH_TYPE_ALIASES-generated.mm" => "/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the @@ -140,7 +140,7 @@ Map { * must have a single output. More files => more genrule()s => slower builds. */ -#import \\"SampleSpec.h\\" +#import \\"NATIVE_MODULES_WITH_TYPE_ALIASES.h\\" @implementation RCTCxxConvert (AliasTurboModule_OptionsOffset) + (RCTManagedPointer *)JS_AliasTurboModule_OptionsOffset:(id)json @@ -187,7 +187,7 @@ namespace facebook { exports[`GenerateModuleMm can generate fixture REAL_MODULE_EXAMPLE 1`] = ` Map { - "SampleSpec-generated.mm" => "/** + "REAL_MODULE_EXAMPLE-generated.mm" => "/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the @@ -200,7 +200,7 @@ Map { * must have a single output. More files => more genrule()s => slower builds. */ -#import \\"SampleSpec.h\\" +#import \\"REAL_MODULE_EXAMPLE.h\\" @implementation RCTCxxConvert (NativeCameraRollManager_GetPhotosParams) + (RCTManagedPointer *)JS_NativeCameraRollManager_GetPhotosParams:(id)json @@ -319,7 +319,7 @@ namespace facebook { exports[`GenerateModuleMm can generate fixture SIMPLE_NATIVE_MODULES 1`] = ` Map { - "SampleSpec-generated.mm" => "/** + "SIMPLE_NATIVE_MODULES-generated.mm" => "/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the @@ -332,7 +332,7 @@ Map { * must have a single output. More files => more genrule()s => slower builds. */ -#import \\"SampleSpec.h\\" +#import \\"SIMPLE_NATIVE_MODULES.h\\" namespace facebook { @@ -426,7 +426,7 @@ namespace facebook { exports[`GenerateModuleMm can generate fixture TWO_MODULES_DIFFERENT_FILES 1`] = ` Map { - "SampleSpec-generated.mm" => "/** + "TWO_MODULES_DIFFERENT_FILES-generated.mm" => "/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the @@ -439,7 +439,7 @@ Map { * must have a single output. More files => more genrule()s => slower builds. */ -#import \\"SampleSpec.h\\" +#import \\"TWO_MODULES_DIFFERENT_FILES.h\\" namespace facebook { diff --git a/scripts/generate-specs-cli.js b/scripts/generate-specs-cli.js index 72310cb54b7414..53b263faccdf95 100644 --- a/scripts/generate-specs-cli.js +++ b/scripts/generate-specs-cli.js @@ -35,7 +35,6 @@ function generateSpec( libraryName, packageName, ) { - const moduleSpecName = libraryName; const schemaText = fs.readFileSync(schemaPath, 'utf-8'); if (schemaText == null) { @@ -43,13 +42,7 @@ function generateSpec( } if (!outputDirectory) { - outputDirectory = path.resolve( - __dirname, - '..', - 'Libraries', - libraryName, - moduleSpecName, - ); + outputDirectory = path.resolve(__dirname, '..', 'Libraries', libraryName); } mkdirp.sync(outputDirectory); @@ -65,7 +58,6 @@ function generateSpec( libraryName, schema, outputDirectory, - moduleSpecName, packageName, }, {