Skip to content

Commit

Permalink
chore(package): move project to ng cli
Browse files Browse the repository at this point in the history
  • Loading branch information
DethAriel committed Dec 23, 2020
1 parent 8eb658e commit 6c65f97
Show file tree
Hide file tree
Showing 109 changed files with 7,144 additions and 8,844 deletions.
8 changes: 0 additions & 8 deletions .editorconfig

This file was deleted.

1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
node_modules
dist
demo/node_modules
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
},
env: {
es6: true,
},
overrides: [
{
files: ["*.ts"],
Expand Down
12 changes: 1 addition & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@

# compiled sources
/dist
/*.js
!.eslintrc.js
/*.d.ts
/recaptcha/**/*.js
/recaptcha/**/*.d.ts

# Angular AoT output
*.metadata.json
/coverage

# Logs
logs
Expand All @@ -22,6 +15,3 @@ npm-debug.log*

# Dependency directories
node_modules

# Build files
ng-recaptcha-*.tgz
29 changes: 0 additions & 29 deletions .npmignore

This file was deleted.

3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
dist/
demo/dist
dist/
File renamed without changes.
25 changes: 21 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,28 @@ node_js:
- "12.17.0"
cache:
yarn: true
addons:
chrome: stable
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.5
- export PATH="$HOME/.yarn/bin:$PATH"
script:
install:
- yarn install
- yarn demo:install
- yarn build
- yarn demo:build
before_script:
- yarn demo:file-gen
- yarn lib:build # things like "lint" depend on it, so we're including this in the "before_script" section
jobs:
include:
- name: "Static analysis"
script:
- yarn lint
- name: "Build demo site"
script:
- yarn demo:build
- name: "Run unit tests"
script:
- yarn ng test ng-recaptcha --code-coverage
- yarn coveralls < coverage/ng-recaptcha/lcov.info
- name: "Run e2e tests"
script:
- yarn ng e2e demo
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ After you did that, follow the below process:

- Pushed the latest changes to upstream: `git push`
- Ensure that the build succeeds
- To start with, make sure all the dependencies are up-to-date: `yarn && yarn clean && yarn demo:install`
- Then you need to prepare a release (demo site will be built at this stage). Run `npm run prepare-release <VERSION>`. Use `npm` , not `yarn`!
- To start with, make sure all the dependencies are up-to-date: `yarn && yarn clean`
- Then you need to prepare a release. Run `npm run prepare-release <VERSION>`. Use `npm` , not `yarn`!
- Possible forms of `<VERSION>`: `<MAJOR>.<MINOR>.<PATCH>`, `<MAJOR>.<MINOR>.<PATCH>-beta.<BETA_VERSION>`
- Build a demo site after that: `yarn demo:build`
- Verify the latest commit, and run `git push && git push --tag` to push the changes to the origin
- Wait for the build to succeed
- Publish the package to npm _from the "/dist" directory_: `cd dist && npm publish` (or `cd dist && npm publish --tag beta`)
- Publish the package to npm _from the "/dist/ng-recaptcha" directory_: `cd dist/ng-recaptcha && npm publish` (or `cd dist/ng-recaptcha && npm publish --tag beta`)
- Create a GitHub release and update the demo site by running `yarn github-release && yarn demo:publish`
121 changes: 121 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ng-recaptcha": {
"projectType": "library",
"root": "projects/ng-recaptcha",
"sourceRoot": "projects/ng-recaptcha/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/ng-recaptcha/tsconfig.lib.json",
"project": "projects/ng-recaptcha/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/ng-recaptcha/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/ng-recaptcha/src/test.ts",
"tsConfig": "projects/ng-recaptcha/tsconfig.spec.json",
"karmaConfig": "projects/ng-recaptcha/karma.conf.js"
}
}
}
},
"demo": {
"projectType": "application",
"schematics": {},
"root": "projects/demo",
"sourceRoot": "projects/demo/src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/demo/ng-recaptcha",
"index": "projects/demo/src/index.html",
"main": "projects/demo/src/app/demo-wrapper/demo-wrapper.main.ts",
"polyfills": "projects/demo/src/polyfills.ts",
"tsConfig": "projects/demo/tsconfig.app.json",
"baseHref": "/ng-recaptcha/",
"aot": true,
"assets": [
"projects/demo/src/favicon.ico",
"projects/demo/src/images"
],
"styles": ["projects/demo/src/styles.css"],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "projects/demo/src/environments/environment.ts",
"with": "projects/demo/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "demo:build"
},
"configurations": {
"production": {
"browserTarget": "demo:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "demo:build"
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "projects/demo/e2e/protractor.conf.js",
"devServerTarget": "demo:serve"
},
"configurations": {
"production": {
"devServerTarget": "demo:serve:production"
}
}
}
}
}
},
"defaultProject": "ng-recaptcha"
}
1 change: 0 additions & 1 deletion demo/.nvmrc

This file was deleted.

55 changes: 0 additions & 55 deletions demo/angular.json

This file was deleted.

26 changes: 0 additions & 26 deletions demo/bin/install-latest.ts

This file was deleted.

50 changes: 0 additions & 50 deletions demo/package.json

This file was deleted.

Loading

0 comments on commit 6c65f97

Please sign in to comment.