diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 07e3a10..842e3fa 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -40,15 +40,6 @@ jobs: with: node-version: ${{ matrix.node-version }} - - name: Copy - uses: andstor/copycat-action@v3 - with: - personal_token: ${{ secrets.PERSONAL_TOKEN }} - src_path: /__appset - dst_path: / - dst_owner: andstor - dst_repo_name: copycat-action - - run: npm ci - run: npm run build - run: npm run semantic-release diff --git a/__appset/theme.js b/__appset/theme.js deleted file mode 100644 index a6a2a08..0000000 --- a/__appset/theme.js +++ /dev/null @@ -1,21 +0,0 @@ -import PXL from './universal/configPXL'; -import Color from './universal/configColor'; -import FontSize from './universal/configFontSize'; -import FontFamily from './universal/configFontFamily'; -import FontWeight from './universal/configFontWeight'; - -import Button from './configButton'; -import Input from './configInput'; - -export default { - Universal: { - PXL, - Color, - FontSize, - FontFamily, - FontWeight, - }, - Button, - Input, - -}; diff --git a/__appset/themePrepare.js b/__appset/themePrepare.js index c7d7fb9..eee5800 100644 --- a/__appset/themePrepare.js +++ b/__appset/themePrepare.js @@ -1,3 +1,4 @@ +/* eslint-disable max-len */ /* eslint-disable no-console */ const fs = require('fs'); const path = require('path'); @@ -8,7 +9,6 @@ const ignoreFiles = [ 'scripts', 'utils', 'themePrepare.js', - 'theme.js', 'universal', ]; @@ -31,11 +31,20 @@ const srcPath = path.resolve(__dirname, '../__appset'); const components = fs.readdirSync(srcPath).filter((files) => !ignoreFiles.includes(files) && !files.includes('WIP-')); let count = 0; +// Prod: const createDir = path.resolve(`${__dirname}`, '../../../fe-theme'); +// Local +// const createDir = path.resolve(`${__dirname}`, '../../jio-fiber-chat-bot/fe-theme'); + mkdirp(createDir).then(() => { components.map((component) => { + // Prod: const defaultDir = path.resolve(`${__dirname}`, '../../../node_modules/fe-theme/__appset'); + + // Local: + // const defaultDir = path.resolve(`${__dirname}`, '../__appset'); + const appDir = path.resolve(`${__dirname}`, '../../../fe-theme'); const defaultDirData = fs.readFileSync(`${defaultDir}/${component}`).toString().split('export')[0].split('=')[1]; @@ -68,4 +77,36 @@ const ${replaceComponentName} =${defaultDirData}export default ${replaceComponen return null; }); +}).catch((err) => { + console.log('err', err); +}); + +const srcPathInner = path.resolve(__dirname, '../__appset/universal'); +const componentsInner = fs.readdirSync(srcPathInner).filter((files) => !ignoreFiles.includes(files) && !files.includes('WIP-')); + +// Prod: +const createInnerDir = path.resolve(`${__dirname}`, '../../../fe-theme/universal'); + +// Local +// const createInnerDir = path.resolve(`${__dirname}`, '../../jio-fiber-chat-bot/fe-theme/universal'); + +mkdirp(createInnerDir).then(() => { + componentsInner.map((component) => { + // Prod: const defaultDir = path.resolve(`${__dirname}`, '../../../node_modules/fe-theme/__appset'); + + const appDir = path.resolve(`${__dirname}`, '../../fe-theme/__appset/universal'); + + fs.readFile(`${appDir}/${component}`, 'utf8', (err, data) => { + console.log(err, data); + const componentFile = path.resolve(createInnerDir, component); + const componentContent = data; + fs.writeFile(componentFile, componentContent, () => { + + }); + }); + + return null; + }); +}).catch((err) => { + console.log('err', err); }); diff --git a/__appset/universal/theme.js b/__appset/universal/theme.js new file mode 100644 index 0000000..d806fee --- /dev/null +++ b/__appset/universal/theme.js @@ -0,0 +1,21 @@ +import PXL from './configPXL'; +import Color from './configColor'; +import FontSize from './configFontSize'; +import FontFamily from './configFontFamily'; +import FontWeight from './configFontWeight'; + +import Button from '../configButton'; +import Input from '../configInput'; + +export default { + Universal: { + PXL, + Color, + FontSize, + FontFamily, + FontWeight, + }, + Button, + Input, + +};