Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: eladb/projen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.8
Choose a base ref
...
head repository: eladb/projen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.1.9
Choose a head ref
  • 4 commits
  • 12 files changed
  • 1 contributor

Commits on May 12, 2020

  1. feat: rename projen.js to .projenrc.js

    Elad Ben-Israel committed May 12, 2020
    Copy the full SHA
    63a4538 View commit details
  2. feat: support bootstrapping from an empty repo

    basically always symlink projen to node_modules so we can run .projenrc.js
    Elad Ben-Israel committed May 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b38a6dc View commit details
  3. feat: add "release" script (bump + push)

    Elad Ben-Israel committed May 12, 2020
    Copy the full SHA
    91e8673 View commit details
  4. chore(release): 0.1.9

    Elad Ben-Israel committed May 12, 2020
    Copy the full SHA
    92d5b63 View commit details
Showing with 51 additions and 21 deletions.
  1. +1 −1 .github/workflows/build.yml
  2. +1 −1 .github/workflows/release.yml
  3. +2 −2 .gitignore
  4. 0 projen.js → .projenrc.js
  5. +9 −0 CHANGELOG.md
  6. +2 −8 bin/projen
  7. +24 −0 bin/projen.ts
  8. +2 −1 lib/common.ts
  9. +4 −4 lib/node-project.ts
  10. +1 −0 lib/version.ts
  11. +4 −3 package.json
  12. +1 −1 version.json
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by projen. To modify, edit "projen.js" and run "projen"
# Generated by projen. To modify, edit .projenrc.js and run "npx projen".
name: Build
on:
pull_request: {}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by projen. To modify, edit "projen.js" and run "projen"
# Generated by projen. To modify, edit .projenrc.js and run "npx projen".
name: Release
on:
push:
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by projen. To modify, edit "projen.js" and run "projen"
# Generated by projen. To modify, edit .projenrc.js and run "npx projen".
# synthesized by projen
/.npmignore
# Logs
@@ -52,7 +52,7 @@ tsconfig.json
*.js
!# synthesized by projen, but committed to git
!/package.json
!projen.js
!/.projenrc.js
!# always commit version file
!version.json
!# synthesized by projen, but committed to git
File renamed without changes.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,15 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.1.9](https://github.com/eladb/projen/compare/v0.1.8...v0.1.9) (2020-05-12)


### Features

* add "release" script (bump + push) ([91e8673](https://github.com/eladb/projen/commit/91e8673628e1ce4fe2df30c77b01a47c0cd5905b))
* rename projen.js to .projenrc.js ([63a4538](https://github.com/eladb/projen/commit/63a45384552e9e26fcece2adc51112295cfa0281))
* support bootstrapping from an empty repo ([b38a6dc](https://github.com/eladb/projen/commit/b38a6dce56b9dec8a142bd012afbafc7c8aff1f8))

### [0.1.8](https://github.com/eladb/projen/compare/v0.1.7...v0.1.8) (2020-05-12)


10 changes: 2 additions & 8 deletions bin/projen
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
#!/bin/bash
set -euo pipefail
app="./projen.js"
if [ ! -f $app ]; then
echo "$app not found"
exit 1
fi
exec node $app
#!/usr/bin/env node
require('./projen.js');
24 changes: 24 additions & 0 deletions bin/projen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import * as fs from 'fs';
import * as path from 'path';
import { PROJEN_RC } from '../lib/common';

const projenfile = path.resolve(PROJEN_RC);

if (!fs.existsSync(projenfile)) {
console.error(`unable to find ${projenfile}`);
process.exit(1);
}

// now in order to run, projen needs to be able to "require('projen')". this will
// work if we already installed our modules, but will fail miserably when we
// bootstrap a checked out (or empty) repo.
const projen = path.dirname(require.resolve('../package.json'));
const symlink = path.join('node_modules', 'projen');
if (!fs.existsSync(symlink)) {
fs.mkdirSync('node_modules', { recursive: true });
fs.symlinkSync(projen, symlink);
}

// now we are ready to rock
// eslint-disable-next-line @typescript-eslint/no-require-imports
require(projenfile);
3 changes: 2 additions & 1 deletion lib/common.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const GENERATION_DISCLAIMER = 'Generated by projen. To modify, edit "projen.js" and run "projen"';
export const PROJEN_RC = '.projenrc.js';
export const GENERATION_DISCLAIMER = `Generated by projen. To modify, edit ${PROJEN_RC} and run "npx projen".`;
8 changes: 4 additions & 4 deletions lib/node-project.ts
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import { JsonFile } from './json';
import { Semver } from './semver';
import { IgnoreFile } from './ignore-file';
import { License } from './license';
import { GENERATION_DISCLAIMER } from './common';
import { GENERATION_DISCLAIMER, PROJEN_RC } from './common';
import { Lazy } from 'constructs';
import { Version } from './version';

@@ -113,13 +113,13 @@ export class NodeProject extends Project {
this.manifest.license = license;
new License(this, license);

this.addScripts({ projen: 'node projen.js && yarn install' });
this.addScripts({ projen: `node ${PROJEN_RC} && yarn install` });

this.npmignore.comment('exclude project definition from npm module');
this.npmignore.exclude('projen.js');
this.npmignore.exclude(`/${PROJEN_RC}`);

this.npmignore.comment('make sure to commit projen definition');
this.gitignore.include('projen.js');
this.gitignore.include(`/${PROJEN_RC}`);

this.addBins(options.bin ?? { });

1 change: 1 addition & 0 deletions lib/version.ts
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ export class Version extends Construct {
super(project, 'bump-script');

project.addScripts({ bump: 'standard-version' });
project.addScripts({ release: 'yarn bump && git push --follow-tags origin master' });
project.addDevDependencies({
'standard-version': Semver.caret('8.0.0'),
});
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"//": "Generated by projen. To modify, edit \"projen.js\" and run \"projen\"",
"//": "Generated by projen. To modify, edit .projenrc.js and run \"npx projen\".",
"name": "projen",
"description": "A new generation of project generators",
"main": "lib/index.js",
@@ -11,9 +11,10 @@
"projen": "bin/projen"
},
"scripts": {
"projen": "node projen.js && yarn install",
"projen": "node .projenrc.js && yarn install",
"test": "yarn eslint",
"bump": "standard-version",
"release": "yarn bump && git push --follow-tags origin master",
"compile": "jsii",
"watch": "jsii -w",
"compat": "npx jsii-diff npm:$(node -p \"require('./package.json').name\")",
@@ -53,7 +54,7 @@
"yaml"
],
"license": "Apache-2.0",
"version": "0.1.8",
"version": "0.1.9",
"types": "lib/index.d.ts",
"stability": "experimental",
"jsii": {
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.1.8"
"version": "0.1.9"
}