Skip to content

Commit

Permalink
Prepare 8.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
kyubisation committed Aug 24, 2019
1 parent fefa6bb commit 56d7eae
Show file tree
Hide file tree
Showing 20 changed files with 12,834 additions and 27 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 8.0.0 (2019-08-25)

### Bugfix

* Fixed issue with native cli --recursive

# 8.0.0-beta.4 (2019-07-19)

### Bugfix
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ of this library can be used, as it is Angular version agnostic.

## Getting Started
```
ng add angular-server-side-configuration@next
ng add angular-server-side-configuration
```
or, if you have a previous version of this library installed
```
ng update angular-server-side-configuration@next
ng update angular-server-side-configuration@latest
```
This will configure the appropriate files.

Alternatively, if you want to configure the files yourself:
```
npm install --save angular-server-side-configuration@next
npm install --save angular-server-side-configuration
```

### angular.json
Expand Down Expand Up @@ -164,7 +164,7 @@ Usage: ngssc insert [options] [directory]
Dockerfile
```Dockerfile
FROM nginx:alpine
ADD https://github.com/kyubisation/angular-server-side-configuration/releases/download/v2.0.0/ngssc_64bit /usr/sbin/ngssc
ADD https://github.com/kyubisation/angular-server-side-configuration/releases/download/v8.0.0/ngssc_64bit /usr/sbin/ngssc
RUN chmod +x /usr/sbin/ngssc
COPY dist /usr/share/nginx/html
COPY start.sh start.sh
Expand Down
19 changes: 12 additions & 7 deletions cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ func insertCommand(c *cli.Context) error {
return cli.NewExitError(err, 1)
}
} else {
ngsscPath, err := filepath.Abs("./ngssc.json")
ngsscFile, err := filepath.Abs("./ngssc.json")
if err != nil {
return cli.NewExitError(err, 1)
}
err = configureWithNgssc(ngsscPath, dryRunFlag)
err = configureWithNgssc(ngsscFile, dryRunFlag)
if err != nil {
return cli.NewExitError(err, 1)
}
Expand All @@ -112,24 +112,29 @@ func configureWithNgsscRecursively(dryRun bool) error {

for _, ngsscFile := range files {
err = configureWithNgssc(ngsscFile, dryRun)
return err
}

return nil
}

func configureWithNgssc(ngsscPath string, dryRun bool) error {
ngssc, err := readNgsscJSON(ngsscPath)
func configureWithNgssc(ngsscFile string, dryRun bool) error {
ngssc, err := readNgsscJSON(ngsscFile)
if err != nil {
return err
}

iifeScript := generateIifeScript(*ngssc, ngsscPath)
err = os.Chdir(filepath.Dir(ngsscFile))
if err != nil {
fmt.Printf("Failed to change to directory of %v\n", ngsscFile)
return nil
}

iifeScript := generateIifeScript(*ngssc, ngsscFile)
files, err := doublestar.Glob(*ngssc.FilePattern)
if err != nil {
return err
} else if files == nil {
fmt.Printf("No files found with pattern %v\n", ngssc.FilePattern)
fmt.Printf("No files found with pattern %v\n", *ngssc.FilePattern)
return nil
}

Expand Down
23 changes: 7 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
version: "3.5"
services:
start:
image: zephinzer/golang-dev:latest
ports:
- "2345:2345"
user: "${UID}"
entrypoint: ["start"]
volumes:
- "./cli/pkg:/go/pkg"
- "./cli/:/go/src/app"
test:
image: zephinzer/golang-dev:latest
user: "${UID}"
entrypoint: ["test"]
volumes:
- "./cli/pkg:/go/pkg"
- "./cli/:/go/src/app"
build-go:
build: ./cli
volumes:
Expand All @@ -24,3 +8,10 @@ services:
environment:
- VERSION=${npm_package_version}
command: ["/src/build.sh"]
test-minimal:
build: ./test/minimal
image: test-minimal
ports:
- "8080:80"
environment:
- VARIABLE=Variable
46 changes: 46 additions & 0 deletions test/minimal/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# dependencies
/node_modules

# profiling files
chrome-profiler-events.json
speed-measure-plugin.json

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db
7 changes: 7 additions & 0 deletions test/minimal/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM nginx:alpine
COPY dist/ngssc_64bit /usr/sbin/ngssc
RUN chmod +x /usr/sbin/ngssc
COPY dist/minimal /usr/share/nginx/html
COPY start.sh start.sh
RUN chmod +x ./start.sh
CMD ["./start.sh"]
112 changes: 112 additions & 0 deletions test/minimal/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"minimal": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"inlineTemplate": true,
"inlineStyle": true,
"skipTests": true
},
"@schematics/angular:class": {
"skipTests": true
},
"@schematics/angular:directive": {
"skipTests": true
},
"@schematics/angular:guard": {
"skipTests": true
},
"@schematics/angular:module": {
"skipTests": true
},
"@schematics/angular:pipe": {
"skipTests": true
},
"@schematics/angular:service": {
"skipTests": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/minimal",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": [],
"styles": [],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "minimal:build"
},
"configurations": {
"production": {
"browserTarget": "minimal:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "minimal:build"
}
},
"ngsscbuild": {
"builder": "angular-server-side-configuration:ngsscbuild",
"options": {
"additionalEnvironmentVariables": [],
"aotSupport": true,
"browserTarget": "minimal:build",
"ngsscEnvironmentFile": "src/environments/environment.prod.ts"
},
"configurations": {
"production": {
"browserTarget": "minimal:build:production"
}
}
}
}
}
},
"defaultProject": "minimal"
}
12 changes: 12 additions & 0 deletions test/minimal/browserslist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# You can see what browsers were selected by your queries by running:
# npx browserslist

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
Loading

0 comments on commit 56d7eae

Please sign in to comment.