Skip to content

Commit

Permalink
Merge pull request #223 from spiltcoffee/esm-tsconfig
Browse files Browse the repository at this point in the history
fix: fixed issues with ESM conversion not working
  • Loading branch information
spiltcoffee authored Apr 25, 2021
2 parents 1049405 + 5305b9a commit f85cae4
Show file tree
Hide file tree
Showing 92 changed files with 2,944 additions and 1,497 deletions.
208 changes: 160 additions & 48 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ executors:
node-executor:
docker:
- image: circleci/node:latest
working_directory: ~/repo
working_directory: ~/workspace

jobs:
install:
Expand All @@ -17,32 +17,83 @@ jobs:
- run: npm --version
- run: yarn --version

- checkout
- checkout:
path: postdfm

- restore_cache:
keys:
- node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "yarn.lock" }}
- node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "postdfm/yarn.lock" }}

- run: yarn --frozen-lockfile
- run:
command: yarn --frozen-lockfile && yarn changed
working_directory: postdfm

- save_cache:
paths:
- node_modules
- packages/postdfm/node_modules
- packages/@postdfm/dfm2ast/node_modules
key: node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "yarn.lock" }}
- postdfm/node_modules
# for nearleyc
- postdfm/packages/@postdfm/dfm2ast/node_modules
key: node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "postdfm/yarn.lock" }}

install-with-sourcemaps:
executor: node-executor
steps:
- checkout:
path: postdfm
- restore_cache:
keys:
- node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "postdfm/yarn.lock" }}

- run: mv postdfm postdfm-with-sourcemaps

- save_cache:
paths:
- postdfm-with-sourcemaps/node_modules
# for nearleyc
- postdfm-with-sourcemaps/packages/@postdfm/dfm2ast/node_modules
key: node-{{ .Environment.CACHE_VERSION }}-dependencies-with-sourcemaps-{{ checksum "postdfm-with-sourcemaps/yarn.lock" }}

compile:
executor: node-executor
steps:
- checkout
- checkout:
path: postdfm

- restore_cache:
keys:
- node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "postdfm/yarn.lock" }}

- run:
command: yarn compile && yarn changed
working_directory: postdfm

- persist_to_workspace:
root: postdfm/packages
paths:
- ./postdfm/dist
- ./@postdfm/ast/dist
- ./@postdfm/ast2dfm/dist
- ./@postdfm/dfm2ast/dist
- ./@postdfm/dfm2ast/src
- ./@postdfm/plugin/dist
- ./@postdfm/transform/dist

compile-with-sourcemaps:
executor: node-executor
steps:
- checkout:
path: postdfm-with-sourcemaps

- restore_cache:
keys:
- node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "yarn.lock" }}
- node-{{ .Environment.CACHE_VERSION }}-dependencies-with-sourcemaps-{{ checksum "postdfm-with-sourcemaps/yarn.lock" }}

- run: yarn compile
- run:
command: yarn compile:map && yarn changed
working_directory: postdfm-with-sourcemaps

- persist_to_workspace:
root: packages
root: postdfm-with-sourcemaps/packages
paths:
- ./postdfm/dist
- ./@postdfm/ast/dist
Expand All @@ -55,104 +106,160 @@ jobs:
lint:
executor: node-executor
steps:
- checkout
- checkout:
path: postdfm

- restore_cache:
keys:
- node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "yarn.lock" }}
- node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "postdfm/yarn.lock" }}

- attach_workspace:
at: ~/repo/packages
at: postdfm/packages

- run: yarn lint:check
- run:
command: yarn lint && yarn changed
working_directory: postdfm

format:
executor: node-executor
steps:
- checkout
- checkout:
path: postdfm

- restore_cache:
keys:
- node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "yarn.lock" }}
- node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "postdfm/yarn.lock" }}

- run: yarn format:check
- run:
command: yarn format && yarn changed
working_directory: postdfm

test:
executor: node-executor
steps:
- checkout
- checkout:
path: postdfm-with-sourcemaps

- restore_cache:
keys:
- node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "yarn.lock" }}
- node-{{ .Environment.CACHE_VERSION }}-dependencies-with-sourcemaps-{{ checksum "postdfm-with-sourcemaps/yarn.lock" }}

- attach_workspace:
at: ~/repo/packages
at: postdfm-with-sourcemaps/packages

- run:
command: yarn test
working_directory: postdfm-with-sourcemaps

- run:
command: yarn changed
working_directory: postdfm-with-sourcemaps

- store_test_results:
path: postdfm-with-sourcemaps/packages/postdfm/results

- codecov/upload:
flags: "postdfm"
file: postdfm-with-sourcemaps/packages/postdfm/results/lcov/coverage.info

