diff --git a/.eslintignore b/.eslintignore index d54e2b0..6c1c12f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,6 @@ +cookbook/public/** cookbook/src/gatsby-theme-carbon/** dist/** node_modules/** +reports/** +storybook-static/** diff --git a/gulpfile.js b/gulpfile.js index 4e53505..dc20089 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,12 +1,10 @@ - - /* eslint-disable no-console */ -const path = require('path'); -const gulp = require('gulp'); -const shell = require('shelljs'); +const path = require("path"); +const gulp = require("gulp"); +const shell = require("shelljs"); // Load env vars from the .env file. -require('dotenv').config(); +require("dotenv").config(); /* * This task generates a development bundle to the specified output folder. @@ -24,29 +22,36 @@ require('dotenv').config(); * before it is transpiled by Babel. */ -gulp.task('deploy:spm', async () => { +gulp.task("deploy:spm", async () => { if (process.env.CLIENT_DIR) { const customComponentName = process.env.CUSTOM_COMPONENT_NAME || "custom"; - const customComponentLocation = process.env.CLIENT_DIR + "/components/" + customComponentName + "/WebContent/CDEJ/jscript/SPMUIComponents"; - shell.echo(`\n[INFO] Copying the generated files to custom component: ${customComponentLocation}`); + const customComponentLocation = `${process.env.CLIENT_DIR}/components/${customComponentName}/WebContent/CDEJ/jscript/SPMUIComponents`; + shell.echo( + `\n[INFO] Copying the generated files to custom component: ${customComponentLocation}`, + ); shell.exec( `webpack --mode=development --devtool=eval-source-map\ --output-path=${customComponentLocation}`, - { fatal: true } + { fatal: true }, ); } else { - throw new Error("Env var CLIENT_DIR is not defined in the .env file. It should be set to the weblicent directory.") + throw new Error( + "Env var CLIENT_DIR is not defined in the .env file. It should be set to the weblicent directory.", + ); } }); -gulp.task('dev:spm', () => { +gulp.task("dev:spm", () => { if (!process.env.CLIENT_DIR) { - throw new Error("Env var CLIENT_DIR is not defined in the .env file. It should be set to the weblicent directory.") + throw new Error( + "Env var CLIENT_DIR is not defined in the .env file. It should be set to the weblicent directory.", + ); } - const cdejLocation = process.env.RELATIVE_PATH_TO_BUNDLE || "CDEJ/jscript/SPMUIComponents"; + const cdejLocation = + process.env.RELATIVE_PATH_TO_BUNDLE || "CDEJ/jscript/SPMUIComponents"; const output = - process.env.CLIENT_DIR + "/WebContent/" + cdejLocation || - path.resolve(__dirname, '/dist'); + `${process.env.CLIENT_DIR}/WebContent/${cdejLocation}` || + path.resolve(__dirname, "/dist"); shell.echo(`\n[INFO] Generating the dev bundle to path: ${output} [INFO] Any changes to the files will automatically trigger a new bundle generation.`); @@ -55,22 +60,19 @@ gulp.task('dev:spm', () => { `webpack --mode=development --devtool=eval-source-map\ --output-path=${output} --watch\ `, - { fatal: true } + { fatal: true }, ); - shell.echo(`\n\n[INFO] Bundle Generated into ${output} \n[INFO] Watching for file changes`); - + shell.echo( + `\n\n[INFO] Bundle Generated into ${output} \n[INFO] Watching for file changes`, + ); }); -gulp.task('prod:spm', (done) => { - const output = path.resolve(__dirname, '/dist'); - +gulp.task("prod:spm", (done) => { + const output = path.resolve(__dirname, "/dist"); + shell.echo(`\n[INFO] Generating the dev bundle to path: ${output}.`); - shell.exec( - `webpack --mode production`, - { fatal: true} - ); + shell.exec(`webpack --mode production`, { fatal: true }); done(); }); - diff --git a/packages/carbon-addons-devenv/sample_renderers/index.js b/packages/carbon-addons-devenv/sample_renderers/index.js index 1883de8..933574a 100644 --- a/packages/carbon-addons-devenv/sample_renderers/index.js +++ b/packages/carbon-addons-devenv/sample_renderers/index.js @@ -2,7 +2,7 @@ * Copyright Merative US L.P. 2020 */ -import PersonFolio from './PersonFolio'; -import Logo from './Logo'; +import PersonFolio from "./personFolio"; +import Logo from "./logo"; export default { PersonFolio, Logo }; diff --git a/packages/graphql-mocks/resolvers/data/sampleLogoData.js b/packages/graphql-mocks/resolvers/data/sampleLogoData.js index 6ad4d1c..d07efb9 100644 --- a/packages/graphql-mocks/resolvers/data/sampleLogoData.js +++ b/packages/graphql-mocks/resolvers/data/sampleLogoData.js @@ -1,9 +1,8 @@ - const logoData = (parent, args) => { - if (args.logoId == 'id_1') { - return {name: 'avatar__adult--125-enabled.svg', logoId: 'id_1'}; + if (args.logoId === "id_1") { + return { name: "avatar__adult--125-enabled.svg", logoId: "id_1" }; } - return {name: 'avatar__child--125-enabled.svg', logoId: 'id_2'}; -} - -module.exports = { logoData }; \ No newline at end of file + return { name: "avatar__child--125-enabled.svg", logoId: "id_2" }; +}; + +module.exports = { logoData }; diff --git a/packages/graphql-mocks/server.js b/packages/graphql-mocks/server.js index 635488d..984b7b5 100644 --- a/packages/graphql-mocks/server.js +++ b/packages/graphql-mocks/server.js @@ -1,28 +1,28 @@ -const express = require('express'); -const cors = require('cors'); -const { graphqlHTTP } = require('express-graphql'); -const { makeExecutableSchema } = require('@graphql-tools/schema'); -const open = require('open'); -const { TypeDefs } = require('./typeDefs'); -const { Resolvers } = require('./resolvers'); +const express = require("express"); +const cors = require("cors"); +const { graphqlHTTP } = require("express-graphql"); +const { makeExecutableSchema } = require("@graphql-tools/schema"); +const open = require("open"); +const { TypeDefs } = require("./typeDefs"); +const { Resolvers } = require("./resolvers"); - -const schema = makeExecutableSchema({ +const schema = makeExecutableSchema({ typeDefs: TypeDefs, resolvers: Resolvers, }); const app = express(); -app.use(cors({ - origin: '*' -})); -app.use('/graphql', graphqlHTTP({ - schema, - graphiql: true, -})); +app.use( + cors({ + origin: "*", + }), +); +app.use( + "/graphql", + graphqlHTTP({ + schema, + graphiql: true, + }), +); app.listen(4000); -open('http://localhost:4000/graphql'); -console.log('...........................................................'); -console.log('Running GraphQL mocks api at http://localhost:4000/graphql'); -console.log('...........................................................'); -console.log(''); \ No newline at end of file +open("http://localhost:4000/graphql");