Skip to content

Commit

Permalink
Add mrlint and reorganize monorepo (#11)
Browse files Browse the repository at this point in the history
* Add mrlint and reorganize monorepo

* Fix config

* Fix config

* Add working_directory for java tasks

* Update java paths

* Fix 'bin'

* Remove unnecessary yarn install

* Add back dependencies

* Add back devdep check

* Fix yarn.lock

* Add immutable flag to yarn install

* Fix tsconfigs

* Fix eslint

* Add devdep react

* Rename
  • Loading branch information
zachkirsch authored Apr 12, 2022
1 parent fb59213 commit c3f24db
Show file tree
Hide file tree
Showing 326 changed files with 9,675 additions and 1,610 deletions.
176 changes: 118 additions & 58 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,125 @@
version: 2.1
orbs:
aws-cli: circleci/aws-cli@2.0.3
node: circleci/node@5.0.1
jobs:
compile:
docker: [{ image: 'cimg/openjdk:11.0.10-node' }]
resource_class: small
environment:
CIRCLE_TEST_REPORTS: /home/circleci/junit
CIRCLE_ARTIFACTS: /home/circleci/artifacts
GRADLE_OPTS: -Dorg.gradle.jvmargs='-XX:MaxMetaspaceSize=256m' -Dorg.gradle.workers.max=4
_JAVA_OPTIONS: -XX:ActiveProcessorCount=4 -Xmx1177m -XX:MaxMetaspaceSize=512m -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
steps:
- checkout
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'compile-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew --parallel --stacktrace classes testClasses
- save_cache:
key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
paths: [ ~/.gradle/wrapper ]
- save_cache:
key: 'compile-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches ]
- persist_to_workspace:
root: /home/circleci
paths: [ project, .gradle/init.gradle ]
lint:
docker:
- image: cimg/node:17.3.1
steps:
- checkout
- node/install-packages:
pkg-manager: yarn-berry
- run:
name: Compile mrlint
command: yarn workspace mrlint run compile
- run:
name: Lint monorepo
command: yarn lint:monorepo
- run:
name: Lint
command: yarn lint:eslint
- run:
name: Lint style
command: yarn lint:style
- run:
name: Format
command: yarn format:check
- run:
name: Check dependencies
command: yarn depcheck
- run:
name: Ensure no changes to git-tracked files
command: git --no-pager diff
compile-and-test:
docker:
- image: cimg/node:17.3.1
steps:
- checkout
- node/install-packages:
pkg-manager: yarn-berry
- run:
name: Compile
command: yarn compile
- run:
name: Run tests
command: yarn test -- --ci
compile-java:
docker: [{ image: "cimg/openjdk:11.0.10-node" }]
resource_class: small
environment:
CIRCLE_TEST_REPORTS: /home/circleci/junit
CIRCLE_ARTIFACTS: /home/circleci/artifacts
GRADLE_OPTS: -Dorg.gradle.jvmargs='-XX:MaxMetaspaceSize=256m' -Dorg.gradle.workers.max=4
_JAVA_OPTIONS: -XX:ActiveProcessorCount=4 -Xmx1177m -XX:MaxMetaspaceSize=512m -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
steps:
- checkout
- restore_cache:
{
key: 'gradle-wrapper-v2-{{ checksum "packages/fern-java/gradle/wrapper/gradle-wrapper.properties" }}',
}
- restore_cache:
{
key: 'compile-gradle-cache-v2-{{ checksum "packages/fern-java/versions.props" }}-{{ checksum "packages/fern-java/build.gradle" }}',
}
- run: cd packages/fern-java && ./gradlew --parallel --stacktrace classes testClasses
- save_cache:
key: 'gradle-wrapper-v2-{{ checksum "packages/fern-java/gradle/wrapper/gradle-wrapper.properties" }}'
paths: [~/.gradle/wrapper]
- save_cache:
key: 'compile-gradle-cache-v2-{{ checksum "packages/fern-java/versions.props" }}-{{ checksum "packages/fern-java/build.gradle" }}'
paths: [~/.gradle/caches]
- persist_to_workspace:
root: /home/circleci
paths: [project, packages/fern-java/.gradle/init.gradle]

publish-snapshot:
docker: [{ image: 'cimg/openjdk:11.0.10-node' }]
resource_class: small
environment:
CIRCLE_TEST_REPORTS: /home/circleci/junit
CIRCLE_ARTIFACTS: /home/circleci/artifacts
_JAVA_OPTIONS: -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false -Xmx8192m
JAVA_HOME: /opt/java11
steps:
- attach_workspace: { at: /home/circleci }
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'unit-test-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run:
name: Install Java
command: |
sudo mkdir -p /opt/java && cd /opt/java && sudo chown -R circleci:circleci .
curl https://cdn.azul.com/zulu/bin/zulu11.41.23-ca-jdk11.0.8-linux_x64.tar.gz | tar -xzf - -C /opt/java
sudo ln -s /opt/java/zulu*/ /opt/java11
- run:
command: ./gradlew artifactoryPublish
name: Publish conjure json file
publish-java-snapshot:
docker: [{ image: "cimg/openjdk:11.0.10-node" }]
resource_class: small
environment:
CIRCLE_TEST_REPORTS: /home/circleci/junit
CIRCLE_ARTIFACTS: /home/circleci/artifacts
_JAVA_OPTIONS: -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false -Xmx8192m
JAVA_HOME: /opt/java11
steps:
- attach_workspace: { at: /home/circleci }
- restore_cache:
{
key: 'gradle-wrapper-v2-{{ checksum "packages/fern-java/gradle/wrapper/gradle-wrapper.properties" }}',
}
- restore_cache:
{
key: 'unit-test-gradle-cache-v2-{{ checksum "packages/fern-java/versions.props" }}-{{ checksum "packages/fern-java/build.gradle" }}',
}
- run:
name: Install Java
command: |
sudo mkdir -p /opt/java && cd /opt/java && sudo chown -R circleci:circleci .
curl https://cdn.azul.com/zulu/bin/zulu11.41.23-ca-jdk11.0.8-linux_x64.tar.gz | tar -xzf - -C /opt/java
sudo ln -s /opt/java/zulu*/ /opt/java11
- run:
command: cd packages/fern-java && ./gradlew artifactoryPublish
name: Publish conjure json file

workflows:
version: 2
build:
jobs:
- compile:
filters: { tags: { only: /.*/ } }
version: 2
build:
jobs:
- lint:
filters: { tags: { only: /.*/ } }

- publish-snapshot:
requires: [ compile ]
filters:
branches:
only:
- main
tags:
ignore: /.*/
context: jfrog
- compile-and-test:
filters: { tags: { only: /.*/ } }
requires: [lint]

- compile-java:
filters: { tags: { only: /.*/ } }

- publish-java-snapshot:
requires: [compile-java]
filters:
branches:
only:
- main
tags:
ignore: /.*/
context: jfrog
File renamed without changes.
File renamed without changes.
57 changes: 30 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
*.class
.project
.gradle
.classpath
.checkstyle
.settings
.node
build
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Windows git artifact
fileeditor
# dependencies
/node_modules
/packages/**/node_modules

# Mac specific files
.DS_Store
# production
/packages/**/build
/packages/**/lib
tsconfig.tsbuildinfo

# IntelliJ
*.iml
*.ipr
*.iws
.idea/
out/
# environment
.env.local

# Eclipse/IntelliJ APT
generated_src/
generated_testSrc/
generated/
# misc
.DS_Store

bin
build
# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

**/jenkins-junit.xsd.episode
# yarn v2
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

**/node_modules/**
**/yarn.lock
# cdk
cdk.context.json
.cdk.staging/
cdk.out/
*.tabl.json
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .mrlint.root.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"packages": "packages/**",
"sharedConfigs": "./shared"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 0 additions & 37 deletions cli/typescript/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions cli/typescript/.stylelintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion cli/typescript/packages/compiler/cli/.stylelintrc.json

This file was deleted.

39 changes: 0 additions & 39 deletions cli/typescript/packages/compiler/cli/package.json

This file was deleted.

This file was deleted.

28 changes: 0 additions & 28 deletions cli/typescript/packages/compiler/compiler-commons/package.json

This file was deleted.

This file was deleted.

Loading

0 comments on commit c3f24db

Please sign in to comment.