Skip to content

Commit beb9d30

Browse files
authored
Merge pull request #162 from launchcodedev/rollup-plugin
Rollup and Vite plugins (similar to webpack)
2 parents 5e52a9d + f619fdc commit beb9d30

File tree

68 files changed

+632
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+632
-68
lines changed

.github/workflows/cypress.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
- uses: bahmutov/npm-install@v1
1616

1717
- run: yarn build
18+
- run: yarn build:es
19+
- run: yarn build:all
1820

1921
- name: Cypress dependencies
2022
uses: cypress-io/github-action@v2
@@ -85,3 +87,12 @@ jobs:
8587
start: yarn serve -l 8995 ./dist
8688
env:
8789
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
90+
- uses: cypress-io/github-action@v2
91+
with:
92+
group: app-config-vite
93+
working-directory: examples/vite-project
94+
install: false
95+
record: true
96+
start: yarn serve -l 8996 ./dist
97+
env:
98+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

.github/workflows/main.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,15 @@ jobs:
2222
node-version: ${{ matrix.node-version }}
2323
- uses: bahmutov/npm-install@v1
2424
- run: yarn build
25+
- run: yarn build:es
26+
- run: yarn build:all
2527
- run: yarn lint
2628
- run: yarn test --coverage --testTimeout 20000
2729
env: { CI: 1 }
30+
31+
# sanity check that the rollup plugin made a file without needing to loadConfig
32+
- run: yarn --cwd ./examples/rollup-project start
33+
2834
- uses: codecov/codecov-action@v1
2935
if: matrix.os == 'ubuntu-latest'
3036
with:
@@ -53,5 +59,7 @@ jobs:
5359
./app-config-v1-compat/coverage/coverage-final.json,
5460
./app-config-vault/coverage/coverage-final.json,
5561
./app-config-webpack/coverage/coverage-final.json,
62+
./app-config-rollup/coverage/coverage-final.json,
63+
./app-config-vite/coverage/coverage-final.json,
5664
fail_ci_if_error: true
5765
verbose: true

.github/workflows/publishing.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,18 @@ jobs:
148148
token: ${{ secrets.NPM_TOKEN }}
149149
access: public
150150
package: ./app-config-webpack/package.json
151+
- name: app-config-rollup
152+
uses: JS-DevTools/npm-publish@v1
153+
with:
154+
token: ${{ secrets.NPM_TOKEN }}
155+
access: public
156+
package: ./app-config-rollup/package.json
157+
- name: app-config-vite
158+
uses: JS-DevTools/npm-publish@v1
159+
with:
160+
token: ${{ secrets.NPM_TOKEN }}
161+
access: public
162+
package: ./app-config-vite/package.json
151163
- name: lcdev-app-config-inject
152164
uses: JS-DevTools/npm-publish@v1
153165
with:

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ If you are adding anything new or changing behavior, please add applicable tests
5151
- `@app-config/schema`: schema loading and validation
5252
- `@app-config/inject`: runtime injection into HTML files
5353
- `@app-config/webpack`: webpack plugin
54+
- `@app-config/rollup`: rollup plugin
55+
- `@app-config/vite`: vite plugin
5456
- `@app-config/main`: main config singleton and loading logic
5557
- `@lcdev/app-config`: alias for `@app-config/main`
5658
- `@lcdev/app-config-webpack-plugin`: alias for `@app-config/webpack`

app-config-cli/tsconfig.es.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"target": "es2020",
4+
"target": "es2019",
55
"module": "es2020",
66
"outDir": "./dist/es"
77
}

app-config-config/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
} from '@app-config/node';
2020
import { markAllValuesAsSecret } from '@app-config/extensions';
2121
import { defaultExtensions, defaultEnvExtensions } from '@app-config/default-extensions';
22-
import { loadSchema, JSONSchema, SchemaLoadingOptions } from '@app-config/schema';
22+
import { loadSchema, JSONSchema, SchemaLoadingOptions, Schema } from '@app-config/schema';
2323
import { loadMetaConfig, loadExtraParsingExtensions } from '@app-config/meta';
2424

2525
export interface ConfigLoadingOptions {
@@ -49,7 +49,7 @@ export interface LoadedConfiguration {
4949
/** if loadValidatedConfig, this is the normalized JSON schema that was used for validation */
5050
schema?: JSONSchema;
5151
/** if loadValidatedConfig, this is the raw AJV validation function */
52-
validationFunctionCode?(): string;
52+
validationFunctionCode?: Schema['validationFunctionCode'];
5353
}
5454

5555
export async function loadUnvalidatedConfig({

app-config-config/tsconfig.es.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"target": "es2020",
4+
"target": "es2019",
55
"module": "es2020",
66
"outDir": "./dist/es"
77
}

app-config-core/tsconfig.es.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"target": "es2020",
4+
"target": "es2019",
55
"module": "es2020",
66
"outDir": "./dist/es"
77
}

app-config-cypress/tsconfig.es.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"target": "es2020",
4+
"target": "es2019",
55
"module": "es2020",
66
"outDir": "./dist/es"
77
}

app-config-encryption/tsconfig.es.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"target": "es2020",
4+
"target": "es2019",
55
"module": "es2020",
66
"outDir": "./dist/es"
77
}

0 commit comments

Comments
 (0)