Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VEL-2319] Convert to pnpm #12

Merged
merged 4 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
114 changes: 53 additions & 61 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request:

env:
NODE_VERSION: '12'
NODE_VERSION: 16
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}

Expand All @@ -18,52 +18,46 @@ jobs:
name: Lint & Test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODE_VERSION }}'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn --prefer-offline --frozen-lockfile
- name: Lint
run: yarn lint:js
- name: Run Tests
run: yarn test:ember
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: '${{ env.NODE_VERSION }}'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install
- name: Lint
run: pnpm lint:js
- name: Test
run: pnpm test:ember

release:
name: Release Package
runs-on: ubuntu-20.04
if: contains(github.ref, 'refs/tags/v')
needs: [test]
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: webfactory/[email protected]
with:
node-version: '${{ env.NODE_VERSION }}'
registry-url: 'https://npm.pkg.github.com'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
version: 8
- uses: actions/setup-node@v3
with:
node-version: '${{ env.NODE_VERSION }}'
cache: 'pnpm'
- name: Install Dependencies
run: yarn --prefer-offline --frozen-lockfile
- run: yarn publish
run: pnpm install
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
- run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -73,27 +67,25 @@ jobs:
needs: [test]
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODE_VERSION }}'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn --prefer-offline --frozen-lockfile
- name: Ember Build
run: ./node_modules/ember-cli/bin/ember build --silent --environment=production
- name: Deploy website
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist/
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: '${{ env.NODE_VERSION }}'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
- name: Ember Build
run: pnpm ember build --silent --environment=production
- name: Deploy website
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist/
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
3 changes: 0 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
/ember-cli-build.js
/testem.js
/tests/
/yarn-error.log
/yarn.lock
.gitkeep

# ember-try
Expand All @@ -37,4 +35,3 @@
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.19.0
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
21 changes: 8 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@

SHELL := /bin/bash

all: clear upfluence yarn_link_ls echo start ## Runs yarn_link_ls & starts the dev server
all: clear upfluence echo start

clear:
@clear

install: ## Runs 'yarn' to install dependencies
install: ## Install dependencies
@echo 'Installing dependencies'
yarn
pnpm install
@echo ""; echo "\n-------------------------------\n"; echo ""

echo:
@echo Starting Hyperevents Dummy App

start: ## Starts the dev server
ember s --port 0
pnpm ember s --port 0

clean: ## Cleans ./node_modules && ./dist
@echo "Cleaning up ./node_modules & ./dist folders"
Expand All @@ -30,26 +30,21 @@ re: clean install echo start ## Reinstalls dependencies & starts the dev server

tests: ## Runs tests once
@echo "Running tests once"
ember test --silent -r dot
pnpm ember test --silent -r dot

testserver: ## Runs the test server
@echo "Starting Test Server"
ember test -s

yarn_link_ls: ## Displays all the current projects linked using 'yarn link'
@echo Checking for yarn-links
@echo $(shell a=`find node_modules node_modules/\@* -maxdepth 1 -type l -print`; if [[ -n $$a ]]; then echo $$a; else echo "There are no linked modules."; fi)
@echo ""; echo "-------------------------------"; echo ""
pnpm ember test -s

enable_pre_hook: ## Enables git pre-hook on the project. Will run Linter & Tests before pushing.
@echo "Installing git pre-push hook"
@echo ""; echo "-------------------------------"; echo ""
yarn install-pre-push-hook
pnpm install-pre-push-hook

disable_pre_hook: ## Disables the git pre-push hook.
@echo "Removing git pre-push hook"
@echo ""; echo "-------------------------------"; echo ""
yarn remove-pre-push-hook
pnpm remove-pre-push-hook

help: ## Displays the help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
Expand Down
19 changes: 11 additions & 8 deletions addon/helpers/log-activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@ import Helper from '@ember/component/helper';
import { inject as service } from '@ember/service';
import { assert } from '@ember/debug';
import ActivityTracking from '../services/activity-tracking';
import { run } from '@ember/runloop';

