Skip to content

Commit 97c7671

Browse files
authored
chore: setup build with publishing scripts
1 parent 6ed3f52 commit 97c7671

File tree

5 files changed

+84
-57
lines changed

5 files changed

+84
-57
lines changed

.autorc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{
2+
}

.circleci/config.yml

+38-25
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,53 @@
22
#
33
# Check {{ '/2.0/language-javascript/' | docs_url }} for more details
44
#
5-
version: 2
6-
75
defaults: &defaults
86
working_directory: ~/repo
97
docker:
108
- image: circleci/node:10
119

12-
jobs:
13-
test:
10+
version: 2.1 # use CircleCI 2.1
11+
jobs: # a collection of steps
12+
build: # runs not using Workflows must have a `build` job as entry point
1413
<<: *defaults
15-
steps:
16-
- checkout
17-
18-
- restore_cache:
19-
keys:
20-
- v1-dependencies-{{ checksum "package.json" }}
21-
- v1-dependencies-
22-
23-
- run: yarn install
14+
steps: # a collection of executable commands
15+
- checkout # special step to check out source code to working directory
16+
- restore_cache: # special step to restore the dependency cache
17+
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
18+
key: dependency-cache-{{ checksum "yarn.lock" }}
2419
- run:
25-
name: Run tests
26-
command: yarn test
27-
28-
- save_cache:
20+
name: install-dependencies
21+
command: yarn install
22+
- save_cache: # special step to save the dependency cache
23+
key: dependency-cache-{{ checksum "yarn.lock" }}
2924
paths:
30-
- node_modules
31-
key: v1-dependencies-{{ checksum "package.json" }}
32-
33-
- persist_to_workspace:
34-
root: ~/repo
35-
paths: .
25+
- ./node_modules
26+
- run: # run tests
27+
name: test
28+
command: yarn test
29+
- run: # run build
30+
name: build
31+
command: yarn build
32+
deploy:
33+
<<: *defaults
34+
steps:
35+
- attach_workspace:
36+
at: ~/repo
37+
- run:
38+
name: Authenticate with registry
39+
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
40+
- run:
41+
name: Publish package
42+
command: yarn release
3643

3744
workflows:
3845
version: 2
39-
only_test:
46+
build_and_publish:
4047
jobs:
41-
- test
48+
- build
49+
- deploy:
50+
filters:
51+
branches:
52+
only: master
53+
requires:
54+
- build

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019-present LANDR Audio Inc.
3+
Copyright (c) 2019-present Corentin Ardeois <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

