0.5.10 • Published 9 months ago

pzl-spfx-tasks v0.5.10

Weekly downloads
-
License
-
Repository
github
Last release
9 months ago

SPFx tasks

One shared place for node tasks used by our SPFx solutions.

createEnviromentFile.js

Creates a .env file in the current folder (process.cwd()). This is ran as a part of the pre-watch.js task.

createServeConfig.js

Creates a config/serve.json file from the template config/serve.sample.json for the current folder.

post-watch.js

Runs modifyConfig.js.

pre-watch.js

Runs createEnviromentFile.js. Also generates a config/.generated-solution-config.json if the channel environment variable SERVE_CHANNEL is set and not main. Also runs ./modifyConfig.js to modifiy the included bundles.

modifyConfig.js

Updates config/config.json for the solution based on the environment variable SERVE_BUNDLE_REGEX.

generateComponentOverview.js

This script generates an overview of components by loading configuration files and writing the result to an output file.

Dependencies

  • path: Provides utilities for working with file and directory paths.
  • glob: Matches file paths using patterns.
  • fs: Provides file system-related functionality.
  • util: Custom utility functions for logging and file operations.
  • colors: Provides color formatting for console output.

Constants

  • ROOT_PATH: The root directory of the project.
  • CONFIG_FILES_PATTERN: Pattern to match configuration files.
  • OUTPUT_FILE: Path to the output file where the overview will be written.

Functions

loadJsonFile(file)

  • Description: Loads and parses a JSON file.
  • Parameters:
    • file: Path to the JSON file.
  • Returns: Parsed JSON object or null on failure.

loadManifestFile(configFile, bundle)

  • Description: Loads the manifest file for a given configuration file and bundle.
  • Parameters:
    • configFile: Path to the configuration file.
    • bundle: Bundle object containing information about the components.
  • Returns: Manifest object containing component details or null on failure.

loadConfigFile(configFile)

  • Description: Loads the configuration file and returns the application name and an array of manifests.
  • Parameters:
    • configFile: Path to the configuration file.
  • Returns: An array containing the application name and an array of manifest objects.

generateComponentOverview()

  • Description: Generates an overview of components by loading configuration files and writing the result to an output file.
  • Process:
    1. Glob matches configuration files.
    2. Loads configuration files and extracts component manifests.
    3. Writes the overview to the output file.

generateComponentsClass.js

This script generates C# classes based on JSON data. It is designed to work with a specific JSON file structure containing information about SPFx components.

Dependencies

  • path: Provides utilities for working with file and directory paths.
  • glob: Matches file paths using patterns.
  • fs: Provides file system-related functionality.
  • util: Custom utility functions for logging and file operations.
  • lodash: Provides utility functions for working with arrays, objects, and other data types.
  • package.json: Contains metadata about the project.

Constants

  • ROOT_PATH: The root directory of the project.
  • INPUT_JSON_FILE: Path to the input JSON file containing component data.
  • NAMESPACE: Namespace for the generated C# classes.
  • DIRNAME: Path to the directory where the generated C# files will be saved.
  • FILE_NAME: Name of the generated C# file.
  • MAIN_CLASS_NAME: Name of the main static class containing all components.
  • COMPONENT_CLASS_NAME: Name of the C# class representing SPFx components.

Functions

generateClasses(jsonFile)

  • Description: Generates C# classes for a JSON file.
  • Parameters:
    • jsonFile: Path to the JSON file containing component data.

generateComponentClass(component, classType = 'public readonly')

  • Description: Generates a C# class for a component.
  • Parameters:
    • component: Component object containing information about the component.
    • classType: Type of the class to generate (default is 'public readonly').

generateAppClassName(app)

  • Description: Generates the class name for the given SPFx app.
  • Parameters:
    • app: Name of the SPFx app.
  • Returns: The generated class name.

generateAppClass(app, components, classType = 'public class', classMemberType = 'public static readonly')

  • Description: Generates a C# class for the SPFx app with the provided app name and components.
  • Parameters:
    • app: Name of the SPFx app.
    • components: Array of component objects belonging to the app.
    • classType: Type of the class to generate (default is 'public class').
    • classMemberType: Type of the class members to generate (default is 'public static readonly').

generateCSharpCode(jsonContent)

  • Description: Generates C# code based on the provided JSON content.
  • Parameters:
    • jsonContent: JSON content used to generate the C# code.
  • Returns: Generated C# code as a string.
