Skip to content

Commit

Permalink
chore: Rename constants.js to enums.js and update related imports (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwaspin committed May 1, 2024
1 parent eea5f3d commit ec64a1c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions scripts/buildEsm.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ const config = require('./config.cjs');

const {
schemasSrc,
constantsSrc,
enumsSrc,
indexSrc,
validatorSrc,
esmConstantsDst,
esmEnumsDst,
esmIndexDst,
esmValidatorDst,
esmSchemasDst
} = config;

const copyConstants = async () => {
const copyEnums = async () => {
return fs
.copy(constantsSrc, esmConstantsDst)
.then(() => console.log('Copy constants.js completed!'))
.copy(enumsSrc, esmEnumsDst)
.then(() => console.log('Copy enums.js completed!'))
.catch(err =>
console.error('An error occurred while copying constants.js', err)
console.error('An error occurred while copying enums.js', err)
);
};

Expand Down Expand Up @@ -50,7 +50,7 @@ const copySchemas = async () => {
};

const buildEsm = async () => {
await copyConstants();
await copyEnums();
await copyIndex();
await copyValidator();
await copySchemas();
Expand Down
8 changes: 4 additions & 4 deletions scripts/config.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path');

const srcPath = path.join(__dirname, '..', 'src');
const constantsSrc = path.join(srcPath, 'constants.js');
const enumsSrc = path.join(srcPath, 'enums.js');
const examplesSrc = path.join(srcPath, 'examples');
const indexSrc = path.join(srcPath, 'index.js');
const schemasSrc = path.join(srcPath, 'schemas');
Expand All @@ -14,7 +14,7 @@ const cjsExamplesDst = path.join(cjsPath, 'examples');
const cjsSchemasDst = path.join(cjsPath, 'schemas');

const esmPath = path.join(distPath, 'esm');
const esmConstantsDst = path.join(esmPath, 'constants.js');
const esmEnumsDst = path.join(esmPath, 'enums.js');
const esmIndexDst = path.join(esmPath, 'index.js');
const esmSchemasDst = path.join(esmPath, 'schemas');
const esmValidatorDst = path.join(esmPath, 'lucaValidator.js');
Expand All @@ -25,12 +25,12 @@ module.exports = {
esmPath,
cjsExamplesDst,
cjsSchemasDst,
esmConstantsDst,
esmEnumsDst,
esmIndexDst,
esmValidatorDst,
esmSchemasDst,
srcPath,
constantsSrc,
enumsSrc,
examplesSrc,
indexSrc,
schemasSrc,
Expand Down

0 comments on commit ec64a1c

Please sign in to comment.