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

Add a new surrealdb addon package #2

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f2fed33
Create new surrealdb addon from copying surreal addon
zinyando May 17, 2023
6206caa
Prettier format surrealdb addon files
zinyando May 17, 2023
6ec0d7c
fix formatting
zinyando May 17, 2023
79dffb2
Update dependencies and add scripts
zinyando May 17, 2023
5353113
Add test folders and other files
zinyando May 17, 2023
7cf91e3
Cleanup makefile
zinyando May 17, 2023
cacba82
Initial test pass
zinyando May 30, 2023
dcc5977
Test pass #2: decorators
zinyando Jun 1, 2023
002622f
Re-export surrealdb.js errors
zinyando Jun 1, 2023
1aa9cf1
Delete invalid error imports
zinyando Jun 19, 2023
3cd6a50
Storage unit tests
zinyando Jun 19, 2023
d642141
Basic test app setup
zinyando Jun 19, 2023
3d7c072
Update dummpy app
zinyando Jun 21, 2023
e7395e8
Remove references to obsolute meta object
zinyando Jun 21, 2023
4563ada
Make cache reactive using ember tracked-built-ins instead of prototyp…
zinyando Jun 21, 2023
7bc24dd
Upgrade to the latest surrealdb.js 0.8.0 release
zinyando Jun 21, 2023
485da9f
Add signup and signin routes
zinyando Jun 23, 2023
eb7137a
Add back authenticated event emmitter on store service
zinyando Jun 23, 2023
8a59b21
Pin [email protected] in Makefile
zinyando Jun 27, 2023
d8d5760
Upgrade to surrealdb.js v0.8.2
zinyando Jun 27, 2023
7e43d01
Update dummy app code
zinyando Jun 27, 2023
1a8023a
Assign empty array to clear the cache
zinyando Jun 28, 2023
aef45c7
Return the single object when selecting by id
zinyando Jun 28, 2023
63658c5
Emit authenticated event after signing in
zinyando Jun 28, 2023
8d0c4c6
Fix issues in dummy app
zinyando Jun 28, 2023
4712eb5
Pass since record to ingest method in update function
zinyando Jun 29, 2023
a156322
Refactor to use router service for transitions in decorators
zinyando Jun 29, 2023
4325933
Use authenticated, invalidated and attempted decorators in dummy app …
zinyando Jun 29, 2023
47cc3fc
Update test app
zinyando Oct 23, 2023
cd90b73
Update surrealdb.js
zinyando Oct 23, 2023
8b44460
Update to latest surrealdb.js
zinyando Nov 8, 2023
687007a
Upgrade to [email protected]
zinyando Nov 14, 2023
a141811
Update table type access
zinyando Nov 16, 2023
7519758
Use router service for replaceWith method
zinyando Nov 16, 2023
afccd78
Cleanup the store instance initializer
zinyando Nov 16, 2023
275d58a
Update services
zinyando Nov 16, 2023
d9301c3
Octanify package.json
zinyando Nov 16, 2023
f2969e2
Update test app
zinyando Nov 16, 2023
643f55d
Update Makefile
zinyando Nov 23, 2023
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
50 changes: 25 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,29 @@ default:
.PHONY: clean
clean:
@echo "Clean..."
find packages -mindepth 2 -maxdepth 2 -type f -name '.bowerrc' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name '.editorconfig' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name '.ember-cli' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name '.ember-cli.js' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name '.eslintignore' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name '.eslintrc.js' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name '.gitignore' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name '.gitkeep' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name '.template-lintrc.js' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name '.travis.yml' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name '.watchmanconfig' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name 'bower.json' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name 'ember-cli-build.js' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name 'jsconfig.json' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name 'package-lock.json' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name 'README.md' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name 'testem.js' -delete
find packages -mindepth 2 -maxdepth 2 -type f -name 'yarn.lock' -delete
find packages -mindepth 2 -maxdepth 2 -type d -name '.git' -exec rm -rf "{}" \;
find packages -mindepth 2 -maxdepth 2 -type d -name 'config' -exec rm -rf "{}" \;
find packages -mindepth 2 -maxdepth 2 -type d -name 'dist' -exec rm -rf "{}" \;
find packages -mindepth 2 -maxdepth 2 -type d -name 'tests' -exec rm -rf "{}" \;
find packages -mindepth 2 -maxdepth 2 -type d -name 'tmp' -exec rm -rf "{}" \;
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name '.bowerrc' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name '.editorconfig' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name '.ember-cli' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name '.ember-cli.js' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name '.eslintignore' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name '.eslintrc.js' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f-name '.gitignore' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name '.gitkeep' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name '.template-lintrc.js' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name '.travis.yml' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name '.watchmanconfig' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name '.bowerrc' -delete \;
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name 'ember-cli-build.js' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name 'jsconfig.json' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name 'package-lock.json' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name 'README.md' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name 'testem.js' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -exec find {} -type f -name 'yarn.lock' -delete
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -name '.git' -exec rm -rf "{}" \;
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -name 'config' -exec rm -rf "{}" \;
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -name 'dist' -exec rm -rf "{}" \;
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -name 'tests' -exec rm -rf "{}" \;
find packages -mindepth 2 -maxdepth 2 -type d ! -path 'packages/surrealdb' -name 'tmp' -exec rm -rf "{}" \;
rm -rf node_modules
npx lerna clean --yes