package.json

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "graphql-codegen-typescript-mock-data",
3-
"version": "0.0.1",
3+
"version": "0.0.1-beta",
44
"description": "GraphQL Codegen plugin for building mock data",
55
"main": "dist/commonjs/index.js",
66
"module": "dist/esnext/index.js",
77
"typings": "dist/esnext/index.d.ts",
8-
"repository": "http://github.com/LandrAudio/graphql-codegen-typescript-mocks",
8+
"repository": "ardeois/graphql-codegen-typescript-mock-data",
99
"author": {
1010
"name": "Corentin Ardeois",
11-
"email": "cardeois@landr.com",
11+
"email": "corentin.ardeois@gmail.com",
1212
"url": "https://github.com/ardeois"
1313
},
1414
"license": "MIT",
@@ -27,12 +27,13 @@
2727
"graphql": "^14.5.8"
2828
},
2929
"devDependencies": {
30+
"@auto-it/conventional-commits": "^7.12.3",
3031
"@graphql-codegen/testing": "^1.8.2",
3132
"@types/faker": "^4.1.6",
3233
"@types/jest": "^24.0.19",
3334
"@typescript-eslint/eslint-plugin": "^1.4.2",
3435
"@typescript-eslint/parser": "^1.4.2",
35-
"auto": "^7.12.2",
36+
"auto": "^7.12.3",
3637
"eslint": "6.0.0",
3738
"eslint-config-landr": "0.1.0",
3839
"eslint-config-prettier": "^4.1.0",
@@ -49,7 +50,10 @@
4950
"sideEffects": false,
5051
"scripts": {
5152
"build": "tsc -m esnext --outDir dist/esnext && tsc -m commonjs --outDir dist/commonjs",
52-
"test": "jest"
53+
"test": "jest",
54+
"version": "yarn version `auto version` -m 'Bump version to: %s [skip ci]'",
55+
"publish": "yarn publish && git push --follow-tags --set-upstream origin $branch",
56+
"release": "auto changelog && yarn version && yarn publish && auto release"
5357
},
5458
"files": [
5559
"dist/**/*",

yarn.lock

+34-26
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@
22
# yarn lockfile v1
33

44

5-
"@atomist/slack-messages@~1.1.0":
6-
version "1.1.1"
7-
resolved "https://registry.yarnpkg.com/@atomist/slack-messages/-/slack-messages-1.1.1.tgz#9de42932e89065fb4fe4842978ca2d1ed3424cea"
8-
integrity sha512-m2OzlTDbhvzK4hgswH9Lx0cdpq1AntXu53Klz5RGkFfuoDvKsnlU7tmtVfNWtUiP0zZbGtrb/BZYH7aB6TRnMA==
5+
"@auto-it/conventional-commits@^7.12.3":
6+
version "7.12.3"
7+
resolved "https://registry.yarnpkg.com/@auto-it/conventional-commits/-/conventional-commits-7.12.3.tgz#9ea966cfde6ee5ebe3c1e73c3af549f783ad80b0"
8+
integrity sha512-naGOWJS5SYWaWfv1Bb1NH16UP46yhyR/aFEAV8x2GPGKuzLFTiMKulU/WS8Y/DNxnzf8MNfmk0lVmhUMs4aZmw==
9+
dependencies:
10+
"@auto-it/core" "^7.12.3"
11+
parse-commit-message "4.0.0"
12+
tslib "1.10.0"
913

10-
"@auto-it/core@^7.12.2":
11-
version "7.12.2"
12-
resolved "https://registry.yarnpkg.com/@auto-it/core/-/core-7.12.2.tgz#1b070829a5f9b3df64fbbee8f5eaf613d3ca4941"
13-
integrity sha512-H1JtXElJ0HVMnnHA6ZYTC00EsRV+gISPqtmRwJLXMqtn9bDGFOQw9lLNrmOA0Uab4NUTGD2c6x3ZSYH5Zlai8w==
14+
"@auto-it/core@^7.12.3":
15+
version "7.12.3"
16+
resolved "https://registry.yarnpkg.com/@auto-it/core/-/core-7.12.3.tgz#d7211b5edd31620f0e2fa1a16660a599c84c354f"
17+
integrity sha512-qvxD6QxEjQmx5L0/S4Pq3suzq5Jgof/jqZ862yYE9XgzidSd5kaAV380lMdEghU98pkImnHNq1KEGl5cmZJ6yw==
1418
dependencies:
15-
"@atomist/slack-messages" "~1.1.0"
1619
"@octokit/graphql" "^4.0.0"
1720
"@octokit/plugin-enterprise-compatibility" "^1.1.1"
1821
"@octokit/plugin-retry" "^2.2.0"
@@ -38,12 +41,12 @@
3841
typescript-memoize "^1.0.0-alpha.3"
3942
url-join "^4.0.0"
4043

41-
"@auto-it/npm@^7.12.2":
42-
version "7.12.2"
43-
resolved "https://registry.yarnpkg.com/@auto-it/npm/-/npm-7.12.2.tgz#0400848044896c091a19200a54e2e92187f3817e"
44-
integrity sha512-1m+0jIa7qxf2PfextFA5FcMzvsmrXyn+wVGv24pnjc9yzA/3l7KTrMn1023PO5HNTFjzpsj/vh1P71sPTK9umQ==
44+
"@auto-it/npm@^7.12.3":
45+
version "7.12.3"
46+
resolved "https://registry.yarnpkg.com/@auto-it/npm/-/npm-7.12.3.tgz#981c33415b71cf9af0940c86450fbba9bc7c9399"
47+
integrity sha512-9197U26Hmy129jKRM9pDOvP0c5UA+97VIDuMQUxU1jv6ejxSOiXBaafsn0E7q7nRgQZoUFsTYkx1xIP4BPVOCQ==
4548
dependencies:
46-
"@auto-it/core" "^7.12.2"
49+
"@auto-it/core" "^7.12.3"
4750
env-ci "^4.1.1"
4851
get-monorepo-packages "^1.1.0"
4952
parse-author "^2.0.0"
@@ -55,12 +58,12 @@
5558
url-join "^4.0.0"
5659
user-home "^2.0.0"
5760

58-
"@auto-it/released@^7.12.2":
59-
version "7.12.2"
60-
resolved "https://registry.yarnpkg.com/@auto-it/released/-/released-7.12.2.tgz#0f0c821c5cbe9913da21b307e16fd2bea249b285"
61-
integrity sha512-crEM4muvbzpT4eOqPwTqV4V+eYfI6vuqYBsu8On4sOJDFb2JGlg8Gp6L6Y/2qzG9strycJDfhSOhvANIXYID1A==
61+
"@auto-it/released@^7.12.3":
62+
version "7.12.3"
63+
resolved "https://registry.yarnpkg.com/@auto-it/released/-/released-7.12.3.tgz#e2f7ddd750193d4a534225adb6adeec0263d3b92"
64+
integrity sha512-RUMdmoiCgIdNJ73oAwZxAllTO370Upq+x6PKL1kAtArvC6Ow9zgAgPBrwGs4VEByjlCbTSgiVaZHfzHh3TAeKw==
6265
dependencies:
63-
"@auto-it/core" "^7.12.2"
66+
"@auto-it/core" "^7.12.3"
6467
deepmerge "^4.0.0"
6568
tslib "1.10.0"
6669

@@ -985,14 +988,14 @@ author-regex@^1.0.0:
985988
resolved "https://registry.yarnpkg.com/author-regex/-/author-regex-1.0.0.tgz#d08885be6b9bbf9439fe087c76287245f0a81450"
986989
integrity sha1-0IiFvmubv5Q5/gh8dihyRfCoFFA=
987990

988-
auto@^7.12.2:
989-
version "7.12.2"
990-
resolved "https://registry.yarnpkg.com/auto/-/auto-7.12.2.tgz#8dac5704254f5675aaa408089d7d0dac3d9e1f2b"
991-
integrity sha512-DJw/BQM2Xlh/GFzwIh2x97D+32cq5lxaqzO7GCfQ8VnpAquhxtlovFJXm4Y7E+bN3WgGyVIb9wxROllnV6EEyw==
991+
auto@^7.12.3:
992+
version "7.12.3"
993+
resolved "https://registry.yarnpkg.com/auto/-/auto-7.12.3.tgz#afab0ec9b759a98c37a780c9c11cb6f37254475c"
994+
integrity sha512-IdgUoDdQ95rozAEJKEF7D5a/1v1iPk6FMxicVPruUueaQd7Xfymv2CTJJBOPAEfuqL5TkAL00L2WQrgLetnpNw==
992995
dependencies:
993-
"@auto-it/core" "^7.12.2"
994-
"@auto-it/npm" "^7.12.2"
995-
"@auto-it/released" "^7.12.2"
996+
"@auto-it/core" "^7.12.3"
997+
"@auto-it/npm" "^7.12.3"
998+
"@auto-it/released" "^7.12.3"
996999
chalk "^2.4.2"
9971000
command-line-application "^0.9.3"
9981001
dedent "^0.7.0"
@@ -4135,6 +4138,11 @@ parse-author@^2.0.0:
41354138
dependencies:
41364139
author-regex "^1.0.0"
41374140

4141+
4142+
version "4.0.0"
4143+
resolved "https://registry.yarnpkg.com/parse-commit-message/-/parse-commit-message-4.0.0.tgz#e24d53231c720224a96086ac33c8e9e0a3dae557"
4144+
integrity sha512-i06BJjUoGvIGJaiaLKW4WEM9V8+b98dLxxXCmK5mM2egKMnP29kTlweW2uMnwVJjG0v0W7kPGt/K4sSZVlLmvA==
4145+
41384146
41394147
version "1.0.2"
41404148
resolved "https://registry.yarnpkg.com/parse-github-url/-/parse-github-url-1.0.2.tgz#242d3b65cbcdda14bb50439e3242acf6971db395"

0 commit comments

Comments
 (0)