- store_test_results:
path: postdfm-with-sourcemaps/packages/@postdfm/ast/results

- codecov/upload:
flags: "@postdfm/ast"
file: postdfm-with-sourcemaps/packages/@postdfm/ast/results/lcov/coverage.info

- store_test_results:
path: postdfm-with-sourcemaps/packages/@postdfm/ast2dfm/results

- codecov/upload:
flags: "@postdfm/ast2dfm"
file: postdfm-with-sourcemaps/packages/@postdfm/ast2dfm/results/lcov/coverage.info

- store_test_results:
path: postdfm-with-sourcemaps/packages/@postdfm/dfm2ast/results

- run: yarn test
- codecov/upload:
flags: "@postdfm/dfm2ast"
file: postdfm-with-sourcemaps/packages/@postdfm/dfm2ast/results/lcov/coverage.info

- store_test_results:
path: test-results
path: postdfm-with-sourcemaps/packages/@postdfm/plugin/results

- codecov/upload:
file: coverage/lcov.info
flags: "@postdfm/plugin"
file: postdfm-with-sourcemaps/packages/@postdfm/plugin/results/lcov/coverage.info

- store_test_results:
path: postdfm-with-sourcemaps/packages/@postdfm/transform/results

- codecov/upload:
flags: "@postdfm/transform"
file: postdfm-with-sourcemaps/packages/@postdfm/transform/results/lcov/coverage.info

docs:
executor: node-executor
steps:
- checkout
- checkout:
path: postdfm

- restore_cache:
keys:
- node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "yarn.lock" }}
- node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "postdfm/yarn.lock" }}

- attach_workspace:
at: ~/repo/packages
at: postdfm/packages

- run: yarn docs

- persist_to_workspace:
root: docs
paths:
- ./*
- run:
command: yarn docs && yarn changed
working_directory: postdfm

release:
executor: node-executor
steps:
- checkout
- restore_cache:
keys:
- node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "yarn.lock" }}

- attach_workspace:
at: ~/repo/packages
- node-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "postdfm/yarn.lock" }}

- attach_workspace:
at: ~/repo/docs
at: postdfm/packages

- run: yarn release
- run:
command: yarn release
working_directory: postdfm

- store_artifacts:
path: ~/repo/dist
path: postdfm/dist
- store_artifacts:
path: ~/repo/package.json
path: postdfm/package.json
- store_artifacts:
path: ~/repo/packages/postdfm/package.json
path: postdfm/packages/postdfm/package.json
- store_artifacts:
path: ~/repo/packages/@postdfm/ast/package.json
path: postdfm/packages/@postdfm/ast/package.json
- store_artifacts:
path: ~/repo/packages/@postdfm/ast2dfm/package.json
path: postdfm/packages/@postdfm/ast2dfm/package.json
- store_artifacts:
path: ~/repo/packages/@postdfm/dfm2ast/package.json
path: postdfm/packages/@postdfm/dfm2ast/package.json
- store_artifacts:
path: ~/repo/packages/@postdfm/plugin/package.json
- store_artifacts:
path: ~/repo/packages/@postdfm/transform/package.json
path: postdfm/packages/@postdfm/transform/package.json

workflows:
version: 2
ci:
jobs:
- install
- install-with-sourcemaps:
requires:
- install
- compile:
requires:
- install
- compile-with-sourcemaps:
requires:
- install-with-sourcemaps
- format:
requires:
- install
Expand All @@ -161,7 +268,7 @@ workflows:
- compile
- test:
requires:
- compile
- compile-with-sourcemaps
- docs:
requires:
- compile
Expand All @@ -171,3 +278,8 @@ workflows:
- format
- test
- docs
filters:
branches:
only:
- master
- beta
2 changes: 2 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fixes:
- "postdfm-with-sourcemaps/::"
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,7 @@ typings/
# js
dist

# jest-junit
test-results

# nearley.js
packages/@postdfm/dfm2ast/src/grammar.ts
results/

#local npm configuration
.npmrc
Expand Down
9 changes: 8 additions & 1 deletion eslint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ module.exports = function getConfig(enableTypeChecking) {
plugins: ["@typescript-eslint"],
settings: {
node: {
allowModules: ["@postdfm/ast2dfm", "@postdfm/ast", "@postdfm/dfm2ast"],
allowModules: [
"postdfm",
"@postdfm/ast",
"@postdfm/ast2dfm",
"@postdfm/dfm2ast",
"@postdfm/plugin",
"@postdfm/transform"
],
tryExtensions: [".js", ".cjs", ".ts", ".json", ".node"]
}
},
Expand Down
34 changes: 0 additions & 34 deletions jest.config.json

This file was deleted.

Loading

0 comments on commit f85cae4

Please sign in to comment.