Expand All @@ -58,12 +58,12 @@ serve:
.PHONY: version
version:
@echo "Version..."
npx lerna version --no-push --force-publish
npx lerna@4.0.0 version --no-push --force-publish

.PHONY: publish
publish:
@echo "Publish..."
npx lerna publish from-package
npx lerna@4.0.0 publish from-package

.PHONY: deploy
deploy:
Expand Down
19 changes: 19 additions & 0 deletions packages/surrealdb/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false

[*.{diff,md}]
trim_trailing_whitespace = false
7 changes: 7 additions & 0 deletions packages/surrealdb/.ember-cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
/**
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
*/
"isTypeScriptProject": false
}
13 changes: 13 additions & 0 deletions packages/surrealdb/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# unconventional js
/blueprints/*/files/

# compiled output
/dist/

# misc
/coverage/
!.*
.*/

# ember-try
/.node_modules.ember-try/
56 changes: 56 additions & 0 deletions packages/surrealdb/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
'use strict';

module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
rules: {},
overrides: [
// node files
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./tests/dummy/config/**/*.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
extends: ['plugin:n/recommended'],
},
{
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
78 changes: 78 additions & 0 deletions packages/surrealdb/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI

on:
push:
branches:
- main
- master
pull_request: {}

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
test:
name: "Tests"
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- name: Install Dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Run Tests
run: npm run test:ember

floating:
name: "Floating Dependencies"
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- name: Install Dependencies
run: npm install --no-shrinkwrap
- name: Run Tests
run: npm run test:ember

try-scenarios:
name: ${{ matrix.try-scenario }}
runs-on: ubuntu-latest
needs: "test"
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
try-scenario:
- ember-lts-4.8
- ember-lts-4.12
- ember-release
- ember-beta
- ember-canary
- embroider-safe
- embroider-optimized

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- name: Install Dependencies
run: npm ci
- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
25 changes: 25 additions & 0 deletions packages/surrealdb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# compiled output
/dist/
/declarations/

# dependencies
/node_modules/

# misc
/.env*
/.pnp*
/.eslintcache
/coverage/
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
/.node_modules.ember-try/
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# broccoli-debug
/DEBUG/
35 changes: 35 additions & 0 deletions packages/surrealdb/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# compiled output
/dist/
/tmp/

# misc
/.editorconfig
/.ember-cli
/.env*
/.eslintcache
/.eslintignore
/.eslintrc.js
/.git/
/.github/
/.gitignore
/.prettierignore
/.prettierrc.js
/.stylelintignore
/.stylelintrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/CONTRIBUTING.md
/ember-cli-build.js
/testem.js
/tests/
/yarn-error.log
/yarn.lock
.gitkeep

# ember-try
/.node_modules.ember-try/
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
13 changes: 13 additions & 0 deletions packages/surrealdb/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# unconventional js
/blueprints/*/files/

# compiled output
/dist/

# misc
/coverage/
!.*
.*/

# ember-try
/.node_modules.ember-try/
12 changes: 12 additions & 0 deletions packages/surrealdb/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

module.exports = {
overrides: [
{
files: '*.{js,ts}',
options: {
singleQuote: true,
},
},
],
};
8 changes: 8 additions & 0 deletions packages/surrealdb/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# unconventional files
/blueprints/*/files/

# compiled output
/dist/

# addons
/.node_modules.ember-try/
5 changes: 5 additions & 0 deletions packages/surrealdb/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
};
5 changes: 5 additions & 0 deletions packages/surrealdb/.template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended',
};
3 changes: 3 additions & 0 deletions packages/surrealdb/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore_dirs": ["dist"]
}
25 changes: 25 additions & 0 deletions packages/surrealdb/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# How To Contribute

## Installation

- `git clone <repository-url>`
- `cd surrealdb`
- `npm install`

## Linting

- `npm run lint`
- `npm run lint:fix`

## Running tests

- `ember test` – Runs the test suite on the current Ember version
- `ember test --server` – Runs the test suite in "watch mode"
- `ember try:each` – Runs the test suite against multiple Ember versions

## Running the dummy application

- `ember serve`
- Visit the dummy application at [http://localhost:4200](http://localhost:4200).

For more information on using ember-cli, visit [https://cli.emberjs.com/release/](https://cli.emberjs.com/release/).
9 changes: 9 additions & 0 deletions packages/surrealdb/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2023

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading