diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1722708 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.0.1] +### Added +- Basic package dependencies on `language-mzn` and `linter-mzn`. + +[Unreleased]: https://github.com/Dekker1/atom-minisuite/compare/v0.0.1...HEAD +[0.1.0]: https://github.com/Dekker1/atom-minisuite/compare/e7a5f508ae9975c310ae6fcb6c73c84b63dd6f49...v0.0.1 diff --git a/keymaps/minisuite.cson b/keymaps/minisuite.cson index fb9de98..9531d90 100644 --- a/keymaps/minisuite.cson +++ b/keymaps/minisuite.cson @@ -1,11 +1,11 @@ -# Keybindings require three things to be fully defined: A selector that is -# matched against the focused element, the keystroke and the command to -# execute. +# # Keybindings require three things to be fully defined: A selector that is +# # matched against the focused element, the keystroke and the command to +# # execute. +# # +# # Below is a basic keybinding which registers on all platforms by applying to +# # the root workspace element. # -# Below is a basic keybinding which registers on all platforms by applying to -# the root workspace element. - -# For more detailed documentation see -# https://atom.io/docs/latest/behind-atom-keymaps-in-depth -'atom-workspace': - 'ctrl-alt-o': 'minisuite:toggle' +# # For more detailed documentation see +# # https://atom.io/docs/latest/behind-atom-keymaps-in-depth +# 'atom-workspace': +# 'ctrl-alt-o': 'minisuite:toggle' diff --git a/lib/minisuite-view.coffee b/lib/minisuite-view.coffee index 8aa95fe..c87fb79 100644 --- a/lib/minisuite-view.coffee +++ b/lib/minisuite-view.coffee @@ -1,22 +1,22 @@ -module.exports = -class MinisuiteView - constructor: (serializedState) -> - # Create root element - @element = document.createElement('div') - @element.classList.add('minisuite') - - # Create message element - message = document.createElement('div') - message.textContent = "The Minisuite package is Alive! It's ALIVE!" - message.classList.add('message') - @element.appendChild(message) - - # Returns an object that can be retrieved when package is activated - serialize: -> - - # Tear down any state and detach - destroy: -> - @element.remove() - - getElement: -> - @element +# module.exports = +# class MinisuiteView +# constructor: (serializedState) -> +# # Create root element +# @element = document.createElement('div') +# @element.classList.add('minisuite') +# +# # Create message element +# message = document.createElement('div') +# message.textContent = "The Minisuite package is Alive! It's ALIVE!" +# message.classList.add('message') +# @element.appendChild(message) +# +# # Returns an object that can be retrieved when package is activated +# serialize: -> +# +# # Tear down any state and detach +# destroy: -> +# @element.remove() +# +# getElement: -> +# @element diff --git a/lib/minisuite.coffee b/lib/minisuite.coffee index f92eb3d..d8e76ae 100644 --- a/lib/minisuite.coffee +++ b/lib/minisuite.coffee @@ -1,5 +1,5 @@ -MinisuiteView = require './minisuite-view' -{CompositeDisposable} = require 'atom' +# MinisuiteView = require './minisuite-view' +# {CompositeDisposable} = require 'atom' module.exports = Minisuite = minisuiteView: null @@ -7,27 +7,28 @@ module.exports = Minisuite = subscriptions: null activate: (state) -> - @minisuiteView = new MinisuiteView(state.minisuiteViewState) - @modalPanel = atom.workspace.addModalPanel(item: @minisuiteView.getElement(), visible: false) + require('atom-package-deps').install 'MiniSuite' + # @minisuiteView = new MinisuiteView(state.minisuiteViewState) + # @modalPanel = atom.workspace.addModalPanel(item: @minisuiteView.getElement(), visible: false) + # + # # Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable + # @subscriptions = new CompositeDisposable + # + # # Register command that toggles this view + # @subscriptions.add atom.commands.add 'atom-workspace', 'minisuite:toggle': => @toggle() - # Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable - @subscriptions = new CompositeDisposable - - # Register command that toggles this view - @subscriptions.add atom.commands.add 'atom-workspace', 'minisuite:toggle': => @toggle() - - deactivate: -> - @modalPanel.destroy() - @subscriptions.dispose() - @minisuiteView.destroy() - - serialize: -> - minisuiteViewState: @minisuiteView.serialize() - - toggle: -> - console.log 'Minisuite was toggled!' - - if @modalPanel.isVisible() - @modalPanel.hide() - else - @modalPanel.show() + # deactivate: -> + # @modalPanel.destroy() + # @subscriptions.dispose() + # @minisuiteView.destroy() + # + # serialize: -> + # minisuiteViewState: @minisuiteView.serialize() + # + # toggle: -> + # console.log 'Minisuite was toggled!' + # + # if @modalPanel.isVisible() + # @modalPanel.hide() + # else + # @modalPanel.show() diff --git a/menus/minisuite.cson b/menus/minisuite.cson index 1c33fbf..3db96ae 100644 --- a/menus/minisuite.cson +++ b/menus/minisuite.cson @@ -1,22 +1,22 @@ -# See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details -'context-menu': - 'atom-text-editor': [ - { - 'label': 'Toggle minisuite' - 'command': 'minisuite:toggle' - } - ] -'menu': [ - { - 'label': 'Packages' - 'submenu': [ - 'label': 'minisuite' - 'submenu': [ - { - 'label': 'Toggle' - 'command': 'minisuite:toggle' - } - ] - ] - } -] +# # See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details +# 'context-menu': +# 'atom-text-editor': [ +# { +# 'label': 'Toggle minisuite' +# 'command': 'minisuite:toggle' +# } +# ] +# 'menu': [ +# { +# 'label': 'Packages' +# 'submenu': [ +# 'label': 'minisuite' +# 'submenu': [ +# { +# 'label': 'Toggle' +# 'command': 'minisuite:toggle' +# } +# ] +# ] +# } +# ] diff --git a/package.json b/package.json index 95384f9..8a0e34d 100644 --- a/package.json +++ b/package.json @@ -2,17 +2,18 @@ "name": "MiniSuite", "main": "./lib/minisuite", "version": "0.0.0", - "description": "A short description of your package", - "keywords": [ - ], - "activationCommands": { - "atom-workspace": "minisuite:toggle" - }, - "repository": "https://github.com/Dekker1/minisuite", + "description": "Bringing an MiniZinc IDE experience to atom", + "keywords": ["MiniZinc", "IDE", "linter", "autocompletion"], + "repository": "https://github.com/Dekker1/atom-minisuite", "license": "MIT", "engines": { "atom": ">=1.0.0 <2.0.0" }, "dependencies": { - } + "atom-package-deps": "^4.3.1" + }, + "package-deps": [ + "language-mzn", + "linter-mzn" + ] } diff --git a/spec/minisuite-spec.coffee b/spec/minisuite-spec.coffee index 9ad2db4..f607287 100644 --- a/spec/minisuite-spec.coffee +++ b/spec/minisuite-spec.coffee @@ -1,62 +1,62 @@ -Minisuite = require '../lib/minisuite' - -# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs. +# Minisuite = require '../lib/minisuite' # -# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit` -# or `fdescribe`). Remove the `f` to unfocus the block. - -describe "Minisuite", -> - [workspaceElement, activationPromise] = [] - - beforeEach -> - workspaceElement = atom.views.getView(atom.workspace) - activationPromise = atom.packages.activatePackage('minisuite') - - describe "when the minisuite:toggle event is triggered", -> - it "hides and shows the modal panel", -> - # Before the activation event the view is not on the DOM, and no panel - # has been created - expect(workspaceElement.querySelector('.minisuite')).not.toExist() - - # This is an activation event, triggering it will cause the package to be - # activated. - atom.commands.dispatch workspaceElement, 'minisuite:toggle' - - waitsForPromise -> - activationPromise - - runs -> - expect(workspaceElement.querySelector('.minisuite')).toExist() - - minisuiteElement = workspaceElement.querySelector('.minisuite') - expect(minisuiteElement).toExist() - - minisuitePanel = atom.workspace.panelForItem(minisuiteElement) - expect(minisuitePanel.isVisible()).toBe true - atom.commands.dispatch workspaceElement, 'minisuite:toggle' - expect(minisuitePanel.isVisible()).toBe false - - it "hides and shows the view", -> - # This test shows you an integration test testing at the view level. - - # Attaching the workspaceElement to the DOM is required to allow the - # `toBeVisible()` matchers to work. Anything testing visibility or focus - # requires that the workspaceElement is on the DOM. Tests that attach the - # workspaceElement to the DOM are generally slower than those off DOM. - jasmine.attachToDOM(workspaceElement) - - expect(workspaceElement.querySelector('.minisuite')).not.toExist() - - # This is an activation event, triggering it causes the package to be - # activated. - atom.commands.dispatch workspaceElement, 'minisuite:toggle' - - waitsForPromise -> - activationPromise - - runs -> - # Now we can test for view visibility - minisuiteElement = workspaceElement.querySelector('.minisuite') - expect(minisuiteElement).toBeVisible() - atom.commands.dispatch workspaceElement, 'minisuite:toggle' - expect(minisuiteElement).not.toBeVisible() +# # Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs. +# # +# # To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit` +# # or `fdescribe`). Remove the `f` to unfocus the block. +# +# describe "Minisuite", -> +# [workspaceElement, activationPromise] = [] +# +# beforeEach -> +# workspaceElement = atom.views.getView(atom.workspace) +# activationPromise = atom.packages.activatePackage('minisuite') +# +# describe "when the minisuite:toggle event is triggered", -> +# it "hides and shows the modal panel", -> +# # Before the activation event the view is not on the DOM, and no panel +# # has been created +# expect(workspaceElement.querySelector('.minisuite')).not.toExist() +# +# # This is an activation event, triggering it will cause the package to be +# # activated. +# atom.commands.dispatch workspaceElement, 'minisuite:toggle' +# +# waitsForPromise -> +# activationPromise +# +# runs -> +# expect(workspaceElement.querySelector('.minisuite')).toExist() +# +# minisuiteElement = workspaceElement.querySelector('.minisuite') +# expect(minisuiteElement).toExist() +# +# minisuitePanel = atom.workspace.panelForItem(minisuiteElement) +# expect(minisuitePanel.isVisible()).toBe true +# atom.commands.dispatch workspaceElement, 'minisuite:toggle' +# expect(minisuitePanel.isVisible()).toBe false +# +# it "hides and shows the view", -> +# # This test shows you an integration test testing at the view level. +# +# # Attaching the workspaceElement to the DOM is required to allow the +# # `toBeVisible()` matchers to work. Anything testing visibility or focus +# # requires that the workspaceElement is on the DOM. Tests that attach the +# # workspaceElement to the DOM are generally slower than those off DOM. +# jasmine.attachToDOM(workspaceElement) +# +# expect(workspaceElement.querySelector('.minisuite')).not.toExist() +# +# # This is an activation event, triggering it causes the package to be +# # activated. +# atom.commands.dispatch workspaceElement, 'minisuite:toggle' +# +# waitsForPromise -> +# activationPromise +# +# runs -> +# # Now we can test for view visibility +# minisuiteElement = workspaceElement.querySelector('.minisuite') +# expect(minisuiteElement).toBeVisible() +# atom.commands.dispatch workspaceElement, 'minisuite:toggle' +# expect(minisuiteElement).not.toBeVisible() diff --git a/spec/minisuite-view-spec.coffee b/spec/minisuite-view-spec.coffee index 06e8440..521c4ef 100644 --- a/spec/minisuite-view-spec.coffee +++ b/spec/minisuite-view-spec.coffee @@ -1,5 +1,5 @@ -MinisuiteView = require '../lib/minisuite-view' - -describe "MinisuiteView", -> - it "has one valid test", -> - expect("life").toBe "easy" +# MinisuiteView = require '../lib/minisuite-view' +# +# describe "MinisuiteView", -> +# it "has one valid test", -> +# expect("life").toBe "easy" diff --git a/styles/minisuite.less b/styles/minisuite.less index 8ed0e2a..30388b4 100644 --- a/styles/minisuite.less +++ b/styles/minisuite.less @@ -2,7 +2,7 @@ // // See https://github.com/atom/atom-dark-ui/blob/master/styles/ui-variables.less // for a full listing of what's available. -@import "ui-variables"; - -.minisuite { -} +// @import "ui-variables"; +// +// .minisuite { +// }