From 3a5c6ed00fb96488897fa95fbf267f71def24fc4 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 26 Aug 2018 23:05:04 +0100 Subject: Fix sra-spec `main` and `types` in package.json --- packages/sra-spec/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/sra-spec') diff --git a/packages/sra-spec/package.json b/packages/sra-spec/package.json index 706f9f0aa..ccb7ccb71 100644 --- a/packages/sra-spec/package.json +++ b/packages/sra-spec/package.json @@ -5,8 +5,8 @@ "node": ">=6.12" }, "description": "Standard Relayer API Open API Spec", - "main": "lib/src/index.js", - "types": "lib/src/index.d.ts", + "main": "lib/index.js", + "types": "lib/index.d.ts", "scripts": { "serve": "redoc-cli serve lib/api.json --watch", "watch_without_deps": "run-p build-json:watch serve", -- cgit v1.2.3 From 6a6b424c86b507d4dbfe5821ef81e7f76b818ef9 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 26 Aug 2018 23:35:47 +0100 Subject: Move md files to lib folder during build --- packages/sra-spec/package.json | 4 +++- packages/sra-spec/src/md/index.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'packages/sra-spec') diff --git a/packages/sra-spec/package.json b/packages/sra-spec/package.json index ccb7ccb71..9a192d46f 100644 --- a/packages/sra-spec/package.json +++ b/packages/sra-spec/package.json @@ -17,9 +17,10 @@ "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "test:circleci": "yarn test:coverage", "clean": "shx rm -rf lib", - "build": "tsc && yarn build-json", + "build": "tsc && copy_md_files && yarn build-json", "build-json": "ts-node build_scripts/buildJson.ts", "build-json:watch": "chokidar 'src/**/*' -c 'yarn build-json' ", + "copy_md_files": "copyfiles -u 2 './src/md/**/*.md' ./lib/md", "deploy-site": "discharge deploy" }, "repository": { @@ -42,6 +43,7 @@ "@types/node": "^10.5.3", "chai": "^4.0.1", "chokidar-cli": "^1.2.0", + "copyfiles": "^2.0.0", "dirty-chai": "^2.0.1", "discharge": "^0.7.1", "mocha": "^4.0.1", diff --git a/packages/sra-spec/src/md/index.ts b/packages/sra-spec/src/md/index.ts index 076c3c45c..0d1147aa0 100644 --- a/packages/sra-spec/src/md/index.ts +++ b/packages/sra-spec/src/md/index.ts @@ -1,5 +1,5 @@ import { readFileSync } from 'fs'; export const md = { - introduction: readFileSync('src/md/introduction.md').toString(), + introduction: readFileSync('lib/md/introduction.md').toString(), }; -- cgit v1.2.3 From 41559c39b9b4fac9c512309f3271796bb9fb0fb0 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 26 Aug 2018 23:43:19 +0100 Subject: Fix command --- packages/sra-spec/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/sra-spec') diff --git a/packages/sra-spec/package.json b/packages/sra-spec/package.json index 9a192d46f..f0820e136 100644 --- a/packages/sra-spec/package.json +++ b/packages/sra-spec/package.json @@ -17,7 +17,7 @@ "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "test:circleci": "yarn test:coverage", "clean": "shx rm -rf lib", - "build": "tsc && copy_md_files && yarn build-json", + "build": "tsc && yarn copy_md_files && yarn build-json", "build-json": "ts-node build_scripts/buildJson.ts", "build-json:watch": "chokidar 'src/**/*' -c 'yarn build-json' ", "copy_md_files": "copyfiles -u 2 './src/md/**/*.md' ./lib/md", -- cgit v1.2.3 From 9fc8a6e214279cb156fa467fbada2b7d5368d616 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 27 Aug 2018 10:09:51 +0100 Subject: Try relative path --- packages/sra-spec/src/md/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/sra-spec') diff --git a/packages/sra-spec/src/md/index.ts b/packages/sra-spec/src/md/index.ts index 0d1147aa0..076c3c45c 100644 --- a/packages/sra-spec/src/md/index.ts +++ b/packages/sra-spec/src/md/index.ts @@ -1,5 +1,5 @@ import { readFileSync } from 'fs'; export const md = { - introduction: readFileSync('lib/md/introduction.md').toString(), + introduction: readFileSync('src/md/introduction.md').toString(), }; -- cgit v1.2.3 From 90c9e3496a6db59c39265d1974f766fed30c7877 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 27 Aug 2018 10:10:07 +0100 Subject: Actual relative path --- packages/sra-spec/src/md/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/sra-spec') diff --git a/packages/sra-spec/src/md/index.ts b/packages/sra-spec/src/md/index.ts index 076c3c45c..d82e7061f 100644 --- a/packages/sra-spec/src/md/index.ts +++ b/packages/sra-spec/src/md/index.ts @@ -1,5 +1,5 @@ import { readFileSync } from 'fs'; export const md = { - introduction: readFileSync('src/md/introduction.md').toString(), + introduction: readFileSync('introduction.md').toString(), }; -- cgit v1.2.3 From 4ac43a9fd2d3cc75b4f9aed92d85f722f28d34cb Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 27 Aug 2018 10:38:06 +0100 Subject: Try relative to root dir --- packages/sra-spec/src/md/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'packages/sra-spec') diff --git a/packages/sra-spec/src/md/index.ts b/packages/sra-spec/src/md/index.ts index d82e7061f..b32cba6f4 100644 --- a/packages/sra-spec/src/md/index.ts +++ b/packages/sra-spec/src/md/index.ts @@ -1,5 +1,7 @@ import { readFileSync } from 'fs'; +console.log('DIR', __dirname); + export const md = { - introduction: readFileSync('introduction.md').toString(), + introduction: readFileSync('lib/md/introduction.md').toString(), }; -- cgit v1.2.3 From e4fc8a84145d14084c389f5c4e8307e84ebf0c41 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 27 Aug 2018 12:05:55 +0100 Subject: Use absolute path --- packages/sra-spec/src/md/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'packages/sra-spec') diff --git a/packages/sra-spec/src/md/index.ts b/packages/sra-spec/src/md/index.ts index b32cba6f4..4e778e073 100644 --- a/packages/sra-spec/src/md/index.ts +++ b/packages/sra-spec/src/md/index.ts @@ -1,7 +1,5 @@ import { readFileSync } from 'fs'; -console.log('DIR', __dirname); - export const md = { - introduction: readFileSync('lib/md/introduction.md').toString(), + introduction: readFileSync(`${__dirname}/introduction.md`).toString(), }; -- cgit v1.2.3