♻️(tokens) transform cunningham.dist.js to cunningham.ts
As of now configuration file can use the .ts extension so it seemed more homogeneous as the bin own source code is using Typescript.
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint . 'src/**/*.{ts,tsx}'",
|
"lint": "eslint . 'src/**/*.{ts,tsx}'",
|
||||||
"dev": "nodemon --watch 'src/bin' --ext '*' --exec 'yarn build'",
|
"dev": "nodemon --watch 'src/bin' --ext '*' --exec 'yarn build'",
|
||||||
"build-bin": "cd src/bin && tsc -p tsconfig.json && tsc-alias && cp ./cunningham.dist.js ../../dist/bin && chmod +x ../../dist/bin/Main.js",
|
"build-bin": "cd src/bin && tsc -p tsconfig.json && tsc-alias && chmod +x ../../dist/bin/Main.js",
|
||||||
"build-lib": "cp dist/cunningham-tokens.ts src/lib && cd src/lib && tsc -p tsconfig.json",
|
"build-lib": "cp dist/cunningham-tokens.ts src/lib && cd src/lib && tsc -p tsconfig.json",
|
||||||
"build": "yarn build-bin && yarn build-default-theme && yarn build-lib && cd ../.. && ln -sf ../../packages/tokens/dist/bin/Main.js node_modules/.bin/cunningham",
|
"build": "yarn build-bin && yarn build-default-theme && yarn build-lib && cd ../.. && ln -sf ../../packages/tokens/dist/bin/Main.js node_modules/.bin/cunningham",
|
||||||
"build-default-theme": "./dist/bin/Main.js -o dist -s html -g css,js,ts",
|
"build-default-theme": "./dist/bin/Main.js -o dist -s html -g css,js,ts",
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const registerTypescriptLoader = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getDistConfig = async () => {
|
const getDistConfig = async () => {
|
||||||
const config = await import("./cunningham.dist.js");
|
const config = await import("./cunningham");
|
||||||
return config.default;
|
return config.default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module.exports = {
|
export default {
|
||||||
theme: {
|
theme: {
|
||||||
colors: {
|
colors: {
|
||||||
primary: "#002d7f",
|
primary: "#002d7f",
|
||||||
@@ -11,15 +11,6 @@ jest.mock("../Paths", () => ({
|
|||||||
workPath: () => __dirname,
|
workPath: () => __dirname,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.mock("../cunningham.dist.js", () => ({
|
|
||||||
theme: {
|
|
||||||
colors: {
|
|
||||||
primary: "#055FD2",
|
|
||||||
secondary: "#DA0000",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
const runBin = async (args: string) => {
|
const runBin = async (args: string) => {
|
||||||
const exec = util.promisify(child_process.exec);
|
const exec = util.promisify(child_process.exec);
|
||||||
const promise = exec(
|
const promise = exec(
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
jest.mock("../cunningham.dist.js");
|
jest.mock("../cunningham");
|
||||||
|
|||||||
Reference in New Issue
Block a user