Skip to content

Commit 3856c94

Browse files
committed
chore: build @packages/config from src
1 parent 03b066b commit 3856c94

File tree

8 files changed

+38
-17
lines changed

8 files changed

+38
-17
lines changed

.circleci/src/workflows/workflows/@main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ linux-x64:
66
- equal: [ develop, << pipeline.git.branch >> ]
77
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
88
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
9+
- equal: [ 'chore/build_config_package_from_src', << pipeline.git.branch >> ]
910
- matches:
1011
pattern: /^release\/\d+\.\d+\.\d+$/
1112
value: << pipeline.git.branch >>

.circleci/workflows.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3693,6 +3693,9 @@ workflows:
36933693
- equal:
36943694
- update-v8-snapshot-cache-on-develop
36953695
- << pipeline.git.branch >>
3696+
- equal:
3697+
- chore/build_config_package_from_src
3698+
- << pipeline.git.branch >>
36963699
- matches:
36973700
pattern: /^release\/\d+\.\d+\.\d+$/
36983701
value: << pipeline.git.branch >>
@@ -3747,6 +3750,9 @@ workflows:
37473750
- equal:
37483751
- update-v8-snapshot-cache-on-develop
37493752
- << pipeline.git.branch >>
3753+
- equal:
3754+
- chore/build_config_package_from_src
3755+
- << pipeline.git.branch >>
37503756
- matches:
37513757
pattern: /^release\/\d+\.\d+\.\d+$/
37523758
value: << pipeline.git.branch >>
@@ -3812,6 +3818,9 @@ workflows:
38123818
- equal:
38133819
- update-v8-snapshot-cache-on-develop
38143820
- << pipeline.git.branch >>
3821+
- equal:
3822+
- chore/build_config_package_from_src
3823+
- << pipeline.git.branch >>
38153824
- matches:
38163825
pattern: /^release\/\d+\.\d+\.\d+$/
38173826
value: << pipeline.git.branch >>
@@ -4297,6 +4306,9 @@ workflows:
42974306
- equal:
42984307
- update-v8-snapshot-cache-on-develop
42994308
- << pipeline.git.branch >>
4309+
- equal:
4310+
- chore/build_config_package_from_src
4311+
- << pipeline.git.branch >>
43004312
- matches:
43014313
pattern: /^release\/\d+\.\d+\.\d+$/
43024314
value: << pipeline.git.branch >>
@@ -5132,6 +5144,9 @@ workflows:
51325144
- equal:
51335145
- update-v8-snapshot-cache-on-develop
51345146
- << pipeline.git.branch >>
5147+
- equal:
5148+
- chore/build_config_package_from_src
5149+
- << pipeline.git.branch >>
51355150
- matches:
51365151
pattern: /^release\/\d+\.\d+\.\d+$/
51375152
value: << pipeline.git.branch >>

packages/config/index.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/config/package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
"version": "0.0.0-development",
44
"description": "Config contains the configuration types and validation function used in the cypress electron application.",
55
"private": true,
6-
"main": "index.js",
7-
"browser": "src/browser.ts",
6+
"main": "dist/index.js",
7+
"browser": "dist/browser.js",
88
"scripts": {
9-
"build-prod": "tsc || echo 'built, with errors'",
9+
"build": "rimraf dist && tsc",
10+
"build-prod": "yarn build",
1011
"check-ts": "tsc --noEmit && yarn -s tslint",
1112
"clean": "rimraf --glob './src/*.js' './src/**/*.js' './src/**/**/*.js' './test/!**__fixtures__**/**/*.js' || echo 'cleaned'",
1213
"clean-deps": "rimraf node_modules",
@@ -45,11 +46,12 @@
4546
"@types/mocha": "9.1.0",
4647
"babel-plugin-tester": "^10.1.0",
4748
"chai": "4.2.0",
48-
"mocha": "7.0.1"
49+
"mocha": "7.0.1",
50+
"rimraf": "6.0.1"
4951
},
5052
"files": [
51-
"src"
53+
"dist"
5254
],
53-
"types": "src/index.ts",
55+
"types": "dist/index.d.ts",
5456
"nx": {}
5557
}

packages/config/src/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ const runtimeOptions: Array<RuntimeConfigOption> = [
485485
// having the final config that has the e2e property flattened/compacted
486486
// we may not be able to get the value to ignore.
487487
name: 'additionalIgnorePattern',
488-
defaultValue: (options: Record<string, any> = {}) => options.testingType === 'component' ? defaultSpecPattern.e2e : [],
488+
defaultValue: (options: Record<string, any> = {}): string | any[] => options.testingType === 'component' ? defaultSpecPattern.e2e : [],
489489
validation: validate.isStringOrArrayOfStrings,
490490
isInternal: true,
491491
}, {

packages/config/test/project/utils.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ import {
2222
setSupportFileAndFolder,
2323
mergeDefaults,
2424
} from '../../src/project/utils'
25+
import { resetIssuedWarnings } from '../../src/browser'
2526
import path from 'node:path'
2627

2728
const debug = Debug('test')
2829

2930
describe('config/src/project/utils', () => {
3031
beforeEach(function () {
3132
delete process.env.CYPRESS_COMMERCIAL_RECOMMENDATIONS
33+
resetIssuedWarnings()
3234
})
3335

3436
before(function () {

packages/config/tsconfig.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
{
2-
"extends": "../ts/tsconfig.json",
32
"include": [
43
"src/*.ts"
54
],
65
"exclude": [
76
"test"
87
],
98
"compilerOptions": {
10-
"allowJs": false,
9+
"target": "ES2020",
10+
"module": "commonjs",
11+
"moduleResolution": "node",
1112
"rootDir": "src",
13+
"outDir": "dist",
14+
"allowJs": false,
1215
"noImplicitAny": true,
1316
"noUncheckedIndexedAccess": true,
14-
"types": ["node"],
17+
"skipLibCheck": true,
18+
"esModuleInterop": true,
19+
"resolveJsonModule": true,
20+
"declaration": true, /* Skip type checking all .d.ts files. */
21+
"types": ["mocha", "node"],
1522
"typeRoots": [
1623
"../../node_modules/@types"
1724
],

packages/errors/src/errors.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,6 @@ export const AllCypressErrors = {
15531553
},
15541554
} as const
15551555

1556-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
15571556
const _typeCheck: Record<keyof AllCypressErrorObj, (...args: any[]) => ErrTemplateResult> = AllCypressErrors
15581557

15591558
export type AllCypressErrorObj = typeof AllCypressErrors
@@ -1608,7 +1607,7 @@ export const getError = function <Type extends keyof AllCypressErrorObj> (type:
16081607
return err
16091608
}
16101609

1611-
export const logWarning = function <Type extends keyof AllCypressErrorObj> (type: Type, ...args: Parameters<AllCypressErrorObj[Type]>) {
1610+
export const logWarning = function <Type extends keyof AllCypressErrorObj> (type: Type, ...args: Parameters<AllCypressErrorObj[Type]>): any {
16121611
const err = getError(type, ...args)
16131612

16141613
logError(err, 'magenta')

0 commit comments

Comments
 (0)