export default class extends Helper {
@service declare activityTracking: ActivityTracking;

compute(params: any[]) {
const [action, actionDescription] = params;
assert(
'[helper][log-activity] An action is required for this helper to work properly.',
typeof action === 'function'
);
assert(
'[helper][log-activity] An actionDescription needs to be passed for the activity-log to make sense.',
typeof actionDescription === 'string'
);
run(() => {
assert(
'[helper][log-activity] An action is required for this helper to work properly.',
typeof action === 'function'
);
assert(
'[helper][log-activity] An actionDescription needs to be passed for the activity-log to make sense.',
typeof actionDescription === 'string'
);
});
Comment on lines +12 to +21
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes flacky tests

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LIAR ! πŸ˜‚
I don't believe in any fix for the param assertions ^^


return (event: PointerEvent) => {
this.activityTracking.log('button_click', actionDescription);
Expand Down
4 changes: 2 additions & 2 deletions app/styles/app.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'oss-components';
@import '@upfluence/oss-components/app/styles/oss-components';

.subscription-feed {
background-color: #292929;
Expand All @@ -19,4 +19,4 @@
overflow-y: scroll;
height: 100px;
}
}
}
24 changes: 1 addition & 23 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

const { name, version } = require('./package');
const MergeTrees = require('broccoli-merge-trees');
const writeFile = require('broccoli-file-creator');

const deployedApps = ['upfluence-web', 'creators-web', 'plugin-web', 'identity-web'];

Expand All @@ -22,33 +20,13 @@ module.exports = {
}
},

config(env, baseConfig) {
config(_, baseConfig) {
const config = this._super.config.apply(this, arguments);

if (baseConfig.APP && deployedApps.includes(baseConfig.APP.name) && baseConfig.APP.version) {
this.options['@embroider/macros'].setOwnConfig.parentAppVersion = baseConfig.APP.version;
}

return config;
},

included: function () {
this._super.included.apply(this, arguments);

this.import('vendor/@upfluence/hypertable/register-version.js');
},

treeForVendor(vendorTree) {
let trees = [];

if (vendorTree) {
trees.push(vendorTree);
}

trees.push(
writeFile('@upfluence/hypertable/register-version.js', `Ember.libraries.register('${name}', '${version}');`)
);

return new MergeTrees(trees);
}
};
22 changes: 6 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,13 @@
"dependencies": {
"@embroider/macros": "1.11.1",
"@embroider/test-setup": "^1.2.0",
"ember-auto-import": "^1.5.3",
"ember-auto-import": "^2.7.2",
"ember-cli-babel": "^7.19.0",
"ember-cli-htmlbars": "^4.3.1",
"ember-cli-typescript": "^4.2.1",
"ember-modifier": "3.2.0",
"ember-named-blocks-polyfill": "^0.2.5"
},
"peerDependencies": {
"@upfluence/oss-components": "^3.x"
},
"devDependencies": {
"@ember/jquery": "^2.0.0",
"@ember/optional-features": "^1.3.0",
Expand Down Expand Up @@ -75,31 +72,25 @@
"@types/sinon": "^10.0.6",
"@types/tether": "^1.4.6",
"@typescript-eslint/parser": "^5.9.1",
"@upfluence/oss-components": "^3.x",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"@upfluence/oss-components": "^3.54.4",
"ember-cli": "~3.18.0",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-less": "^2.0.1",
"ember-cli-moment-shim": "^3.7.1",
"ember-cli-sri": "^2.1.1",
"ember-cli-typescript-blueprints": "^3.0.0",
"ember-cli-uglify": "^3.0.0",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-export-application-global": "^2.0.1",
"ember-intl": "^4.1.0",
"ember-load-initializers": "^2.1.1",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-qunit": "^5.1.5",
"ember-resolver": "^8.0.3",
"ember-sinon-qunit": "^6.0.0",
"ember-source": "~3.18.0",
"ember-source-channel-url": "^2.0.1",
"ember-template-lint": "^2.6.0",
"ember-try": "^1.4.0",
"emberx-select": "^3.1.1",
"ember-truth-helpers": "3.0.0",
"ember-try": "^1.4.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^8.4.0",
Expand All @@ -111,13 +102,12 @@
"prettier": "^2.3.2",
"qunit": "^2.17.2",
"qunit-dom": "^1.2.0",
"typescript": "^4.5.4"
"typescript": "^4.9.5",
"webpack": "5"
},
"resolutions": {
"@babel/helper-compilation-targets": "7.9.6",
"bootstrap": "^3.3.7",
"whatwg-fetch": "3.3.1",
"ember-cli-ifa": "0.10.0"
"whatwg-fetch": "3.3.1"
},
"engines": {
"node": "10.* || >= 12"
Expand Down
Loading
Loading