0.5.10

9 months ago

0.5.10-2

1 year ago

0.5.10-0

1 year ago

0.5.10-1

1 year ago

0.5.8-3

1 year ago

0.5.8-2

1 year ago

0.5.8-8

1 year ago

0.5.8-5

1 year ago

0.5.8-4

1 year ago

0.5.8-7

1 year ago

0.5.8-6

1 year ago

0.5.9

1 year ago

0.5.8-1

1 year ago

0.5.8-0

1 year ago

0.5.7-18

1 year ago

0.5.7-19

1 year ago

0.5.7-16

1 year ago

0.5.7-17

1 year ago

0.5.7-14

1 year ago

0.5.7-15

1 year ago

0.5.7-13

1 year ago

0.5.7

1 year ago

0.5.2-28

1 year ago

0.5.2-29

1 year ago

0.5.2-20

1 year ago

0.5.2-21

1 year ago

0.5.2-22

1 year ago

0.5.2-23

1 year ago

0.5.2-24

1 year ago

0.5.2-25

1 year ago

0.5.2-26

1 year ago

0.5.2-27

1 year ago

0.5.2-31

1 year ago

0.5.2-30

1 year ago

0.5.1-38

1 year ago

0.5.1-39

1 year ago

0.5.1-30

1 year ago

0.5.1-31

1 year ago

0.5.1-32

1 year ago

0.5.1-33

1 year ago

0.5.1-34

1 year ago

0.5.1-35

1 year ago

0.5.1-36

1 year ago

0.5.1-37

1 year ago

0.5.7-12

1 year ago

0.5.7-10

1 year ago

0.5.7-11

1 year ago

0.5.2-17

1 year ago

0.5.2-18

1 year ago

0.5.2-19

1 year ago

0.5.2-10

1 year ago

0.5.2-11

1 year ago

0.5.2-12

1 year ago

0.5.2-13

1 year ago

0.5.2-14

1 year ago

0.5.2-15

1 year ago

0.5.2-16

1 year ago

0.5.1-40

1 year ago

0.5.4

1 year ago

0.5.3

1 year ago

0.5.6

1 year ago

0.5.5

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

0.5.7-2

1 year ago

0.5.7-1

1 year ago

0.5.7-4

1 year ago

0.5.7-3

1 year ago

0.5.7-0

1 year ago

0.5.7-9

1 year ago

0.5.7-6

1 year ago

0.5.7-5

1 year ago

0.5.7-8

1 year ago

0.5.7-7

1 year ago

0.5.2-1

1 year ago

0.5.2-0

1 year ago

0.5.1-27

1 year ago

0.5.1-28

1 year ago

0.5.1-29

1 year ago

0.5.1-22

1 year ago

0.5.1-23

1 year ago

0.5.1-24

1 year ago

0.5.1-25

1 year ago

0.5.1-26

1 year ago

0.5.2-7

1 year ago

0.5.2-6

1 year ago

0.5.2-9

1 year ago

0.5.2-8

1 year ago

0.5.2-3

1 year ago

0.5.2-2

1 year ago

0.5.2-5

1 year ago

0.5.2-4

1 year ago

0.4.6-2

1 year ago

0.4.6-1

1 year ago

0.4.6-0

1 year ago

0.4.6-11

1 year ago

0.4.6-6

1 year ago

0.4.6-10

1 year ago

0.4.6-5

1 year ago

0.4.6-4

1 year ago

0.4.6-3

1 year ago

0.4.6-9

1 year ago

0.4.6-8

1 year ago

0.4.6-7

1 year ago

0.4.6-15

1 year ago

0.4.6-14

1 year ago

0.4.6-13

1 year ago

0.4.6-12

1 year ago

0.4.6-18

1 year ago

0.4.6-17

1 year ago

0.4.6-16

1 year ago

0.4.1-19

1 year ago

0.4.1-16

1 year ago

0.4.1-15

1 year ago

0.4.1-18

1 year ago

0.4.1-17

1 year ago

0.4.1-12

1 year ago

0.4.1-11

1 year ago

0.4.1-14

1 year ago

0.4.1-13

1 year ago

0.3.2

1 year ago

0.4.1-10

1 year ago

0.5.1-0

1 year ago

0.5.1-2

1 year ago

0.5.1-1

1 year ago

0.4.4-18

1 year ago

0.4.1-27

1 year ago

0.4.4-19

1 year ago

0.4.1-26

1 year ago

0.4.1-29

1 year ago

0.4.1-28

1 year ago

0.4.4-14

1 year ago

0.4.1-23

1 year ago

0.4.4-15

1 year ago

0.4.1-22

1 year ago

0.4.4-16

1 year ago

0.4.1-25

1 year ago

0.4.4-17

1 year ago

0.4.1-24

1 year ago

0.4.4-10

1 year ago

0.4.4-11

1 year ago

0.4.4-12

1 year ago

0.4.1-21

1 year ago

0.4.4-13

1 year ago

0.4.1-20

1 year ago

0.4.4-20

1 year ago

0.5.1-8

1 year ago

0.5.1-7

1 year ago

0.5.1-9

1 year ago

0.5.1-4

1 year ago

0.4.4-29

1 year ago

0.4.1-38

1 year ago

0.5.1-3

1 year ago

0.4.1-37

1 year ago

0.5.1-6

1 year ago

0.5.1-5

1 year ago

0.4.1-39

1 year ago

0.4.5

1 year ago

0.4.4-25

1 year ago

0.4.1-34

1 year ago

0.4.4

1 year ago

0.4.4-26

1 year ago

0.4.1-33

1 year ago

0.4.4-27

1 year ago

0.4.1-36

1 year ago

0.4.4-28

1 year ago

0.4.1-35

1 year ago

0.4.4-21

1 year ago

0.4.1

1 year ago

0.4.1-30

1 year ago

0.4.4-22

1 year ago

0.4.0

1 year ago

0.4.4-23

1 year ago

0.4.3

1 year ago

0.4.1-32

1 year ago

0.4.4-24

1 year ago

0.4.2

1 year ago

0.4.1-31

1 year ago

0.5.1-16

1 year ago

0.4.4-4

1 year ago

0.5.1-17

1 year ago

0.4.4-3

1 year ago

0.5.1-18

1 year ago

0.4.4-2

1 year ago

0.5.1-19

1 year ago

0.4.4-1

1 year ago

0.4.4-8

1 year ago

0.4.4-7

1 year ago

0.4.4-6

1 year ago

0.4.4-5

1 year ago

0.5.1-10

1 year ago

0.5.1-11

1 year ago

0.4.4-9

1 year ago

0.5.1-12

1 year ago

0.5.1-13

1 year ago

0.5.1-14

1 year ago

0.5.1-15

1 year ago

0.3.2-5

1 year ago

0.3.2-6

1 year ago

0.4.1-41

1 year ago

0.4.1-40

1 year ago

0.4.5-10

1 year ago

0.5.1-20

1 year ago

0.5.1-21

1 year ago

0.4.5-14

1 year ago

0.4.5-13

1 year ago

0.4.5-12

1 year ago

0.4.5-11

1 year ago

0.5.0

1 year ago

0.4.4-0

1 year ago

0.4.5-3

1 year ago

0.4.1-7

1 year ago

0.4.5-2

1 year ago

0.4.1-6

1 year ago

0.4.5-1

1 year ago

0.4.1-5

1 year ago

0.4.5-0

1 year ago

0.4.1-4

1 year ago

0.4.5-7

1 year ago

0.4.5-6

1 year ago

0.4.5-5

1 year ago

0.4.1-9

1 year ago

0.4.5-4

1 year ago

0.4.1-8

1 year ago

0.4.5-9

1 year ago

0.4.5-8

1 year ago

0.3.3-4

1 year ago

0.3.3-3

1 year ago

0.3.3-0

1 year ago

0.3.3-2

1 year ago

0.3.3-1

1 year ago

0.4.1-3

1 year ago

0.4.1-2

1 year ago

0.4.1-1

1 year ago

0.4.1-0

1 year ago

0.3.2-4

1 year ago

0.3.2-3

1 year ago

0.3.2-2

1 year ago

0.3.2-1

1 year ago

0.3.2-0

1 year ago

0.3.1

1 year ago

0.2.1-6

1 year ago

0.2.1-5

1 year ago

0.2.1-4

1 year ago

0.2.1-3

1 year ago

0.2.1-2

1 year ago

0.2.1-1

1 year ago

0.2.1-0

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.9-5

1 year ago

0.1.9-4

1 year ago

0.1.9-3

1 year ago

0.1.9-2

1 year ago

0.1.9-1

1 year ago

0.1.9-0

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago