forked from segmentio/action-destinations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve external developer experience (segmentio#81)
* Support external dx * Add external DX workflow * Add --ignore-optional * [core] Add jest moduleNameMapper * Fix typo * Add yarn link * no ci * [destinations] Add subscriptions to jest module map * yarn exec install * dash-dash * ignore browser destinations when calling build: * replicate manual test flow * Switch to yarn install * Move browser-destination jest config to file and conditionally run tests * [ci] sleep after bootstrapping * --no-ci bootstrap * Add subscriptions path * Update README.md * Reformat jest.config.js with 4 spaces * Add newline to jest.config.js
- Loading branch information
Showing
9 changed files
with
79 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Test External | ||
|
||
on: [push] | ||
|
||
jobs: | ||
install-and-test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [14.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install | ||
run: yarn --ignore-engines --ignore-optional | ||
|
||
- name: Bootstrap | ||
run: yarn bootstrap --no-ci | ||
|
||
- name: Test | ||
run: yarn test | ||
|
||
- name: Build | ||
run: NODE_ENV=production yarn build --ignore @segment/browser-destinations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports = async () => { | ||
const config = { | ||
rootDir: './', | ||
moduleNameMapper: { | ||
'@segment/actions-core': '<rootDir>/../core/src/index.ts' | ||
}, | ||
transform: { | ||
'^.+\\.[t|j]sx?$': 'babel-jest' | ||
}, | ||
transformIgnorePatterns: [ | ||
'/node_modules/(?!@segment/analytics-next).+\\.js$' | ||
], | ||
forceExit: true | ||
} | ||
|
||
try { | ||
await import('@segment/analytics-next') | ||
} catch (_) { | ||
config.testPathIgnorePatterns = [ | ||
'/node_modules/', | ||
'<rootDir>/src/' | ||
] | ||
console.warn('optional dependency @segment/analytics-next not found, ignoring all tests') | ||
} | ||
|
||
return config | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters